Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add playlist random selector #17441

Merged
merged 3 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading