void mode(SCREEN_Screen* scr, int x) { switch (x) { case 0: exit_attribute_mode(scr); break; case 1: enter_bold_mode(scr); break; case 7: enter_reverse_mode(scr); break; case 10: break; case 22: exit_bold_mode(scr); break; case 30: set_foreground(scr, SCREEN_COLOR_BLACK); break; case 31: set_foreground(scr, SCREEN_COLOR_RED); break; case 32: set_foreground(scr, SCREEN_COLOR_GREEN); break; case 33: set_foreground(scr, SCREEN_COLOR_YELLOW); break; case 34: set_foreground(scr, SCREEN_COLOR_BLUE); break; case 35: set_foreground(scr, SCREEN_COLOR_MAGENTA); break; case 36: set_foreground(scr, SCREEN_COLOR_CYAN); break; case 37: set_foreground(scr, SCREEN_COLOR_WHITE); break; case 39: set_foreground(scr, SCREEN_COLOR_WHITE); break; case 40: set_background(scr, SCREEN_COLOR_BLACK); break; case 41: set_background(scr, SCREEN_COLOR_RED); break; case 42: set_background(scr, SCREEN_COLOR_GREEN); break; case 43: set_background(scr, SCREEN_COLOR_YELLOW); break; case 44: set_background(scr, SCREEN_COLOR_BLUE); break; case 45: set_background(scr, SCREEN_COLOR_MAGENTA); break; case 46: set_background(scr, SCREEN_COLOR_CYAN); break; case 47: set_background(scr, SCREEN_COLOR_WHITE); break; case 49: set_background(scr, SCREEN_COLOR_BLACK); break; default: fprintf(stderr, "uknown mode parameter: %i\n", x); break; } }
static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr, gpointer user_data) { cr = gdk_cairo_create(gtk_widget_get_window(widget)); int width, height; gtk_window_get_size(GTK_WINDOW(widget), &width, &height); int separation = width/10; // Set background color set_background(cr, width, height); // Set font cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, 24.0); // draw circles int n = 9; n_circles(cr, n, separation); // text //cairo_text_extents_t te; //const char *utf8 = "cairo"; //set_color_black(cr); //cairo_text_extents (cr, utf8, &te); //cairo_move_to (cr, 0, 0); //cairo_show_text (cr, "CAIRO"); // Done cairo_destroy(cr); return FALSE; }
void LogoScene::setupLogo() { Qneed* background = new Qneed(this, get_window()); background->loadImage(":images/logo/logo_background.png"); set_background(background); logo = new Qneed(this, get_window()); logo->loadImage(":images/logo/logo.png"); logo->setPos(307, 240); OnemoreButton* one = new OnemoreButton(this,get_window()); one->setPos(400, 553); one->hide(); QGraphicsOpacityEffect* opacityEffect = new QGraphicsOpacityEffect(); opacityEffect->setOpacity(0.0); logo->setGraphicsEffect(opacityEffect); QPropertyAnimation * animation = new QPropertyAnimation(); animation->setTargetObject(opacityEffect); animation->setPropertyName("opacity"); animation->setDuration(2000); animation->setStartValue(0.0); animation->setEndValue(1.0); animation->setEasingCurve(QEasingCurve::OutQuad); connect(animation, SIGNAL(finished()), this, SLOT(goinit())); animation->start(); }
void Screen::init_control (Control* par) { set_background (C_SCREEN_BACKGROUND); set_foreground (C_FOREGROUND); set_font_color (C_FOREGROUND); set_frame (0); reinitialize (); }
EditableMap::EditableMap(Resources& resources, Subsystem& subsystem) throw (Exception) : Map(subsystem), resources(resources), subsystem(subsystem) { set_background(get_background()); set_tileset(get_tileset()); untouch(); }
static void reset_test_colors(void) { /* Now, set the background again just in case there's a glitch */ set_foreground(COLOR_WHITE); set_background(COLOR_BLACK); }
int BEE::Room::add_background(int index, Background* new_background, bool new_is_visible, bool new_is_foreground, int new_x, int new_y, bool new_is_horizontal_tile, bool new_is_vertical_tile, int new_horizontal_speed, int new_vertical_speed, bool new_is_stretched) { BackgroundData* background = new BackgroundData(new_background, new_is_visible, new_is_foreground, new_x, new_y, new_is_horizontal_tile, new_is_vertical_tile, new_horizontal_speed, new_vertical_speed, new_is_stretched); if (index < 0) { index = backgrounds.size(); } return set_background(index, background); }
static void gtk_source_mark_attributes_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { GtkSourceMarkAttributes *self = GTK_SOURCE_MARK_ATTRIBUTES (object); switch (prop_id) { case PROP_BACKGROUND: set_background (self, g_value_get_boxed (value)); break; case PROP_STOCK_ID: set_stock_id (self, g_value_get_string (value)); break; case PROP_PIXBUF: set_pixbuf (self, g_value_get_object (value)); break; case PROP_ICON_NAME: set_icon_name (self, g_value_get_string (value)); break; case PROP_GICON: set_gicon (self, g_value_get_object (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } }
void ChoiceScene::setupChoice() { Qneed* background = new Qneed(this, get_window()); background->loadImage(":images/choice/choice_background.png"); set_background(background); go_button = new GoButton(this, get_window()); go_button->setPos(365,200); player_button[0] = new PlayerButton(this, get_window(), 0); player_button[0]->setPos(50, 100); player_button[1] = new PlayerButton(this, get_window(), 1); player_button[1]->setPos(50, 250); player_button[2] = new PlayerButton(this, get_window(), 2); player_button[2] ->setPos(50, 400); player_button[3] = new PlayerButton(this, get_window(), 3); player_button[3]->setPos(784, 100); player_button[4] = new PlayerButton(this, get_window(), 4); player_button[4]->setPos(784, 250); player_button[5] = new PlayerButton(this, get_window(), 5); player_button[5]->setPos(784, 400); map_button[0] = new MapButton(this, get_window(), 0); map_button[0] ->setPos(215, 550); map_button[1] = new MapButton(this, get_window(), 1); map_button[1] ->setPos(415, 550); map_button[2] = new MapButton(this, get_window(), 2); map_button[2] ->setPos(615, 550); }
t_bunny_response main_loop(t_data *pic) { if (pic->wolf->left == 1) left(pic); if (pic->wolf->up == 1) if (up(pic) == 1) return (0); if (pic->wolf->down == 1) if (down(pic) == 1) return (0); if (pic->wolf->right == 1) right(pic); if (pic->wolf->player.health < 0) { my_putstr("Game Over\n"); return (0); } bunny_set_key_response(get_mykey); set_background(pic->pix, &pic->color[0]); raycasting(pic->wolf, pic->pix); health(pic->wolf, pic->pix); bunny_blit(&pic->win->buffer, &pic->pix->clipable, NULL); bunny_display(pic->win); return (GO_ON); }
virtual void execute(cmd_context& ctx) { if (m_target == 0) { throw cmd_exception("invalid query command, argument expected"); } datalog::context& dlctx = m_dl_ctx->get_dl_context(); set_background(ctx); dlctx.updt_params(m_params); unsigned timeout = m_params.get_uint(":timeout", UINT_MAX); cancel_eh<datalog::context> eh(dlctx); lbool status = l_undef; { scoped_ctrl_c ctrlc(eh); scoped_timer timer(timeout, &eh); cmd_context::scoped_watch sw(ctx); try { status = dlctx.query(m_target); } catch (z3_error & ex) { throw ex; } catch (z3_exception& ex) { ctx.regular_stream() << "(error \"query failed: " << ex.msg() << "\")" << std::endl; } dlctx.cleanup(); } switch (status) { case l_false: ctx.regular_stream() << "unsat\n"; print_certificate(ctx); break; case l_true: ctx.regular_stream() << "sat\n"; print_answer(ctx); print_certificate(ctx); break; case l_undef: ctx.regular_stream() << "unknown\n"; switch(dlctx.get_status()) { case datalog::INPUT_ERROR: break; case datalog::MEMOUT: ctx.regular_stream() << "memory bounds exceeded\n"; break; case datalog::TIMEOUT: ctx.regular_stream() << "timeout\n"; break; case datalog::OK: break; default: UNREACHABLE(); } break; } print_statistics(ctx); m_target = 0; }
/** * gtk_source_mark_attributes_set_background: * @attributes: a #GtkSourceMarkAttributes. * @background: a #GdkRGBA. * * Sets background color to the one given in @background. */ void gtk_source_mark_attributes_set_background (GtkSourceMarkAttributes *attributes, const GdkRGBA *background) { g_return_if_fail (GTK_SOURCE_IS_MARK_ATTRIBUTES (attributes)); set_background (attributes, background); }
/* **************************************************************** * Desenha o fundo da janela * **************************************************************** */ int draw_window (Display *dpy, Window win, XImage *ximage, IMAGE *ip) { char title[256]; static int old_width, old_height; /* * Pequena consistência. */ if (ximage->depth != DefaultDepth (dpy, screen)) { msg ( "\"%s\": imagem tem profundidade incorreta (%d :: %d)", ip->i_name, ximage->depth, DefaultDepth (dpy, screen) ); return (-1); } /* * Modifica o fundo, o tamanho e o título da janela. */ XSetWindowBackgroundPixmap (dpy, win, None); if (old_width == ximage->width && old_height == ximage->height) XResizeWindow (dpy, win, ximage->width - 1, ximage->height - 1); if (set_background (dpy, win, ximage, ip->i_name) < 0) return (-1); XResizeWindow (dpy, win, old_width = ximage->width, old_height = ximage->height); if (ip->i_comment == NOSTR) { snprintf ( title, sizeof (title), ip->i_ncolors > 0 ? "%s (%d x %d, %d cores)" : "%s (%d x %d)", basename (ip->i_name), ximage->width, ximage->height, ip->i_ncolors ); } else { snprintf ( title, sizeof (title), ip->i_ncolors > 0 ? "%s (%d x %d, %d cores), %s" : "%s (%d x %d)", basename (ip->i_name), ximage->width, ximage->height, ip->i_ncolors, ip->i_comment ); } XStoreName (dpy, win, title); XFlush (dpy); return (0); } /* end draw_window */
int show_message_file(const char *filename, const char *background) { int rv = KEY_NONE; const char *old_background = NULL; if (background) { old_background = current_background; set_background(background); } if ( !(rv = draw_message_file(filename)) ) rv = mygetkey(0); /* Wait for keypress */ if (old_background) set_background(old_background); return rv; }
bool window::create() { if(hwnd) return true; int width = xlib::width(place); int height = xlib::height(place); hwnd = XCreateSimpleWindow ( env, RootWindow((Display*)env,0), left(place), top(place), width, height, 0, WhitePixel((Display*)env,0), WhitePixel((Display*)env,0)); if(atomDelete != None) atomDelete = XInternAtom ( env, "WM_DELETE_WINDOW", false ); if ( !is_root() ) { // keeps this window in front of its parent at all times XSetTransientForHint ( env, hwnd, hwnd_parent ); // make sure the app doesn't get killed when this // window gets destroyed XSetWMProtocols ( env, hwnd, &atomDelete, 1 ); } if ( hwnd == 0 ) return false; gc = XCreateGC(env, hwnd, 0, 0); //rbuf_data = new unsigned char[ width * height * (env.bpp / 8)]; //rbuf.attach(rbuf_data, width, height, width * (env.bpp / 8) ); /* buffer = new image(width, height); ximg = XCreateImage(env, env.visual, env.depth, ZPixmap, 0, (char*)buffer->pmap.buf(), width, height, env.sys_bpp, width * (env.sys_bpp / 8)); ximg->byte_order = env.byte_order; */ set_background ( back_color ); created(); return true; }
std::unique_ptr<label_type> create_copyright_label() { auto p_label = tetengo2::stdalt::make_unique<label_type>(m_base); p_label->set_text(string_type{ TETENGO2_TEXT("Copyright (C) 2007-2015 kaoru") }); auto p_background = tetengo2::stdalt::make_unique<transparent_background_type>(); p_label->set_background(std::move(p_background)); return std::move(p_label); }
/* * VT220 and higher implement the 22, 24, 25 and 27 codes. * VT510 implements concealed text. * * ISO 6429 specifies additional SGR codes so that one needn't use SGR 0 * to reset everything before switching, e.g., set/clear pairs are * bold 1/22 * faint 2/22 * italics 3/23 * underline 4/24 * blink 5/25 * inverse 7/27 * concealed 8/28 */ static int test_iso_6429_sgr(MENU_ARGS) { set_test_colors(); ed(2); /* *INDENT-OFF* */ cup( 1,20); printf("Extended/Graphic rendition test pattern:"); cup( 4, 1); c_sgr("0"); printf("vanilla"); cup( 4,40); c_sgr("0;1"); printf("bold"); cup( 6, 6); c_sgr("22;4"); printf("underline"); cup( 6,45); c_sgr("24;1;4"); printf("bold underline"); cup( 8, 1); c_sgr("22;24;5"); printf("blink"); cup( 8,40); c_sgr("25;5;1"); printf("bold blink"); cup(10, 6); c_sgr("22;4;5"); printf("underline blink"); cup(10,45); c_sgr("24;25;1;4;5"); printf("bold underline blink"); cup(12, 1); c_sgr("22;24;25;7"); printf("negative"); cup(12,40); c_sgr("1"); printf("bold negative"); cup(14, 6); c_sgr("22;4;7"); printf("underline negative"); cup(14,45); c_sgr("1;4;7"); printf("bold underline negative"); cup(16, 1); c_sgr("22;24;5;7"); printf("blink negative"); cup(16,40); c_sgr("1"); printf("bold blink negative"); cup(18, 6); c_sgr("22;4"); printf("underline blink negative"); cup(18,45); c_sgr("1"); printf("bold underline blink negative"); cup(20, 6); c_sgr(""); set_foreground(9); printf("original foreground"); cup(20,45); c_sgr(""); set_background(9); printf("original background"); cup(22, 1); c_sgr(";8"); printf("concealed"); cup(22,40); c_sgr("8;7"); printf("concealed negative"); /* *INDENT-ON* */ c_sgr(""); /* same as c_sgr("0") */ printf(" <- concealed text"); decscnm(FALSE); /* Inverse video off */ cup(max_lines - 1, 1); el(0); printf("Dark background. "); holdit(); decscnm(TRUE); /* Inverse video */ cup(max_lines - 1, 1); el(0); printf("Light background. "); holdit(); decscnm(FALSE); cup(max_lines - 1, 1); el(0); printf("Dark background. "); holdit(); reset_colors(); return MENU_NOHOLD; }
SingleSplitView::SingleSplitView(View* leading, View* trailing, Orientation orientation) : is_horizontal_(orientation==HORIZONTAL_SPLIT), divider_offset_(-1), resize_leading_on_bounds_change_(true) { AddChildView(leading); AddChildView(trailing); set_background(Background::CreateSolidBackground( gfx::Color(GetSysColor(COLOR_3DFACE)))); }
/** * Configures some properties of the specified layer to make it as the * "Background" of the sprite. * * You can't use this routine if the sprite already has a background * layer. */ void LayerImage::configureAsBackground() { ASSERT(getSprite() != NULL); ASSERT(getSprite()->getBackgroundLayer() == NULL); set_moveable(false); set_background(true); setName("Background"); getSprite()->getFolder()->stackLayer(this, NULL); }
JNIEXPORT jboolean JNICALL Java_com_yegorov_alexey_elements_api_ElementsStrange_background(JNIEnv *, jobject, jint id, jfloat r, jfloat g, jfloat b) { auto renderer = factory_.get(id); if(renderer != nullptr) { renderer->set_background(eps::math::vec3(r, g, b)); return true; } LOGE("[API][Strange] set a background failed: renderer is null (%d)", id); return false; }
void graphics_init(){ screen_wid=*((uint16_t *)(VBE_base_address+0x12)); screen_hei=*((uint16_t *)(VBE_base_address+0x14)); graphics_vram = (uint8_t *)(*((uint32_t *)(0x900))); graphics_background_color.R = 0x00; graphics_background_color.G = 0x00; graphics_background_color.B = 0x00; set_background(graphics_background_color); graphics_cursor_color.R = 0xFF; graphics_cursor_color.G = 0xFF; graphics_cursor_color.B = 0xFF; graphics_default_text_color = graphics_cursor_color; current_screen = 0; }
int read_config_file(char *config_filename) { FILE *fd; char *p; char textline[LINEBUFFER]; int ret; if ((fd = fopen(config_filename, "r")) == NULL) return 1; while (fgets(textline, LINEBUFFER - 1, fd) != NULL) { /* We ignore blank lines and comments */ if (textline[0] == '\n' || textline[0] == '#') continue; p = strtok(textline, " \t\n"); if (strncasecmp("server", p, 4) == 0) { int ret; p = strtok(NULL, " \t\n"); ret = set_server(p); if (ret) { /* error */ fflush(stderr); fflush(stdout); fprintf(stderr, "Server IP unknown.\n"); exit(1); } } else if (strncasecmp("logfile", p, 7) == 0) { p = strtok(NULL, " \t\n"); open_log(p); } else if (strncasecmp("background", p, 10) == 0) { p = strtok(NULL, " \t\n"); set_background(p); } else if (strncasecmp("logo", p, 4) == 0) { p = strtok(NULL, " \t\n"); set_logo(p); } else if (strncasecmp("foreground", p, 10) == 0) { p = strtok(NULL, " \t\n"); set_foreground(p); } else if (strncasecmp("port", p, 4) == 0) { p = strtok(NULL, " \t\n"); set_listen_port(p); } } ret = fclose(fd); return ret; }
virtual void create() { if ( ! m_window ) { m_window = XCreateSimpleWindow ( m_display, RootWindow((void*)m_display,0), m_rect.origin().x(), m_rect.origin().y(), m_rect.width(), m_rect.height(), 0, WhitePixel((void*)m_display,0), WhitePixel((void*)m_display,0)); set_background ( m_background ); if ( m_is_child ) { // keeps this window in front of its parent at all times XSetTransientForHint ( m_display, id(), m_parent ); // make sure the app doesn't get killed when this // window gets destroyed m_atom[0] = XInternAtom ( m_display, "WM_DELETE_WINDOW", false ); XSetWMProtocols ( m_display, m_window, m_atom, 1 ); } if ( m_window == 0 ) { } on_create(); } m_event_dispatcher.register_window ( this ); }
int main(void) { t_fire *fire; if ((fire = bunny_malloc(sizeof(t_fire))) == NULL) return (1); fire->win = bunny_start(WIDTH, HEIGHT, false, "Effet de flamme uberti_l"); fire->pix = bunny_new_pixelarray(WIDTH, HEIGHT); set_gradient(fire); set_background(fire->pix, 0x00000000); fixed_col(fire); bunny_set_loop_main_function(main_loop); bunny_loop(fire->win, 60, fire); free_all(fire); return (0); }
void ui_display_tape_control_status(int control) { GdkColor *color; int status = 0; #if !defined(HAVE_CAIRO) GdkGC *app_gc = get_toplevel(); #endif DBG(("ui_display_tape_control_status (%d) motor:%d image:%d\n", control, tape_motor_status, tape_image_status)); if (control < 0) { control = tape_control_status; } else { tape_control_status = control; } #if !defined(HAVE_CAIRO) if (app_gc == NULL) { DBG(("ui_display_tape_control_status skipped\n")); return; } #endif /* Set background color */ color = (tape_image_status == 1) ? &drive_led_on_green_pixel : &drive_led_on_red_pixel; set_background(color); /* set foreground color for tape-button */ color = (tape_motor_status == 1) ? &motor_running_pixel : &tape_control_pixel; switch (control) { case DATASETTE_CONTROL_START: status = 1; break; case DATASETTE_CONTROL_FORWARD: status = 2; break; case DATASETTE_CONTROL_REWIND: status = 3; break; case DATASETTE_CONTROL_RECORD: status = 4; break; } set_foreground(color, status); gdk_flush(); }
std::unique_ptr<label_type> create_title_label() { using char_type = typename string_type::value_type; std::basic_ostringstream<char_type> title{}; title << boost::basic_format<char_type>(TETENGO2_TEXT("%s %s %s")) % m_message_catalog.get(TETENGO2_TEXT("App:Bobura")) % m_message_catalog.get(TETENGO2_TEXT("Dialog:About:version")) % string_type{ TETENGO2_TEXT("0.0.0") }; auto p_label = tetengo2::stdalt::make_unique<label_type>(m_base); p_label->set_text(title.str()); auto p_background = tetengo2::stdalt::make_unique<transparent_background_type>(); p_label->set_background(std::move(p_background)); return std::move(p_label); }
static void on_chooser_dialog_response (GtkDialog *dialog, int response_id, CcBackgroundPanel *self) { if (response_id == GTK_RESPONSE_OK) { CcBackgroundItem *item; item = cc_background_chooser_dialog_get_item (CC_BACKGROUND_CHOOSER_DIALOG (dialog)); if (item != NULL) { set_background (self, g_object_get_data (G_OBJECT (dialog), "settings"), item); g_object_unref (item); } } gtk_widget_destroy (GTK_WIDGET (dialog)); }
Environment::Environment() { environment = VS::get_singleton()->environment_create(); set_background(BG_DEFAULT_COLOR); set_background_param(BG_PARAM_COLOR,Color(0,0,0)); set_background_param(BG_PARAM_TEXTURE,Ref<ImageTexture>()); set_background_param(BG_PARAM_CUBEMAP,Ref<CubeMap>()); set_background_param(BG_PARAM_ENERGY,1.0); set_background_param(BG_PARAM_SCALE,1.0); set_background_param(BG_PARAM_GLOW,0.0); for(int i=0;i<FX_MAX;i++) set_enable_fx(Fx(i),false); fx_set_param(FX_PARAM_AMBIENT_LIGHT_COLOR,Color(0,0,0)); fx_set_param(FX_PARAM_AMBIENT_LIGHT_ENERGY,1.0); fx_set_param(FX_PARAM_GLOW_BLUR_PASSES,1); fx_set_param(FX_PARAM_GLOW_BLUR_SCALE,1); fx_set_param(FX_PARAM_GLOW_BLUR_STRENGTH,1); fx_set_param(FX_PARAM_GLOW_BLOOM,0.0); fx_set_param(FX_PARAM_GLOW_BLOOM_TRESHOLD,0.5); fx_set_param(FX_PARAM_DOF_BLUR_PASSES,1); fx_set_param(FX_PARAM_DOF_BLUR_BEGIN,100.0); fx_set_param(FX_PARAM_DOF_BLUR_RANGE,10.0); fx_set_param(FX_PARAM_HDR_TONEMAPPER,FX_HDR_TONE_MAPPER_LINEAR); fx_set_param(FX_PARAM_HDR_EXPOSURE,0.4); fx_set_param(FX_PARAM_HDR_WHITE,1.0); fx_set_param(FX_PARAM_HDR_GLOW_TRESHOLD,0.95); fx_set_param(FX_PARAM_HDR_GLOW_SCALE,0.2); fx_set_param(FX_PARAM_HDR_MIN_LUMINANCE,0.4); fx_set_param(FX_PARAM_HDR_MAX_LUMINANCE,8.0); fx_set_param(FX_PARAM_HDR_EXPOSURE_ADJUST_SPEED,0.5); fx_set_param(FX_PARAM_FOG_BEGIN,100.0); fx_set_param(FX_PARAM_FOG_ATTENUATION,1.0); fx_set_param(FX_PARAM_FOG_BEGIN_COLOR,Color(0,0,0)); fx_set_param(FX_PARAM_FOG_END_COLOR,Color(0,0,0)); fx_set_param(FX_PARAM_FOG_BG,true); fx_set_param(FX_PARAM_BCS_BRIGHTNESS,1.0); fx_set_param(FX_PARAM_BCS_CONTRAST,1.0); fx_set_param(FX_PARAM_BCS_SATURATION,1.0); }
EditableMap::EditableMap(Resources& resources, Subsystem& subsystem, const std::string& filename) throw (Exception) : Map(subsystem, filename), resources(resources), subsystem(subsystem) { char buffer[256]; set_background(get_background()); set_tileset(get_tileset()); untouch(); /* grab objects */ int num_objects = atoi(get_value("objects").c_str()); for (int i = 0; i < num_objects; i++) { sprintf(buffer, "object_name%d", i); const std::string& object_name = get_value(buffer); sprintf(buffer, "object_x%d", i); int x = atoi(get_value(buffer).c_str()); sprintf(buffer, "object_y%d", i); int y = atoi(get_value(buffer).c_str()); try { Object *obj = resources.get_object(object_name); EditableObject *eobj = new EditableObject(obj, x, y); objects.push_back(eobj); } catch (const Exception& e) { subsystem << "WARNING: " << e.what() << std::endl; } } /* grab light sources */ int num_lights = atoi(get_value("lights").c_str()); for (int i = 0; i < num_lights; i++) { sprintf(buffer, "light_x%d", i); int x = atoi(get_value(buffer).c_str()); sprintf(buffer, "light_y%d", i); int y = atoi(get_value(buffer).c_str()); sprintf(buffer, "light_radius%d", i); int radius = atoi(get_value(buffer).c_str()); lights.push_back(new EditableLight(x, y, radius)); } create_lightmap(); }
/* Graphic rendition requires special handling with color, since SGR-0 * is supposed to reset the colors as well. */ static void show_graphic_rendition(void) { ed(2); /* *INDENT-OFF* */ cup( 1,20); printf("Color/Graphic rendition test pattern:"); cup( 4, 1); c_sgr("0"); printf("vanilla"); cup( 4,40); c_sgr("0;1"); printf("bold"); cup( 6, 6); c_sgr(";4"); printf("underline"); cup( 6,45); c_sgr(";1");c_sgr("4");printf("bold underline"); cup( 8, 1); c_sgr("0;5"); printf("blink"); cup( 8,40); c_sgr("0;5;1"); printf("bold blink"); cup(10, 6); c_sgr("0;4;5"); printf("underline blink"); cup(10,45); c_sgr("0;1;4;5"); printf("bold underline blink"); cup(12, 1); c_sgr("1;4;5;0;7"); printf("negative"); cup(12,40); c_sgr("0;1;7"); printf("bold negative"); cup(14, 6); c_sgr("0;4;7"); printf("underline negative"); cup(14,45); c_sgr("0;1;4;7"); printf("bold underline negative"); cup(16, 1); c_sgr("1;4;;5;7"); printf("blink negative"); cup(16,40); c_sgr("0;1;5;7"); printf("bold blink negative"); cup(18, 6); c_sgr("0;4;5;7"); printf("underline blink negative"); cup(18,45); c_sgr("0;1;4;5;7"); printf("bold underline blink negative"); cup(20, 6); c_sgr(""); set_foreground(9); printf("original foreground"); cup(20,45); c_sgr(""); set_background(9); printf("original background"); /* *INDENT-ON* */ c_sgr(""); /* same as c_sgr("0") */ decscnm(FALSE); /* Inverse video off */ cup(max_lines - 1, 1); el(0); printf("Dark background. "); holdit(); decscnm(TRUE); /* Inverse video */ cup(max_lines - 1, 1); el(0); printf("Light background. "); holdit(); decscnm(FALSE); }