ゲーム中に用いる変数型定義 / Basic "types". [詳細]
マクロ定義 | |
#define | uint uint_hack |
非マッキントッシュ環境で重複を避けるためのuint_hack型定義 / Hack – prevent problems with non-MACINTOSH [詳細] | |
#define | huge huge_hack |
MSDOS及びWINDOWS環境で重複を避けるためのhuge_hack定義 / Hack – prevent problems with MSDOS and WINDOWS. [詳細] | |
#define | byte byte_hack |
AMIGA環境で重複を避けるためのbyte_hack定義 / Hack – prevent problems with AMIGA. [詳細] | |
#define | bool bool_hack |
C++環境で重複を避けるためのbool_hack定義 Hack – prevent problems with C++. [詳細] | |
型定義 | |
typedef void * | vptr |
void型ポインタ定義 / A standard pointer (to "void" because ANSI C says so) [詳細] | |
typedef const char * | cptr |
文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings) [詳細] | |
typedef double | real |
doubleをreal型として定義 / Since float's are silly, hard code real numbers as doubles [詳細] | |
typedef int | errr |
エラーコードの定義 / Error codes for function return values [詳細] | |
typedef unsigned char | byte |
byte型をunsighned charとして定義 / Note that unsigned values can cause math problems / An unsigned byte of memory [詳細] | |
typedef char | bool |
bool型をcharとして定義 / Note that a bool is smaller than a full "int" / Simple True/False type [詳細] | |
typedef int | sint |
sint型をintとして定義 / A signed, standard integer (at least 2 bytes) [詳細] | |
typedef unsigned int | uint |
typedef unsigned long | huge |
typedef signed short | s16b |
typedef unsigned short | u16b |
typedef signed long | s32b |
typedef unsigned long | u32b |
typedef real * | real_ptr |
typedef errr * | errr_ptr |
typedef char * | char_ptr |
typedef byte * | byte_ptr |
typedef bool * | bool_ptr |
typedef sint * | sint_ptr |
typedef uint * | uint_ptr |
typedef long * | long_ptr |
typedef huge * | huge_ptr |
typedef s16b * | s16b_ptr |
typedef u16b * | u16b_ptr |
typedef s32b * | s32b_ptr |
typedef u32b * | u32b_ptr |
typedef vptr * | vptr_ptr |
typedef cptr * | cptr_ptr |
typedef errr(* | func_gen )(vptr, vptr) |
typedef bool(* | func_eql )(vptr, vptr) |
typedef sint(* | func_cmp )(vptr, vptr) |
typedef uint(* | func_hsh )(vptr, uint) |
typedef vptr(* | func_key )(vptr) |
ゲーム中に用いる変数型定義 / Basic "types".
Note the attempt to make all basic types have 4 letters. This improves readibility and standardizes the code. Likewise, all complex types are at least 4 letters. Thus, almost every three letter word is a legal variable. But beware of certain reserved words ('for' and 'if' and 'do'). Note that the type used in structures for bit flags should be uint. As long as these bit flags are sequential, they will be space smart. Note that on some machines, apparently "signed char" is illegal. It must be true that char/byte takes exactly 1 byte It must be true that sind/uind takes exactly 2 bytes It must be true that sbig/ubig takes exactly 4 bytes On Sparc's, a sint takes 4 bytes (2 is legal) On Sparc's, a uint takes 4 bytes (2 is legal) On Sparc's, a long takes 4 bytes (8 is legal) On Sparc's, a huge takes 4 bytes (8 is legal) On Sparc's, a vptr takes 4 bytes (8 is legal) On Sparc's, a real takes 8 bytes (4 is legal) Note that some files have already been included by "h-include.h" These include <stdio.h> and <sys/types>, which define some types In particular, uint is defined so we do not have to define it Also, see <limits.h> for min/max values for sind, uind, long, huge (SHRT_MIN, SHRT_MAX, USHRT_MAX, LONG_MIN, LONG_MAX, ULONG_MAX) These limits should be verified and coded into "h-constant.h".
#define bool bool_hack |
C++環境で重複を避けるためのbool_hack定義 Hack – prevent problems with C++.
#define byte byte_hack |
AMIGA環境で重複を避けるためのbyte_hack定義 / Hack – prevent problems with AMIGA.
#define huge huge_hack |
MSDOS及びWINDOWS環境で重複を避けるためのhuge_hack定義 / Hack – prevent problems with MSDOS and WINDOWS.
#define uint uint_hack |
非マッキントッシュ環境で重複を避けるためのuint_hack型定義 / Hack – prevent problems with non-MACINTOSH
typedef char bool |
bool型をcharとして定義 / Note that a bool is smaller than a full "int" / Simple True/False type
typedef unsigned char byte |
byte型をunsighned charとして定義 / Note that unsigned values can cause math problems / An unsigned byte of memory
typedef char* char_ptr |
typedef const char* cptr |
文字列定数用ポインタ定義 / A simple pointer (to unmodifiable strings)
typedef int errr |
エラーコードの定義 / Error codes for function return values
一般に成功時0、失敗時負数、何らかの問題時整数とする。 Success = 0, Failure = -N, Problem = +N
typedef unsigned long huge |
typedef long* long_ptr |
typedef double real |
doubleをreal型として定義 / Since float's are silly, hard code real numbers as doubles
typedef signed short s16b |
typedef signed long s32b |
typedef int sint |
sint型をintとして定義 / A signed, standard integer (at least 2 bytes)
typedef unsigned short u16b |
typedef unsigned long u32b |
typedef unsigned int uint |
typedef void* vptr |
void型ポインタ定義 / A standard pointer (to "void" because ANSI C says so)