Skip to content

Commit

Permalink
New option video loop true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
fredbcode committed Mar 30, 2014
1 parent ec98ae1 commit fab280b
Show file tree
Hide file tree
Showing 103 changed files with 128 additions and 2 deletions.
Empty file modified COPYING
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified Makefile.mingw
100644 → 100755
Empty file.
Empty file modified README
100644 → 100755
Empty file.
Empty file modified bg.c
100644 → 100755
Empty file.
Empty file modified category.c
100644 → 100755
Empty file.
11 changes: 11 additions & 0 deletions config.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ static const char *tag_game_images_image = "image";
static const char *tag_game_video = "video";
static const char *tag_iface = "interface";
static const char *tag_iface_full_screen = "full-screen";
static const char *tag_iface_video_loop = "video-loop";
static const char *tag_iface_screen = "screen";
static const char *tag_iface_screen_hflip = "flip-horizontal";
static const char *tag_iface_screen_vflip = "flip-vertical";
Expand Down Expand Up @@ -1572,6 +1573,10 @@ int config_read_interface( xmlNode *node ) {
if( strcmp( (char*)node->name, tag_iface_full_screen ) == 0 ) {
config_read_boolean( (char*)node->name, (char*)xmlNodeGetContent(node), &config.iface.full_screen );
}
else if( strcmp( (char*)node->name, tag_iface_video_loop ) == 0 ) {
config_read_boolean( (char*)node->name, (char*)xmlNodeGetContent(node), &config.iface.video_loop );
}

else if( strcmp( (char*)node->name, tag_iface_screen ) == 0 ) {
config_read_interface_screen( node->children );
}
Expand Down Expand Up @@ -1704,6 +1709,10 @@ int config_read_interface_theme( xmlNode *node, struct config_theme *theme ) {
else if( strcmp( (char*)node->name, tag_iface_full_screen ) == 0 ) {
/* Ignore */
}
else if( strcmp( (char*)node->name, tag_iface_video_loop ) == 0 ) {
/* Ignore */
}

else if( strcmp( (char*)node->name, tag_iface_screen ) == 0 ) {
/* Ignore */
}
Expand Down Expand Up @@ -1958,6 +1967,7 @@ int config_write_interface( xmlNodePtr root ) {
int i;
xmlNodePtr interface = xmlNewNode( NULL, (xmlChar*)tag_iface );
xmlNewChild( interface, NULL, (xmlChar*)tag_iface_full_screen, config_write_boolean( config.iface.full_screen ) );
xmlNewChild( interface, NULL, (xmlChar*)tag_iface_video_loop, config_write_boolean( config.iface.video_loop ) );

xmlNodePtr screen = xmlNewNode( NULL, (xmlChar*)tag_iface_screen );
xmlNewChild( screen, NULL, (xmlChar*)tag_width, config_write_numeric( config.iface.screen_width ) );
Expand Down Expand Up @@ -2182,6 +2192,7 @@ int config_new( void ) {
config.platforms = NULL;

config.iface.full_screen = 0;
config.iface.video_loop = 0;
config.iface.screen_width = 640;
config.iface.screen_height = 480;
config.iface.screen_rotation = 0;
Expand Down
Empty file modified control.c
100644 → 100755
Empty file.
Empty file modified data/fonts/FreeSans.ttf
100644 → 100755
Empty file.
Empty file modified data/pixmaps/arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/button_blue.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/button_green.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/button_red.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/button_white.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/button_yellow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/default_background.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/menu_item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/noise1.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/noise2.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/noise3.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/pixmaps/submenu_item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/sounds/back.wav
100644 → 100755
Empty file.
Empty file modified data/sounds/blip.wav
100644 → 100755
Empty file.
Empty file modified data/sounds/no.wav
100644 → 100755
Empty file.
Empty file modified data/sounds/select.wav
100644 → 100755
Empty file.
Empty file modified data/themes/carousel/background.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/carousel/menu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/carousel/submenu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/carousel/theme.xml
100644 → 100755
Empty file.
Empty file modified data/themes/ice/arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/ice/background.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/ice/menu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/ice/submenu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/ice/theme.xml
100644 → 100755
Empty file.
Empty file modified data/themes/industrial/CREDITS
100644 → 100755
Empty file.
Empty file modified data/themes/industrial/arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/industrial/jet.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/industrial/menu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/industrial/submenu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/industrial/theme.xml
100644 → 100755
Empty file.
Empty file modified data/themes/wood/arrow.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/wood/menu-item.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified data/themes/wood/rings.jpg
100644 → 100755
Empty file modified data/themes/wood/submenu-item.png
100644 → 100755
Empty file modified data/themes/wood/theme.xml
100644 → 100755
Empty file.
Empty file modified debian/changelog
100644 → 100755
Empty file.
Empty file modified debian/compat
100644 → 100755
Empty file.
Empty file modified debian/control
100644 → 100755
Empty file.
Empty file modified debian/copyright
100644 → 100755
Empty file.
Empty file modified debian/dirs
100644 → 100755
Empty file.
Empty file modified emulator.c
100644 → 100755
Empty file.
Empty file modified event.c
100644 → 100755
Empty file.
Empty file modified focus.c
100644 → 100755
Empty file.
Empty file modified font.c
100644 → 100755
Empty file.
Empty file modified frame.c
100644 → 100755
Empty file.
Empty file modified game.c
100644 → 100755
Empty file.
Empty file modified game_sel.c
100644 → 100755
Empty file.
Empty file modified hint.c
100644 → 100755
Empty file.
109 changes: 109 additions & 0 deletions iface
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
bg.c: if( config->iface.theme.background_image[0] != '\0' ) {
bg.c: location_get_theme_path( config->iface.theme.background_image , filename );
bg.c: fprintf( stderr, "Warning: couldn't create background texture from '%s'\n", config->iface.theme.background_image );
bg.c: alpha = 1.0 - (GLfloat)(config->iface.theme.background_transparency)/100;
bg.c: if( config->iface.frame_rate )
bg.c: angle_step = (GLfloat)config->iface.theme.background_rotation/((GLfloat)config->iface.frame_rate*20);
bg.c: angle_step = (GLfloat)config->iface.theme.background_rotation/1000;
event.c: events[i].device_type = config->iface.controls[i].device_type;
event.c: events[i].device_id = config->iface.controls[i].device_id;
event.c: events[i].control_type = config->iface.controls[i].control_type;
event.c: events[i].control_id = config->iface.controls[i].control_id;
event.c: events[i].value = config->iface.controls[i].value;
font.c: if( config->iface.theme.font_size > 0 )
font.c: size = config->iface.theme.font_size;
font.c: col.r = config->iface.theme.font_rgb.red;
font.c: col.g = config->iface.theme.font_rgb.green;
font.c: col.b = config->iface.theme.font_rgb.blue;
font.c: if( config->iface.theme.font_file && *config->iface.theme.font_file ) {
font.c: font = TTF_OpenFont( config->iface.theme.font_file, size );
font.c: fprintf( stderr, "Error: Couldn't load font '%s': %s\n", config->iface.theme.font_file, TTF_GetError() );
game_sel.c: if( config->orientation == CONFIG_PORTRAIT ) {
game_sel.c: (tile->pos[X] + config->offset1 + (((dest->pos[X]-tile->pos[X])/steps)*step)) * x_scale * xfactor,
game_sel.c: (tile->pos[Y] + config->offset2 + (((dest->pos[Y]-tile->pos[Y])/steps)*step)) * y_scale * xfactor,
game_sel.c: -((tile->pos[Y] + config->offset2 + (((dest->pos[Y]-tile->pos[Y])/steps)*step)) * x_scale * xfactor),
game_sel.c: -((tile->pos[X] + config->offset1 + (((dest->pos[X]-tile->pos[X])/steps)*step)) * y_scale * xfactor),
hint.c: location_get_theme_path( config->iface.theme.hints.image_arrow, filename );
hint.c: location_get_theme_path( config->iface.theme.hints.image_back, filename );
hint.c: location_get_theme_path( config->iface.theme.hints.image_select, filename );
hint.c: if(!( text_select_message = font_create_texture( config->iface.labels.label_select ) ))
hint.c: if(!( text_back_message = font_create_texture( config->iface.labels.label_back ) ))
hint.c: if( config->iface.frame_rate )
hint.c: alpha_step = (GLfloat)config->iface.frame_rate/6000;
hint.c: GLfloat size = (BUTTON_SIZE/2) * config->size * xfactor;
hint.c: glTranslatef( (config->offset2 + (position * config->size)) * xfactor, config->offset1 * yfactor, DEPTH );
hint.c: GLfloat tx = ((message->width*FONT_SCALE)/2) * config->size * xfactor;
hint.c: GLfloat ty = ((message->height*FONT_SCALE)/2) * config->size * xfactor;
hint.c: glTranslatef( (config->offset2 + (position * config->size)) * xfactor, config->offset1 * yfactor, DEPTH );
menu.c: if( config->iface.frame_rate )
menu.c: steps = config->iface.frame_rate;
menu.c: zoom = (GLfloat)config->iface.theme.menu.zoom;
menu.c: spacing = (GLfloat)config->iface.theme.menu.spacing;
menu.c: if( config->iface.theme.menu.orientation == CONFIG_LANDSCAPE )
menu.c: spacing = (GLfloat)config->iface.theme.menu.item_width * ITEM_SCALE * zoom * SPACING_FACTOR;
menu.c: spacing = (GLfloat)config->iface.theme.menu.item_height * ITEM_SCALE * zoom * SPACING_FACTOR;
menu.c: min_alpha = 1.0 - (GLfloat)(config->iface.theme.menu.transparency)/100;
menu.c: menu_item_add( config->iface.labels.label_all, MENU_ALL, NULL );
menu.c: if( platform_count() > 1 || config->iface.prune_menus == 0 ) {
menu.c: menu_item_add( config->iface.labels.label_platform, MENU_PLATFORM, NULL );
menu.c: if( category->value_count > 1 || config->iface.prune_menus == 0 )
menu.c: if( menu_items > config->iface.theme.menu.max_visible )
menu.c: items_visible = config->iface.theme.menu.max_visible;
menu.c: if( config->iface.theme.menu.orientation == CONFIG_LANDSCAPE ) {
menu.c: tile->x = (offset + config->iface.theme.menu.offset1);
menu.c: tile->y = config->iface.theme.menu.offset2;
menu.c: tile->x = -config->iface.theme.menu.offset2 * ogl_aspect_ratio();
menu.c: tile->y = -(offset + config->iface.theme.menu.offset1);
menu.c: for( i = 0 ; i < ((config->iface.theme.menu.max_visible+1)/2) ; i++ ) {
menu.c: arrow_retreat.size = config->iface.theme.menu.item_height * ITEM_SCALE * 1.5;
menu.c: arrow_advance.size = config->iface.theme.menu.item_height * ITEM_SCALE * 1.5;
menu.c: if( config->iface.theme.menu.orientation == CONFIG_LANDSCAPE ) {
menu.c: arrow_retreat.x = tile_start->x - (config->iface.theme.menu.item_width * ITEM_SCALE);
menu.c: arrow_advance.x = tile_end->x + (config->iface.theme.menu.item_width * ITEM_SCALE);
menu.c: arrow_retreat.y = tile_start->y + (config->iface.theme.menu.item_height * ITEM_SCALE);
menu.c: arrow_advance.y = tile_end->y - (config->iface.theme.menu.item_height * ITEM_SCALE);
menu.c: mx = ((config->item_width * ITEM_SCALE)/2) * xfactor * item_zoom;
menu.c: my = ((config->item_height * ITEM_SCALE)/2) * xfactor * item_zoom;
menu.c: tx = ((GLfloat)tile->item->message->width * (config->font_scale * FONT_SCALE)) * xfactor * item_zoom;
menu.c: if( tx > mx * (1.0 - ((GLfloat)config->border/100)) )
menu.c: tx = mx * (1.0 - ((GLfloat)config->border/100));
menu.c: ty = ((GLfloat)tile->item->message->height * (config->font_scale * FONT_SCALE)) * xfactor * item_zoom;
menu.c: if( ty > my * (1.0 - ((GLfloat)config->border/100)) )
menu.c: ty = my * (1.0 - ((GLfloat)config->border/100));
ogl.c: if( config->iface.gfx_quality > CONFIG_LOW )
ogl.c: gluPerspective( 45.0, (GLfloat)config->iface.screen_width/(GLfloat)config->iface.screen_height, 0.1, 100.0 );
ogl.c: width = config->iface.screen_width;
ogl.c: height = config->iface.screen_height;
ogl.c: if( config->iface.screen_hflip )
ogl.c: if( config->iface.screen_vflip )
ogl.c: ogl_screen_rotate( config->iface.screen_rotation );
sdl_ogl.c: while( x > config->iface.gfx_max_width )
sdl_ogl.c: while( y > config->iface.gfx_max_height )
sdl_ogl.c: if( config->iface.gfx_quality != CONFIG_HIGH )
sdl_wrapper.c: if( config->iface.full_screen )
sdl_wrapper.c: screen = SDL_SetVideoMode( config->iface.screen_width, config->iface.screen_height, SDL_SCREEN_BPP, mode );
sdl_wrapper.c: frame_rate = config->iface.frame_rate;
snap.c: if( config->iface.frame_rate ) {
snap.c: noise_skip = config->iface.frame_rate / 10;
snap.c: steps = config->iface.frame_rate / 4;
snap.c: scale = config->iface.theme.snap.size * SCALE_FACTOR;
snap.c: platform_scale = config->iface.theme.snap.size * PLATFORM_SIZE;
snap.c: if( config->iface.theme.snap.offset1 > 0 )
snap.c: if( config->fix_aspect_ratio ) {
snap.c: hide_offset = (((hidden_offset - config->offset1) / (GLfloat)steps) * (GLfloat)step);
snap.c: glTranslatef( (hidden_offset - hide_offset) * xfactor, config->offset2 * yfactor, DEPTH );
snap.c: glTranslatef( config->offset2 * xfactor, (hidden_offset - hide_offset) * yfactor, DEPTH );
snap.c: glTranslatef( (config->offset1 + hide_offset) * xfactor, config->offset2 * yfactor, DEPTH );
snap.c: glTranslatef( config->offset2 * xfactor, (config->offset1 + hide_offset) * yfactor, DEPTH );
snap.c: glRotatef( config->angle_x, 1.0, 0.0, 0.0 );
snap.c: glRotatef( config->angle_y, 0.0, 1.0, 0.0 );
snap.c: glRotatef( config->angle_z, 0.0, 0.0, 1.0 );
snap.c: if( config->platform_icons && platform_count() > 1 && platform_texture ) {
snap.c: glRotatef( -config->angle_z, 0.0, 0.0, 1.0 );
submenu.c: item_width = config->item_width * ITEM_SCALE;
submenu.c: item_height = config->item_height * ITEM_SCALE;
submenu.c: font_scale = config->font_scale * FONT_SCALE;
submenu.c: arrow_retreat.y = (menu_tile_selected()->y + config->offset1 );
submenu.c: arrow_advance.y = (menu_tile_selected()->y + config->offset1 );
submenu.c: glTranslatef( (menu_tile_selected()->x + config->offset2 ) * xfactor, (menu_tile_selected()->y + config->offset1) * yfactor, -6 );
video.c: if(!config->iface.full_screen)
Empty file modified include/bg.h
100644 → 100755
Empty file.
Empty file modified include/category.h
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions include/config.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct config_labels {

struct config_iface {
int full_screen;
int video_loop;
int screen_width;
int screen_height;
int screen_rotation;
Expand Down
Empty file modified include/control.h
100644 → 100755
Empty file.
Empty file modified include/emulator.h
100644 → 100755
Empty file.
Empty file modified include/event.h
100644 → 100755
Empty file.
Empty file modified include/focus.h
100644 → 100755
Empty file.
Empty file modified include/font.h
100644 → 100755
Empty file.
Empty file modified include/frame.h
100644 → 100755
Empty file.
Empty file modified include/game.h
100644 → 100755
Empty file.
Empty file modified include/game_sel.h
100644 → 100755
Empty file.
Empty file modified include/hint.h
100644 → 100755
Empty file.
Empty file modified include/key.h
100644 → 100755
Empty file.
Empty file modified include/location.h
100644 → 100755
Empty file.
Empty file modified include/lookup.h
100644 → 100755
Empty file.
Empty file modified include/media.h
100644 → 100755
Empty file.
Empty file modified include/menu.h
100644 → 100755
Empty file.
Empty file modified include/ogl.h
100644 → 100755
Empty file.
Empty file modified include/packet.h
100644 → 100755
Empty file.
Empty file modified include/platform.h
100644 → 100755
Empty file.
Empty file modified include/sdl_ogl.h
100644 → 100755
Empty file.
Empty file modified include/sdl_wrapper.h
100644 → 100755
Empty file.
Empty file modified include/setup.h
100644 → 100755
Empty file.
Empty file modified include/snap.h
100644 → 100755
Empty file.
Empty file modified include/sound.h
100644 → 100755
Empty file.
Empty file modified include/submenu.h
100644 → 100755
Empty file.
Empty file modified include/video.h
100644 → 100755
Empty file.
Empty file modified key.c
100644 → 100755
Empty file.
Empty file modified location.c
100644 → 100755
Empty file.
Empty file modified lookup.c
100644 → 100755
Empty file.
Empty file modified main.c
100644 → 100755
Empty file.
Empty file modified media.c
100644 → 100755
Empty file.
Empty file modified menu.c
100644 → 100755
Empty file.
Empty file modified ogl.c
100644 → 100755
Empty file.
Empty file modified packet.c
100644 → 100755
Empty file.
Empty file modified platform.c
100644 → 100755
Empty file.
Empty file modified sdl_ogl.c
100644 → 100755
Empty file.
Empty file modified sdl_wrapper.c
100644 → 100755
Empty file.
Empty file modified setup.c
100644 → 100755
Empty file.
Empty file modified snap.c
100644 → 100755
Empty file.
Empty file modified sound.c
100644 → 100755
Empty file.
Empty file modified submenu.c
100644 → 100755
Empty file.
9 changes: 7 additions & 2 deletions video.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ void video_release_buffer( struct AVCodecContext *c, AVFrame *f ) {
int video_reader_thread( void *data ) {
static AVPacket packet;

const struct config *config = config_get();

if( !format_context || !video_codec_context || !video_buffer )
return -1;

Expand All @@ -280,10 +282,13 @@ int video_reader_thread( void *data ) {
if (( value != video_stream ) && (value != audio_stream && audio_codec_context))
av_free_packet( &packet );
} else {
// stop video loop
if(!config->iface.video_loop)
stop = 1;
av_seek_frame( format_context, -1, 0, 0 );
// TODO headhache fuze - second loop -
// TODO find a way to just stop sound - headhache fuze - second loop -
stop_sound = 1;
fprintf(stderr, "stop_sound %d\n", stop_sound );
// debug fprintf(stderr, "stop_sound %d\n", stop_sound );
}
}
}
Expand Down
Empty file modified video2.c
100644 → 100755
Empty file.

0 comments on commit fab280b

Please sign in to comment.