Copy project
This commit is contained in:
parent
ce7a467af7
commit
26a0fd884f
173 changed files with 157458 additions and 1 deletions
11
space_game/SpaceGame/src/macros/bitwise.h
Normal file
11
space_game/SpaceGame/src/macros/bitwise.h
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#ifndef BITWISE_H
|
||||
#define BITWISE_H
|
||||
|
||||
#define BV(x) (1 << (x))
|
||||
#define modifyBit(P, B, V) ((P) = ((P) & ~BV(B)) | ((V) << B))
|
||||
#define setBit(P, B) ((P) |= BV(B))
|
||||
#define clearBit(P, B) ((P) &= ~BV(B))
|
||||
#define toggleBit(P, B) ((P) ^= BV(B))
|
||||
#define getBit(P, B) (((P) & BV(B)) >> (B))
|
||||
|
||||
#endif
|
||||
9
space_game/SpaceGame/src/macros/math.h
Normal file
9
space_game/SpaceGame/src/macros/math.h
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef MATH_H
|
||||
#define MATH_H
|
||||
|
||||
|
||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define min(a, b) ((a) > (b) ? (b) : (a))
|
||||
#define abs(a, b) ((a) > 0 ? (a) : (-a))
|
||||
|
||||
#endif
|
||||
3
space_game/SpaceGame/src/macros/null.h
Normal file
3
space_game/SpaceGame/src/macros/null.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#ifndef NULL
|
||||
#define NULL ((void*)0)
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue