mirror of
https://github.com/libretro/RetroArch
synced 2025-01-26 09:35:21 +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;
|
tracker_type = SSNES_STATE_CAPTURE;
|
||||||
else if (strcmp(semantic, "transition") == 0)
|
else if (strcmp(semantic, "transition") == 0)
|
||||||
tracker_type = SSNES_STATE_TRANSITION;
|
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)
|
else if (strcmp(semantic, "capture_previous") == 0)
|
||||||
tracker_type = SSNES_STATE_CAPTURE_PREV;
|
tracker_type = SSNES_STATE_CAPTURE_PREV;
|
||||||
else if (strcmp(semantic, "transition_previous") == 0)
|
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;
|
tracker_type = SSNES_STATE_CAPTURE_PREV;
|
||||||
else if (strcmp((const char*)semantic, "transition") == 0)
|
else if (strcmp((const char*)semantic, "transition") == 0)
|
||||||
tracker_type = SSNES_STATE_TRANSITION;
|
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)
|
else if (strcmp((const char*)semantic, "transition_previous") == 0)
|
||||||
tracker_type = SSNES_STATE_TRANSITION_PREV;
|
tracker_type = SSNES_STATE_TRANSITION_PREV;
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
|
@ -42,7 +42,7 @@ struct snes_tracker_internal
|
|||||||
uint8_t prev[2];
|
uint8_t prev[2];
|
||||||
int frame_count;
|
int frame_count;
|
||||||
uint8_t old_value;
|
uint8_t old_value;
|
||||||
|
int transition_count;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct snes_tracker
|
struct snes_tracker
|
||||||
@ -160,6 +160,15 @@ static void update_element(
|
|||||||
uniform->value = info->frame_count;
|
uniform->value = info->frame_count;
|
||||||
break;
|
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:
|
case SSNES_STATE_TRANSITION_PREV:
|
||||||
if (info->prev[0] != fetch())
|
if (info->prev[0] != fetch())
|
||||||
{
|
{
|
||||||
|
@ -27,8 +27,9 @@
|
|||||||
enum snes_tracker_type
|
enum snes_tracker_type
|
||||||
{
|
{
|
||||||
SSNES_STATE_CAPTURE,
|
SSNES_STATE_CAPTURE,
|
||||||
SSNES_STATE_TRANSITION,
|
|
||||||
SSNES_STATE_CAPTURE_PREV,
|
SSNES_STATE_CAPTURE_PREV,
|
||||||
|
SSNES_STATE_TRANSITION,
|
||||||
|
SSNES_STATE_TRANSITION_COUNT,
|
||||||
SSNES_STATE_TRANSITION_PREV,
|
SSNES_STATE_TRANSITION_PREV,
|
||||||
#ifdef HAVE_PYTHON
|
#ifdef HAVE_PYTHON
|
||||||
SSNES_STATE_PYTHON
|
SSNES_STATE_PYTHON
|
||||||
|
Loading…
x
Reference in New Issue
Block a user