//Coordinates are untransformed coordinates (ie, current Sprite local) void ShaderEngine::pushClip(float x,float y,float w,float h) { Vector4 v1(x,y,0,1); Vector4 v2(x+w,y+h,0,1); Vector4 v3(x+w,y,0,1); Vector4 v4(x,y+h,0,1); Matrix4 xform=oglVPProjection*oglModel; v1=xform*v1; v2=xform*v2; v3=xform*v3; v4=xform*v4; x=(std::min)((std::min)(v1.x,v2.x),(std::min)(v3.x,v4.x)); y=(std::min)((std::min)(v1.y,v2.y),(std::min)(v3.y,v4.y)); float x2=(std::max)((std::max)(v1.x,v2.x),(std::max)(v3.x,v4.x)); float y2=(std::max)((std::max)(v1.y,v2.y),(std::max)(v3.y,v4.y)); w=x2-x; h=y2-y; if (scissorStack.empty()) { Scissor s(x,y,w,h); scissorStack.push(s); setClip(s.x,s.y,s.w,s.h); } else { Scissor s(scissorStack.top(),x,y,w,h); scissorStack.push(s); setClip(s.x,s.y,s.w,s.h); } }
void ShaderEngine::popClip() { if (scissorStack.empty()) return; //Probably a code issue scissorStack.pop(); if (scissorStack.empty()) { setClip(-1,-1,-1,-1); } else { Scissor s=scissorStack.top(); setClip(s.x,s.y,s.w,s.h); } }
bool Snapshot::clipTransformed(const Rect& r, SkRegion::Op op) { bool clipped = false; switch (op) { case SkRegion::kIntersect_Op: { if (CC_UNLIKELY(!clipRegion->isEmpty())) { ensureClipRegion(); clipped = clipRegionOp(r.left, r.top, r.right, r.bottom, SkRegion::kIntersect_Op); } else { clipped = clipRect->intersect(r); if (!clipped) { clipRect->setEmpty(); clipped = true; } } break; } case SkRegion::kReplace_Op: { setClip(r.left, r.top, r.right, r.bottom); clipped = true; break; } default: { ensureClipRegion(); clipped = clipRegionOp(r.left, r.top, r.right, r.bottom, op); break; } } if (clipped) { flags |= Snapshot::kFlagClipSet; } return clipped; }
cv::viz::Camera::Camera(const Matx44f &proj, const Size &window_size) { CV_Assert(window_size.width > 0 && window_size.height > 0); double near = proj(2,3) / (proj(2,2) - 1.0); double far = near * (proj(2,2) - 1.0) / (proj(2,2) + 1.0); double left = near * (proj(0,2)-1) / proj(0,0); double right = 2.0 * near / proj(0,0) + left; double bottom = near * (proj(1,2)-1) / proj(1,1); double top = 2.0 * near / proj(1,1) + bottom; double epsilon = 2.2204460492503131e-16; if (fabs(left-right) < epsilon) principal_point_[0] = static_cast<float>(window_size.width) * 0.5f; else principal_point_[0] = (left * static_cast<float>(window_size.width)) / (left - right); focal_[0] = -near * principal_point_[0] / left; if (fabs(top-bottom) < epsilon) principal_point_[1] = static_cast<float>(window_size.height) * 0.5f; else principal_point_[1] = (top * static_cast<float>(window_size.height)) / (top - bottom); focal_[1] = near * principal_point_[1] / top; setClip(Vec2d(near, far)); fov_[0] = (atan2(principal_point_[0],focal_[0]) + atan2(window_size.width-principal_point_[0],focal_[0])); fov_[1] = (atan2(principal_point_[1],focal_[1]) + atan2(window_size.height-principal_point_[1],focal_[1])); window_size_ = window_size; }
void QDeclarativeWebView::init() { d = new QDeclarativeWebViewPrivate(this); if (QWebSettings::iconDatabasePath().isNull() && QWebSettings::globalSettings()->localStoragePath().isNull() && QWebSettings::offlineStoragePath().isNull() && QWebSettings::offlineWebApplicationCachePath().isNull()) QWebSettings::enablePersistentStorage(); setAcceptedMouseButtons(Qt::LeftButton); setFlag(QGraphicsItem::ItemHasNoContents, true); setFlag(QGraphicsItem::ItemIsFocusScope, true); setClip(true); d->view = new GraphicsWebView(this); d->view->setResizesToContents(true); d->view->setFocus(); QWebPage* wp = new QDeclarativeWebPage(this); setPage(wp); if (!preferredWidth()) setPreferredWidth(d->view->preferredWidth()); if (!preferredHeight()) setPreferredHeight(d->view->preferredHeight()); connect(d->view, SIGNAL(geometryChanged()), this, SLOT(updateDeclarativeWebViewSize())); connect(d->view, SIGNAL(doubleClick(int,int)), this, SIGNAL(doubleClick(int,int))); connect(d->view, SIGNAL(scaleChanged()), this, SIGNAL(contentsScaleChanged())); }
void Snapshot::resetClip(float left, float top, float right, float bottom) { // TODO: This is incorrect, when we start rendering into a new layer, // we may have to modify the previous snapshot's clip rect and clip // region if the previous restore() call did not restore the clip mClipArea = &mClipAreaRoot; setClip(left, top, right, bottom); }
void ActorBase::setFrame(const SDL_Rect& frame) { setClip(frame); if (!isClipNull(frame)) frames.push_back(frame); }
void HudGaugeRadarDradis::setupViewHtl() { setClip(position[0], position[1], Radar_radius[0], Radar_radius[1]); gr_set_proj_matrix(.625f * PI_2, i2fl(Radar_radius[0])/i2fl(Radar_radius[1]), 0.001f, 5.0f); gr_set_view_matrix(&Orb_eye_position, &vmd_identity_matrix); gr_zbuffer_set(GR_ZBUFF_NONE); }
void Tela::initializeGem(int x, int y, int codigo) { //Define os atributos de uma celulas (posição e tamanho) matriz[x][y].celula.x = MAT_INITIAL_POINT_X + (y * CELULA_WIDHT); matriz[x][y].celula.y = MAT_INITIAL_POINT_Y + (x * CELULA_HEIGHT); matriz[x][y].celula.w = CELULA_WIDHT; matriz[x][y].celula.h = CELULA_HEIGHT; matriz[x][y].elemento = codigo; setClip(x, y, codigo); }
cv::viz::Camera::Camera(const Vec2f &fov, const Size &window_size) { CV_Assert(window_size.width > 0 && window_size.height > 0); setClip(Vec2d(0.01, 1000.01)); // Default clipping setFov(fov); window_size_ = window_size; // Principal point at the center principal_point_ = Vec2f(static_cast<float>(window_size.width)*0.5f, static_cast<float>(window_size.height)*0.5f); focal_ = Vec2f(principal_point_[0] / tan(fov_[0]*0.5f), principal_point_[1] / tan(fov_[1]*0.5f)); }
void Painter::restore() { if (history.size() > 0) { delete status.font; delete status.transformation; status = history.back(); history.pop_back(); setClip(status.clip); } }
QQuickWebPage::QQuickWebPage(QQuickWebView* viewportItem) : QQuickItem(viewportItem) , d(new QQuickWebPagePrivate(this, viewportItem)) { setFlag(ItemHasContents); setClip(true); // We do the transform from the top left so the viewport can assume the position 0, 0 // is always where rendering starts. setTransformOrigin(TopLeft); }
Viewport::Viewport(GameScene *parent) : GameItem(parent) , m_xOffset(0.0f) , m_yOffset(0.0f) , m_contentWidth(0.0f) , m_contentHeight(0.0f) , m_maxXOffset(0.0f) , m_maxYOffset(0.0f) , m_scene(parent) { setClip(true); }
Text::Text( Canvas &canvas, Text &ao ) { Dout( dc::notice, *this << " Text::Text copy constructor" ); o = evas_object_text_add( canvas.obj() ); init(); setGeometry( ao.getGeometry() ); setLayer( ao.getLayer() ); setText( ao.getText() ); setClip( ao.getClip() ); setFont( ao.getFontName(), getFontSize () ); setColor( ao.getColor() ); setVisible( ao.isVisible() ); }
EvasText::EvasText( EvasText* ao, EvasCanvas* canvas ) { Dout( dc::notice, *this << " EvasText::EvasText copy constructor" ); o = evas_object_text_add( canvas->obj() ); init( "text" ); setGeometry( ao->geometry() ); setLayer( ao->layer() ); setText( ao->text() ); setClip( ao->clip() ); setFont( ao->font() ); setColor( ao->color() ); setVisible( ao->isVisible() ); }
/** * Renders everything for a head animation * Also checks for when new head ani's need to start playing */ void HudGaugeTalkingHead::render(float frametime) { if ( Head_frame.first_frame == -1 ) { return; } if(msg_id != -1 && head_anim != NULL) { if(!head_anim->done_playing) { // draw frame // hud_set_default_color(); setGaugeColor(); // clear setClip(position[0] + Anim_offsets[0], position[1] + Anim_offsets[1], Anim_size[0], Anim_size[1]); gr_clear(); resetClip(); renderBitmap(Head_frame.first_frame, position[0], position[1]); // head ani border float scale_x = i2fl(Anim_size[0]) / i2fl(head_anim->width); float scale_y = i2fl(Anim_size[1]) / i2fl(head_anim->height); gr_set_screen_scale(fl2ir(base_w / scale_x), fl2ir(base_h / scale_y)); setGaugeColor(); generic_anim_render(head_anim,frametime, fl2ir((position[0] + Anim_offsets[0] + HUD_offset_x) / scale_x), fl2ir((position[1] + Anim_offsets[1] + HUD_offset_y) / scale_y)); // draw title gr_set_screen_scale(base_w, base_h); renderString(position[0] + Header_offsets[0], position[1] + Header_offsets[1], XSTR("message", 217)); } else { for (int j = 0; j < Num_messages_playing; ++j) { if (Playing_messages[j].id == msg_id) { Playing_messages[j].play_anim = false; break; // only one head ani plays at a time } } msg_id = -1; // allow repeated messages to display a new head ani head_anim = NULL; // Nothing to see here anymore, move along } } // check playing messages to see if we have any messages with talking animations that need to be created. for (int i = 0; i < Num_messages_playing; i++ ) { if(Playing_messages[i].play_anim && Playing_messages[i].id != msg_id ) { msg_id = Playing_messages[i].id; if (Playing_messages[i].anim_data) head_anim = Playing_messages[i].anim_data; else head_anim = NULL; return; } } }
void HudGaugeRadarOrb::setupViewHtl() { int w,h; bm_get_info(Radar_gauge.first_frame,&w, &h, NULL, NULL, NULL); setClip(position[0], position[1], w, h); gr_set_proj_matrix( .625f * PI_2, float(w)/float(h), 0.001f, 5.0f); gr_set_view_matrix( &Orb_eye_position, &vmd_identity_matrix ); gr_zbuffer_set(GR_ZBUFF_NONE); }
void QDeclarativeMozView::init() { setAcceptedMouseButtons(Qt::LeftButton); setFlag(QGraphicsItem::ItemHasNoContents, true); setFlag(QGraphicsItem::ItemIsFocusScope, true); setClip(true); d->view = new GraphicsMozView(this); d->view->setFocus(); if (!preferredWidth()) setPreferredWidth(d->view->preferredWidth()); if (!preferredHeight()) setPreferredHeight(d->view->preferredHeight()); }
BCBoard::BCBoard(QDeclarativeItem *parent) : QDeclarativeItem(parent), m_boardSize(13), m_cellSize(35.0), m_gridVisible(false), m_falcon(0), m_playerTank(0) { setFlag(QGraphicsItem::ItemHasNoContents, false); setFlag(QGraphicsItem::ItemIsFocusable, true); setClip(true); setFocus(true); setCursor(BattleCity::Ground); init(); }
void cv::viz::Camera::init(float f_x, float f_y, float c_x, float c_y, const Size &window_size) { CV_Assert(window_size.width > 0 && window_size.height > 0); setClip(Vec2d(0.01, 1000.01));// Default clipping fov_[0] = (atan2(c_x,f_x) + atan2(window_size.width-c_x,f_x)); fov_[1] = (atan2(c_y,f_y) + atan2(window_size.height-c_y,f_y)); principal_point_[0] = c_x; principal_point_[1] = c_y; focal_[0] = f_x; focal_[1] = f_y; window_size_ = window_size; }
void HudGaugeRadarOrb::setupView() { hud_save_restore_camera_data(1); g3_end_frame(); int w,h; bm_get_info(Radar_gauge.first_frame,&w, &h, NULL, NULL, NULL); setClip(position[0], position[1],w, h); g3_start_frame(1); float old_zoom=View_zoom; View_zoom=.75; g3_set_view_matrix( &Orb_eye_position, &vmd_identity_matrix, View_zoom); View_zoom=old_zoom; }
void WidgetStrainVideo::load(const QString &path, const QString &filename) { currentIndex = 0; QString fullPath = path + QDir::separator() + filename; QString fullMetadataPath = fullPath + "_metadata"; currentFilename = filename; QProgressDialog progDlg("Loading video", QString(), 0, 500, this); progDlg.setWindowModality(Qt::WindowModal); progDlg.setMinimumDuration(100); VideoDataClip *loadedClip = new VideoDataClip(fullPath, fullMetadataPath, &progDlg); setClip(loadedClip); QPixmap image = UIUtils::Mat8ToQPixmap(clip->frames[0]); ui->widgetResult->setImage(image); shapes.clear(); deserializeShapes(path); qDebug() << "shapes loaded"; ui->horizontalSlider->setValue(0); on_horizontalSlider_valueChanged(0); }
/** * HudGaugeMessages::render() will display the active HUD messages on the HUD. It will scroll * the messages up when a new message arrives. */ void HudGaugeMessages::render(float frametime) { hud_set_default_color(); // dependant on max_width, max_lines, and line_height setClip(position[0], position[1], Window_width, Window_height+2); for ( SCP_vector<Hud_display_info>::iterator m = active_messages.begin(); m != active_messages.end(); ++m) { if ( !timestamp_elapsed(m->total_life) ) { if ( !(Player->flags & PLAYER_FLAGS_MSG_MODE) || !Hidden_by_comms_menu) { // set the appropriate color if ( m->msg.source ) { setGaugeColor(HUD_C_BRIGHT); } else { setGaugeColor(); } // print the message out renderPrintf(m->msg.x, m->y, "%s", m->msg.text.c_str()); } } } }
void FormGadget::drawProxy() { if (!visible()) return; if (form()->application().runningOnTreo600() && hasFocus()) drawFocusRing(); Graphics graphics(WinGetDrawWindow()); // form()->windowHandle() Rect rect; bounds(rect); bool db=doubleBuffer_; if (db) { Rect formBounds; form()->bounds(formBounds); Err error; WinHandle wh = WinCreateOffscreenWindow(formBounds.width(), formBounds.height(), nativeFormat, &error); if (errNone == error) { { Graphics offscreen(wh); ActivateGraphics active(offscreen); handleDraw(graphics); offscreen.copyArea(rect, graphics, rect.topLeft()); } WinDeleteWindow(wh, false); } else db=false; } if (!db) { Graphics::ClipRectangleSetter setClip(graphics, rect); handleDraw(graphics); } fireDrawCompleted(); }
bool ActorBase::loadTexture(const std::string& imgPath, const SDL_Rect& _clip/* = { 0,0,0,0 }*/) { if (texture) { SDL_DestroyTexture(texture); texture = nullptr; position = { 0, 0, 0, 0 }; } texture = engine->loadTexture(imgPath); if (!texture) return false; else { if (SDL_QueryTexture(texture, &textureFormat, &textureAccess, &textureWidth, &textureHeight) != static_cast<Uint32>(0)) { log << warnlvl << full_log << "Error quarying the texture: " << SDL_GetError() << el; throw; } setClip(_clip); return true; } }
void Snapshot::resetClip(float left, float top, float right, float bottom) { clipRect = &mClipRectRoot; setClip(left, top, right, bottom); }
void StreamThread::setInst(libvlc_instance_t *in,char clip,char *cAddr){ setVLCInst(in); setClientAddr(cAddr); setClip(clip); }
// metódo SET void Tela::setElement(int x, int y, int element) { setClip(x, y, element); }
void HudGaugeShield::showShields(object *objp, int mode) { // static int fod_model = -1; float max_shield; int hud_color_index, range; int sx, sy, i; ship *sp; ship_info *sip; hud_frames *sgp=NULL; if ( objp->type != OBJ_SHIP ) return; // Goober5000 - don't show if primitive sensors if ( Ships[Player_obj->instance].flags[Ship::Ship_Flags::Primitive_sensors] ) return; sp = &Ships[objp->instance]; sip = &Ship_info[sp->ship_info_index]; // bool digitus_improbus = (fod_model != -2 && strstr(sp->ship_name, "Sathanas") != NULL); if ( sip->shield_icon_index == 255 && !(sip->flags[Ship::Info_Flags::Generate_hud_icon]) /*&& !digitus_improbus*/) { return; } setGaugeColor(); // load in shield frames if not already loaded if (sip->shield_icon_index != 255) { sgp = &Shield_gauges.at(sip->shield_icon_index); if ( (sgp->first_frame == -1) && (sip->shield_icon_index < Hud_shield_filenames.size()) ) { sgp->first_frame = bm_load_animation(Hud_shield_filenames.at(sip->shield_icon_index).c_str(), &sgp->num_frames); if (sgp->first_frame == -1) { if (!shield_ani_warning_displayed_already) { shield_ani_warning_displayed_already = true; Warning(LOCATION, "Could not load in the HUD shield ani: %s\n", Hud_shield_filenames.at(sip->shield_icon_index).c_str()); } return; } } } sx = position[0]; sy = position[1]; sx += fl2i(HUD_offset_x); sy += fl2i(HUD_offset_y); // draw the ship first maybeFlashShield(SHIELD_HIT_PLAYER, Shield_hit_data[SHIELD_HIT_PLAYER].hull_hit_index); if(sip->shield_icon_index != 255) { renderBitmap(sgp->first_frame, sx, sy); } else { bool g3_yourself = !g3_in_frame(); angles rot_angles = {-1.570796327f,0.0f,0.0f}; matrix object_orient; vm_angles_2_matrix(&object_orient, &rot_angles); gr_screen.clip_width = 112; gr_screen.clip_height = 93; //Fire it up if(g3_yourself) g3_start_frame(1); hud_save_restore_camera_data(1); setClip(sx, sy, 112, 93); //if(!digitus_improbus) g3_set_view_matrix( &sip->closeup_pos, &vmd_identity_matrix, sip->closeup_zoom * 2.5f); /*else { vec3d finger_vec = {0.0f, 0.0f, 176.0f}; g3_set_view_matrix( &finger_vec, &vmd_identity_matrix, 1.0f); }*/ gr_set_proj_matrix(0.5f*Proj_fov, gr_screen.clip_aspect, Min_draw_distance, Max_draw_distance); gr_set_view_matrix(&Eye_position, &Eye_matrix); //We're ready to show stuff //if(!digitus_improbus) { model_render_params render_info; render_info.set_flags(MR_NO_LIGHTING | MR_AUTOCENTER | MR_NO_FOGGING); render_info.set_replacement_textures(sp->ship_replacement_textures); render_info.set_detail_level_lock(1); render_info.set_object_number(OBJ_INDEX(objp)); model_render_immediate( &render_info, sip->model_num, &object_orient, &vmd_zero_vector ); } /*else { if(fod_model == -1) { fod_model = model_load(NOX("FoD.pof"), 0, NULL); if(fod_model == -1) { fod_model = -2; return; } } model_render(fod_model, &object_orient, &vmd_zero_vector, MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER | MR_NO_FOGGING, -1, -1); }*/ //We're done gr_end_view_matrix(); gr_end_proj_matrix(); if(g3_yourself) g3_end_frame(); hud_save_restore_camera_data(0); resetClip(); } if(!sip->max_shield_strength) return; // draw the quadrants // // Draw shield quadrants at one of NUM_SHIELD_LEVELS max_shield = get_max_shield_quad(objp); coord2d shield_icon_coords[6]; for ( i = 0; i < objp->n_quadrants; i++ ) { if ( objp->flags[Object::Object_Flags::No_shields] ) { break; } if ( !(sip->flags[Ship::Info_Flags::Model_point_shields]) ) { if ( objp->shield_quadrant[Quadrant_xlate[i]] < 0.1f ) continue; } else { if ( objp->shield_quadrant[i] < 0.1f ) continue; } range = MAX(HUD_COLOR_ALPHA_MAX, HUD_color_alpha + objp->n_quadrants); if ( !(sip->flags[Ship::Info_Flags::Model_point_shields]) ) hud_color_index = fl2i( (objp->shield_quadrant[Quadrant_xlate[i]] / max_shield) * range); else hud_color_index = fl2i( (objp->shield_quadrant[i] / max_shield) * range); Assert(hud_color_index >= 0 && hud_color_index <= range); if ( hud_color_index < 0 ) { hud_color_index = 0; } if ( hud_color_index >= HUD_NUM_COLOR_LEVELS ) { hud_color_index = HUD_NUM_COLOR_LEVELS - 1; } int flash=0; flash = maybeFlashShield(mode, i); if ( !flash ) { // gr_set_color_fast(&HUD_color_defaults[hud_color_index]); setGaugeColor(hud_color_index); if(sip->shield_icon_index != 255) { int framenum = sgp->first_frame+i+1; if (framenum < sgp->first_frame+sgp->num_frames) renderBitmap(framenum, sx, sy); } else { //Ugh, draw four shield quadrants static const int TRI_EDGE = 6; static const int BAR_LENGTH = 112; static const int BAR_HEIGHT = 54; static const int BAR_WIDTH = 6; static const int SHIELD_OFFSET = BAR_WIDTH + TRI_EDGE + 3; switch(i) { //Top case 0: shield_icon_coords[0].x = sx; shield_icon_coords[0].y = sy+BAR_WIDTH+TRI_EDGE; shield_icon_coords[1].x = sx; shield_icon_coords[1].y = sy; shield_icon_coords[2].x = sx+TRI_EDGE; shield_icon_coords[2].y = sy+BAR_WIDTH; shield_icon_coords[3].x = sx+BAR_LENGTH; shield_icon_coords[3].y = sy; shield_icon_coords[4].x = sx+BAR_LENGTH-TRI_EDGE; shield_icon_coords[4].y = sy+BAR_WIDTH; shield_icon_coords[5].x = sx+BAR_LENGTH; shield_icon_coords[5].y = sy+BAR_WIDTH+TRI_EDGE; renderShieldIcon(shield_icon_coords); break; //Left case 3: sy += SHIELD_OFFSET; shield_icon_coords[0].x = sx+BAR_WIDTH+TRI_EDGE; shield_icon_coords[0].y = sy+BAR_HEIGHT; shield_icon_coords[1].x = sx; shield_icon_coords[1].y = sy+BAR_HEIGHT; shield_icon_coords[2].x = sx+BAR_WIDTH; shield_icon_coords[2].y = sy+BAR_HEIGHT-TRI_EDGE; shield_icon_coords[3].x = sx; shield_icon_coords[3].y = sy; shield_icon_coords[4].x = sx+BAR_WIDTH; shield_icon_coords[4].y = sy+TRI_EDGE; shield_icon_coords[5].x = sx+BAR_WIDTH+TRI_EDGE; shield_icon_coords[5].y = sy; renderShieldIcon(shield_icon_coords); sy -= SHIELD_OFFSET + BAR_WIDTH + TRI_EDGE; break; //Right case 1: sx += BAR_LENGTH; sy += SHIELD_OFFSET; shield_icon_coords[0].x = sx-BAR_WIDTH-TRI_EDGE; shield_icon_coords[0].y = sy; shield_icon_coords[1].x = sx; shield_icon_coords[1].y = sy; shield_icon_coords[2].x = sx-BAR_WIDTH; shield_icon_coords[2].y = sy+TRI_EDGE; shield_icon_coords[3].x = sx; shield_icon_coords[3].y = sy+BAR_HEIGHT; shield_icon_coords[4].x = sx-BAR_WIDTH; shield_icon_coords[4].y = sy+BAR_HEIGHT-TRI_EDGE; shield_icon_coords[5].x = sx-BAR_WIDTH-TRI_EDGE; shield_icon_coords[5].y = sy+BAR_HEIGHT; renderShieldIcon(shield_icon_coords); sx -= BAR_LENGTH; sy -= SHIELD_OFFSET; break; //Bottom case 2: sy += BAR_HEIGHT + SHIELD_OFFSET*2 - BAR_WIDTH - TRI_EDGE; shield_icon_coords[0].x = sx+BAR_LENGTH; shield_icon_coords[0].y = sy; shield_icon_coords[1].x = sx+BAR_LENGTH; shield_icon_coords[1].y = sy+BAR_WIDTH+TRI_EDGE; shield_icon_coords[2].x = sx+BAR_LENGTH-TRI_EDGE; shield_icon_coords[2].y = sy+TRI_EDGE; shield_icon_coords[3].x = sx; shield_icon_coords[3].y = sy+BAR_WIDTH+TRI_EDGE; shield_icon_coords[4].x = sx+TRI_EDGE; shield_icon_coords[4].y = sy+TRI_EDGE; shield_icon_coords[5].x = sx; shield_icon_coords[5].y = sy; renderShieldIcon(shield_icon_coords); sy -= BAR_HEIGHT + SHIELD_OFFSET*2 - BAR_WIDTH - TRI_EDGE; break; //Whoops? default: nprintf(("HUD", "Invalid shield quadrant %d specified!\n", i)); break; } } } } // hud_set_default_color(); }