- rename standard integer types to a more familiar (u)int(8/16/32) - many function/struct renames. i don't _really_ know if what i've done for this is better, but it "feels" better to me. many draw/blit function names are shorter which is nice, at least. kinda important to me because i develop this on a real DOS machine in 80x50 text mode. - add 'extern "C"' blocks to headers for C++ compiler usage - draw/pixel color value arguments for functions should all have been changed to be uint8 instead of a full 32-bit int. feels right, but maybe should've left alone... - small fix to keyboard handler. noticed a problem on one thinkpad laptop. was a result of what i think was a typo in a constant value used during the part of the interrupt handler that tells the keyboard controller the key event was processed - fix uncommon potential crash function return in draw_filled_rect - renamed low-level "direct" assembly functions to "lowlevel_xxx" to be a little bit more explicit about what they are - add some convenience event helper functions for determining event types - add fixed point atan2 - fixed some tabs/spaces inconsistences (should all be spaces now?) - maybe some other minor things i've forgotten
49 lines
1.1 KiB
C
Executable file
49 lines
1.1 KiB
C
Executable file
#ifndef LIBDGL_DGLCMN_H
|
|
#define LIBDGL_DGLCMN_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef char int8;
|
|
typedef short int16;
|
|
typedef int int32;
|
|
|
|
typedef unsigned char uint8;
|
|
typedef unsigned short uint16;
|
|
typedef unsigned int uint32;
|
|
|
|
#ifndef bool
|
|
typedef int bool;
|
|
#define true 1
|
|
#define false 0
|
|
#endif
|
|
|
|
#define BIT_0 0x1
|
|
#define BIT_1 0x2
|
|
#define BIT_2 0x4
|
|
#define BIT_3 0x8
|
|
#define BIT_4 0x10
|
|
#define BIT_5 0x20
|
|
#define BIT_6 0x40
|
|
#define BIT_7 0x80
|
|
|
|
#define BIT_ISSET(bit, x) ((x) & (bit))
|
|
#define BIT_SET(bit, x) ((x) |= (bit))
|
|
#define BIT_CLEAR(bit, x) ((x) &= ~(bit))
|
|
#define BIT_TOGGLE(bit, x) ((x) ^= (bit))
|
|
|
|
#ifndef MAX
|
|
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
|
|
#endif
|
|
#ifndef MIN
|
|
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|