mirror of
https://github.com/libretro/RetroArch
synced 2025-01-18 13:23:40 +00:00
Transition count semantic.
This commit is contained in:
parent
f62120861a
commit
e02d9f41e8
@ -420,6 +420,8 @@ static bool load_imports(const char *dir_path, config_file_t *conf)
|
||||
tracker_type = SSNES_STATE_CAPTURE;
|
||||
else if (strcmp(semantic, "transition") == 0)
|
||||
tracker_type = SSNES_STATE_TRANSITION;
|
||||
else if (strcmp(semantic, "transition_count") == 0)
|
||||
tracker_type = SSNES_STATE_TRANSITION_COUNT;
|
||||
else if (strcmp(semantic, "capture_previous") == 0)
|
||||
tracker_type = SSNES_STATE_CAPTURE_PREV;
|
||||
else if (strcmp(semantic, "transition_previous") == 0)
|
||||
|
@ -441,6 +441,8 @@ static bool get_import_value(const char *path, xmlNodePtr ptr)
|
||||
tracker_type = SSNES_STATE_CAPTURE_PREV;
|
||||
else if (strcmp((const char*)semantic, "transition") == 0)
|
||||
tracker_type = SSNES_STATE_TRANSITION;
|
||||
else if (strcmp((const char*)semantic, "transition_count") == 0)
|
||||
tracker_type = SSNES_STATE_TRANSITION_COUNT;
|
||||
else if (strcmp((const char*)semantic, "transition_previous") == 0)
|
||||
tracker_type = SSNES_STATE_TRANSITION_PREV;
|
||||
#ifdef HAVE_PYTHON
|
||||
|
@ -42,7 +42,7 @@ struct snes_tracker_internal
|
||||
uint8_t prev[2];
|
||||
int frame_count;
|
||||
uint8_t old_value;
|
||||
|
||||
int transition_count;
|
||||
};
|
||||
|
||||
struct snes_tracker
|
||||
@ -160,6 +160,15 @@ static void update_element(
|
||||
uniform->value = info->frame_count;
|
||||
break;
|
||||
|
||||
case SSNES_STATE_TRANSITION_COUNT:
|
||||
if (info->old_value != fetch())
|
||||
{
|
||||
info->old_value = fetch();
|
||||
info->transition_count++;
|
||||
}
|
||||
uniform->value = info->transition_count;
|
||||
break;
|
||||
|
||||
case SSNES_STATE_TRANSITION_PREV:
|
||||
if (info->prev[0] != fetch())
|
||||
{
|
||||
|
@ -27,8 +27,9 @@
|
||||
enum snes_tracker_type
|
||||
{
|
||||
SSNES_STATE_CAPTURE,
|
||||
SSNES_STATE_TRANSITION,
|
||||
SSNES_STATE_CAPTURE_PREV,
|
||||
SSNES_STATE_TRANSITION,
|
||||
SSNES_STATE_TRANSITION_COUNT,
|
||||
SSNES_STATE_TRANSITION_PREV,
|
||||
#ifdef HAVE_PYTHON
|
||||
SSNES_STATE_PYTHON
|
||||
|
Loading…
x
Reference in New Issue
Block a user