menus_action_group->add( Gtk::Action::create("menu-layer", _("_Layer")) );
menus_action_group->add( Gtk::Action::create("menu-duck-mask", _("Show/Hide Ducks")) );
menus_action_group->add( Gtk::Action::create("menu-preview-quality", _("Preview Quality")) );
+ menus_action_group->add( Gtk::Action::create("menu-lowres-pixel", _("Low-Res Pixel Size")) );
menus_action_group->add( Gtk::Action::create("menu-layer-new", _("New Layer")) );
menus_action_group->add( Gtk::Action::create("menu-keyframe", _("Keyframe")) );
menus_action_group->add( Gtk::Action::create("menu-group", _("Group")) );
DEFINE_ACTION("quality-08", _("Use Quality Level 8"));
DEFINE_ACTION("quality-09", _("Use Quality Level 9"));
DEFINE_ACTION("quality-10", _("Use Quality Level 10"));
+ DEFINE_ACTION("lowres-pixel-01", _("Set Low-Res pixel size to 2^1"));
+ DEFINE_ACTION("lowres-pixel-02", _("Set Low-Res pixel size to 2^2"));
+ DEFINE_ACTION("lowres-pixel-03", _("Set Low-Res pixel size to 2^3"));
+ DEFINE_ACTION("lowres-pixel-04", _("Set Low-Res pixel size to 2^4"));
+ DEFINE_ACTION("lowres-pixel-05", _("Set Low-Res pixel size to 2^5"));
+ DEFINE_ACTION("lowres-pixel-06", _("Set Low-Res pixel size to 2^6"));
DEFINE_ACTION("play", _("Play"));
// DEFINE_ACTION("pause", _("Pause"));
DEFINE_ACTION("stop", _("Stop"));
" <menuitem action='quality-09' />"
" <menuitem action='quality-10' />"
" </menu>"
+" <menu action='menu-lowres-pixel'>"
+" <menuitem action='lowres-pixel-01' />"
+" <menuitem action='lowres-pixel-02' />"
+" <menuitem action='lowres-pixel-03' />"
+" <menuitem action='lowres-pixel-04' />"
+" <menuitem action='lowres-pixel-05' />"
+" <menuitem action='lowres-pixel-06' />"
+" </menu>"
" <separator name='bleh08'/>"
" <menuitem action='play'/>"
//" <menuitem action='pause'/>"
}
}
+ // Low-Res Quality Menu
+ {
+ int i;
+ for(i=1;i<=6;i++)
+ {
+ Glib::RefPtr<Gtk::RadioAction> action(Gtk::RadioAction::create(quality_group,strprintf("lowres-pixel-%02d",i),
+ strprintf(_("Set Low-Res pixel size to 2^%d"),i)));
+ if(i==1) // default quality
+ {
+ action->set_active();
+ work_area->set_lowrespixel(i);
+ }
+ action_group->add( action,
+ sigc::bind(
+ sigc::mem_fun(*work_area, &studio::WorkArea::set_lowrespixel),
+ i
+ )
+ );
+ }
+ }
+
+
action_group->add( Gtk::Action::create("play", Gtk::Stock::MEDIA_PLAY),
sigc::mem_fun(*this, &studio::CanvasView::play)
);
Glib::RefPtr<Gtk::ToggleAction> duck_mask_angle;
Gtk::RadioButtonGroup quality_group;
+ Gtk::RadioButtonGroup lowrespixel_group;
Glib::RefPtr<Gtk::ActionGroup> action_group;
}
else
{
- const int width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/2)%(tile_w/2)):(w%tile_w))?1:0));
+
+ int div = 1 << get_work_area()->get_lowrespixel();
+ const int width_in_tiles(w/tile_w+(((get_work_area()->get_low_resolution_flag())?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
const int height_in_tiles(h/tile_h+(h%tile_h?1:0));
int u(0),v(0),tx,ty;
set_clipping(true);
if(low_res)
{
- set_tile_w(workarea->tile_w/2);
- set_tile_h(workarea->tile_h/2);
+
+ int div = 1 << workarea->get_lowrespixel();
+ set_tile_w(workarea->tile_w/div);
+ set_tile_h(workarea->tile_h/div);
}
else
{
{
assert(workarea);
newdesc->set_flags(RendDesc::PX_ASPECT|RendDesc::IM_SPAN);
- if(low_res)
- newdesc->set_wh(w/2,h/2);
+ if(low_res) {
+ int div = 1 << workarea->get_lowrespixel();
+ newdesc->set_wh(w/div,h/div);
+ }
else
newdesc->set_wh(w,h);
if(low_res)
{
// We need to scale up
+
+ int div = 1 << workarea->get_lowrespixel();
pixbuf=pixbuf->scale_simple(
- surface.get_w()*2,
- surface.get_h()*2,
+ surface.get_w()*div,
+ surface.get_h()*div,
Gdk::INTERP_NEAREST
);
}
render_idle_func_id=0;
zoom=prev_zoom=1.0;
quality=10;
+ lowrespixel=1;
rendering=false;
canceled_=false;
low_resolution=true;
x(focus_point[0]/pw+drawing_area->get_width()/2-w/2),
y(focus_point[1]/ph+drawing_area->get_height()/2-h/2);
- const int width_in_tiles(w/tile_w+((low_resolution?((w/2)%(tile_w/2)):(w%tile_w))?1:0));
+
+ int div = 1 << lowrespixel;
+ const int width_in_tiles(w/tile_w+((low_resolution?((w/div)%(tile_w/div)):(w%tile_w))?1:0));
const int height_in_tiles(h/tile_h+(h%tile_h?1:0));
int
queue_render_preview();
}
+void
+WorkArea::set_lowrespixel(int x)
+{
+ if(x==lowrespixel)
+ return;
+ lowrespixel=x;
+ queue_render_preview();
+}
+
+
+
namespace studio
{
handle<Target> target;
// if we have lots of pixels to render and the tile renderer isn't disabled, use it
- if(w*h>(low_resolution?480*270:480*270/2) &&
+ int div = 1 << lowrespixel;
+ if(w*h>(low_resolution?480*270:480*270/div) &&
!getenv("SYNFIG_DISABLE_TILE_RENDER"))
{
// do a tile render
bool canceled_;
int quality;
+ int lowrespixel;
bool dirty_trap_enabled;
void popup_menu();
int get_quality()const { return quality; }
+ int get_lowrespixel()const { return lowrespixel; }
void set_quality(int x);
+ void set_lowrespixel(int x);
int get_w()const { return w; }