Skip to content

Commit

Permalink
Add playlist random selector (#17441)
Browse files Browse the repository at this point in the history
* Add playlist random selector

* Buildfix attempt

* ORBIS buildfix attempt
  • Loading branch information
sonninnos authored Jan 20, 2025
1 parent 52320df commit 391ba55
Show file tree
Hide file tree
Showing 8 changed files with 871 additions and 420 deletions.
4 changes: 4 additions & 0 deletions intl/msg_hash_us.h
Original file line number Diff line number Diff line change
Expand Up @@ -10452,6 +10452,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_CYCLE_THUMBNAILS,
"Cycle thumbnails"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RANDOM_SELECT,
"Random select"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_BASIC_MENU_CONTROLS_BACK,
"Back"
Expand Down
14 changes: 14 additions & 0 deletions libretro-common/include/retro_math.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#define _LIBRETRO_COMMON_MATH_H

#include <stdint.h>
#include <stdlib.h>

#if defined(_WIN32) && !defined(_XBOX)
#define WIN32_LEAN_AND_MEAN
Expand Down Expand Up @@ -187,4 +188,17 @@ static INLINE void convert_yxy_to_rgb(const float* Yxy, float* rgb)
rgb[2] = dot_product(xyz_rgb[2], xyz);
}

/**
* Picks a random value between a specified range.
*
* @param \c min unsigned minimum possible value.
* @param \c max unsigned maximum possible value.
*
* @return unsigned random value between \c min and \c max (inclusive).
*/
static INLINE unsigned random_range(unsigned min, unsigned max)
{
return (min == max) ? min : (unsigned)((float)rand() / (float)RAND_MAX * (max + 1 - min) + min);
}

#endif
229 changes: 184 additions & 45 deletions menu/drivers/materialui.c

Large diffs are not rendered by default.

Loading

0 comments on commit 391ba55

Please sign in to comment.