Skip to content

Commit d77ca59

Browse files
billyquithSiegeLord
authored andcommitted
Move bmp_* macros to only file they are used.
- avoids user code pollution with unnecessary macros.
1 parent 2c4665d commit d77ca59

File tree

2 files changed

+8
-13
lines changed

2 files changed

+8
-13
lines changed

include/allegro5/internal/alconfig.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@
222222
extern "C" {
223223
#endif
224224

225-
226225
/* endian-independent 3-byte accessor macros */
227226
#ifdef ALLEGRO_LITTLE_ENDIAN
228227

@@ -248,17 +247,6 @@
248247
#error endianess not defined
249248
#endif
250249

251-
252-
/* generic versions of the video memory access helpers */
253-
/* FIXME: why do we need macros for this? */
254-
#define bmp_write16(addr, c) (*((uint16_t *)(addr)) = (c))
255-
#define bmp_write32(addr, c) (*((uint32_t *)(addr)) = (c))
256-
257-
#define bmp_read16(addr) (*((uint16_t *)(addr)))
258-
#define bmp_read32(addr) (*((uint32_t *)(addr)))
259-
260-
261-
262250
#ifdef __cplusplus
263251
}
264252
#endif

src/memdraw.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
#include "allegro5/internal/aintern_memdraw.h"
2323
#include "allegro5/internal/aintern_pixels.h"
2424

25+
/* generic versions of the video memory access helpers */
26+
/* FIXME: why do we need macros for this? */
27+
#define bmp_write16(addr, c) (*((uint16_t *)(addr)) = (c))
28+
#define bmp_write32(addr, c) (*((uint32_t *)(addr)) = (c))
29+
30+
#define bmp_read16(addr) (*((uint16_t *)(addr)))
31+
#define bmp_read32(addr) (*((uint32_t *)(addr)))
2532

2633
typedef struct {
2734
float x[4];
@@ -104,7 +111,7 @@ void _al_clear_bitmap_by_locking(ALLEGRO_BITMAP *bitmap, ALLEGRO_COLOR *color)
104111
}
105112
else {
106113
for (x = 0; x < w; x++) {
107-
WRITE3BYTES(data, pixel_value);
114+
AL_WRITE3BYTES(data, pixel_value);
108115
data += 3;
109116
}
110117
}

0 commit comments

Comments
 (0)