Skip to content

Commit

Permalink
Merge pull request #430 from go-vgo/bitmap-pr
Browse files Browse the repository at this point in the history
add sys scale option displayID support and remove unused files
  • Loading branch information
vcaesar authored Jan 4, 2022
2 parents 348b39c + f6abdbe commit 0b6cc48
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 419 deletions.
38 changes: 19 additions & 19 deletions base/MMBitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ typedef MMBitmap *MMBitmapRef;

/* Creates new MMBitmap with the given values.
* Follows the Create Rule (caller is responsible for destroy()'ing object). */
MMBitmapRef createMMBitmap(uint8_t *buffer, size_t width, size_t height,
MMBitmapRef createMMBitmap_c(uint8_t *buffer, size_t width, size_t height,
size_t bytewidth, uint8_t bitsPerPixel,
uint8_t bytesPerPixel);

Expand All @@ -43,12 +43,12 @@ void destroyMMBitmap(MMBitmapRef bitmap);
/* Releases memory occupied by MMBitmap. Acts via CallBack method*/
void destroyMMBitmapBuffer(char * bitmapBuffer, void * hint);

/* Returns copy of MMBitmap, to be destroy()'d by caller. */
MMBitmapRef copyMMBitmap(MMBitmapRef bitmap);
// /* Returns copy of MMBitmap, to be destroy()'d by caller. */
// MMBitmapRef copyMMBitmap(MMBitmapRef bitmap);

/* Returns copy of one MMBitmap juxtaposed in another (to be destroy()'d
* by the caller.), or NULL on error. */
MMBitmapRef copyMMBitmapFromPortion(MMBitmapRef source, MMRect rect);
// /* Returns copy of one MMBitmap juxtaposed in another (to be destroy()'d
// * by the caller.), or NULL on error. */
// MMBitmapRef copyMMBitmapFromPortion(MMBitmapRef source, MMRect rect);

#define MMBitmapPointInBounds(image, p) ((p).x < (image)->width && \
(p).y < (image)->height)
Expand All @@ -72,19 +72,19 @@ MMBitmapRef copyMMBitmapFromPortion(MMBitmapRef source, MMRect rect);
#define MMRGBHexAtPoint(image, x, y) \
hexFromMMRGB(MMRGBColorAtPoint(image, x, y))

/* Increment either point.x or point.y depending on the position of point.x.
* That is, if x + 1 is >= width, increment y and start x at the beginning.
* Otherwise, increment x.
*
* This is used as a convenience macro to scan rows when calling functions such
* as findColorInRectAt() and findBitmapInBitmapAt(). */
#define ITER_NEXT_POINT(pixel, width, start_x) \
do { \
if (++(pixel).x >= (width)) { \
(pixel).x = start_x; \
++(point).y; \
} \
} while (0);
// /* Increment either point.x or point.y depending on the position of point.x.
// * That is, if x + 1 is >= width, increment y and start x at the beginning.
// * Otherwise, increment x.
// *
// * This is used as a convenience macro to scan rows when calling functions such
// * as findColorInRectAt() and findBitmapInBitmapAt(). */
// #define ITER_NEXT_POINT(pixel, width, start_x) \
// do { \
// if (++(pixel).x >= (width)) { \
// (pixel).x = start_x; \
// ++(point).y; \
// } \
// } while (0);

#ifdef __cplusplus
}
Expand Down
9 changes: 3 additions & 6 deletions base/deadbeef_rand_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@
static uint32_t deadbeef_seed;
static uint32_t deadbeef_beef = 0xdeadbeef;

uint32_t deadbeef_rand(void)
{
uint32_t deadbeef_rand(void) {
deadbeef_seed = (deadbeef_seed << 7) ^ ((deadbeef_seed >> 25) + deadbeef_beef);
deadbeef_beef = (deadbeef_beef << 7) ^ ((deadbeef_beef >> 25) + 0xdeadbeef);
return deadbeef_seed;
}

void deadbeef_srand(uint32_t x)
{
void deadbeef_srand(uint32_t x) {
deadbeef_seed = x;
deadbeef_beef = 0xdeadbeef;
}

/* Taken directly from the documentation:
* http://inglorion.net/software/cstuff/deadbeef_rand/ */
uint32_t deadbeef_generate_seed(void)
{
uint32_t deadbeef_generate_seed(void) {
uint32_t t = (uint32_t)time(NULL);
uint32_t c = (uint32_t)clock();
return (t << 24) ^ (c << 11) ^ t ^ (size_t) &c;
Expand Down
252 changes: 0 additions & 252 deletions event/goEvent.h

This file was deleted.

Loading

0 comments on commit 0b6cc48

Please sign in to comment.