Add new transition_previous.

This commit is contained in:
Themaister 2011-05-26 16:23:11 +02:00
parent ee83c31183
commit aec44b093e
3 changed files with 26 additions and 13 deletions

View File

@ -448,6 +448,8 @@ static bool get_import_value(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_previous") == 0)
tracker_type = SSNES_STATE_TRANSITION_PREV;
else
{
SSNES_ERR("Invalid semantic for import value.\n");

View File

@ -104,18 +104,6 @@ static void update_element(
uniform->value = info->ptr[info->addr];
break;
case SSNES_STATE_TRANSITION:
if (info->old_value != info->ptr[info->addr])
{
info->old_value = info->ptr[info->addr];
info->frame_count = frame_count;
uniform->value = info->frame_count;
}
else
uniform->value = info->frame_count;
break;
case SSNES_STATE_CAPTURE_PREV:
if (info->prev[0] != info->ptr[info->addr])
{
@ -125,6 +113,28 @@ static void update_element(
uniform->value = info->prev[1];
break;
case SSNES_STATE_TRANSITION:
if (info->old_value != info->ptr[info->addr])
{
info->old_value = info->ptr[info->addr];
info->frame_count = frame_count;
}
uniform->value = info->frame_count;
break;
case SSNES_STATE_TRANSITION_PREV:
if (info->prev[0] != info->ptr[info->addr])
{
info->old_value = info->ptr[info->addr];
info->prev[1] = info->prev[0];
info->prev[0] = frame_count;
info->frame_count = frame_count;
}
uniform->value = info->prev[1];
break;
default:
break;
}

View File

@ -24,7 +24,8 @@ enum snes_tracker_type
{
SSNES_STATE_CAPTURE,
SSNES_STATE_TRANSITION,
SSNES_STATE_CAPTURE_PREV
SSNES_STATE_CAPTURE_PREV,
SSNES_STATE_TRANSITION_PREV
};
enum snes_ram_type