void TEXTE_MODULE::Flip( const wxPoint& aCentre ) { // flipping the footprint is relative to the X axis MIRROR( m_Pos.y, aCentre.y ); NEGATE_AND_NORMALIZE_ANGLE_POS( m_Orient ); SetLayer( FlipLayer( GetLayer() ) ); m_Mirror = IsBackLayer( GetLayer() ); SetLocalCoord(); }
void TEXTE_PCB::Flip( const wxPoint& aCentre ) { SetTextY( aCentre.y - ( GetTextPos().y - aCentre.y ) ); int copperLayerCount = GetBoard()->GetCopperLayerCount(); SetLayer( FlipLayer( GetLayer(), copperLayerCount ) ); SetMirrored( !IsMirrored() ); }
Game_Vehicle::Game_Vehicle(Type _type) : Game_Character(getDataFromType(_type)) { type = _type; SetDirection(Left); SetSpriteDirection(Left); SetAnimationType(AnimType::AnimType_non_continuous); SetLayer(RPG::EventPage::Layers_same); LoadSystemSettings(); }
SCH_NO_CONNECT::SCH_NO_CONNECT( const wxPoint& pos ) : SCH_ITEM( NULL, SCH_NO_CONNECT_T ) { #define DRAWNOCONNECT_SIZE 48 /* No symbol connection range. */ m_pos = pos; m_size.x = m_size.y = DRAWNOCONNECT_SIZE; #undef DRAWNOCONNECT_SIZE SetLayer( LAYER_NOCONNECT ); }
SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, wxString aName ) : SCH_ITEM( aParent, SCH_FIELD_T ), EDA_TEXT() { m_Pos = aPos; m_id = aFieldId; m_Attributs = TEXT_NO_VISIBLE; m_name = aName; SetLayer( LAYER_FIELDS ); }
SCH_FIELD::SCH_FIELD( const wxPoint& aPos, int aFieldId, SCH_COMPONENT* aParent, wxString aName ) : SCH_ITEM( aParent, SCH_FIELD_T ), EDA_TEXT() { SetTextPos( aPos ); m_id = aFieldId; m_name = aName; SetVisible( false ); SetLayer( LAYER_FIELDS ); }
void Game_Event::Setup(RPG::EventPage* new_page) { page = new_page; // Free resources if needed if (interpreter) { interpreter->Clear(); Game_Map::ReserveInterpreterDeletion(interpreter); interpreter.reset(); } if (page == NULL) { tile_id = 0; SetSpriteName(""); SetSpriteIndex(0); SetDirection(RPG::EventPage::Direction_down); //move_type = 0; trigger = -1; list.clear(); return; } SetSpriteName(page->character_name); SetSpriteIndex(page->character_index); tile_id = page->character_name.empty() ? page->character_index : 0; if (GetDirection() != page->character_direction) { SetDirection(page->character_direction); SetSpriteDirection(page->character_direction); } if (original_pattern != page->character_pattern) { pattern = page->character_pattern; original_pattern = pattern; } move_type = page->move_type; SetMoveSpeed(page->move_speed); SetMoveFrequency(page->move_frequency); max_stop_count = (GetMoveFrequency() > 7) ? 0 : pow(2.0, 8 - GetMoveFrequency()); original_move_frequency = page->move_frequency; original_move_route = page->move_route; SetOriginalMoveRouteIndex(0); animation_type = page->animation_type; SetOpacity(page->translucent ? 160 : 255); SetLayer(page->layer); trigger = page->trigger; list = page->event_commands; if (trigger == RPG::EventPage::Trigger_parallel) { interpreter.reset(new Game_Interpreter_Map()); } CheckEventTriggerAuto(); }
void TEXTE_MODULE::Flip( const wxPoint& aCentre ) { // flipping the footprint is relative to the X axis SetTextY( ::Mirror( GetTextPos().y, aCentre.y ) ); SetTextAngle( -GetTextAngle() ); SetLayer( FlipLayer( GetLayer() ) ); SetMirrored( IsBackLayer( GetLayer() ) ); SetLocalCoord(); }
void Game_Vehicle::GetOn() { driving = true; if (type == Airship) { SetLayer(RPG::EventPage::Layers_above); data.remaining_ascent = SCREEN_TILE_WIDTH; data.flying = true; } else { walk_animation = true; } Game_System::BgmPlay(bgm); }
void DRAWSEGMENT::Flip( const wxPoint& aCentre ) { m_Start.y = aCentre.y - (m_Start.y - aCentre.y); m_End.y = aCentre.y - (m_End.y - aCentre.y); if( m_Shape == S_ARC ) { NEGATE( m_Angle ); } SetLayer( FlipLayer( GetLayer() ) ); }
CCursor::CCursor(void) { SetCoverObject(false); SetImageID(CSGD_TextureManager::GetInstance()->LoadTexture("Resource/Graphics/Crosshair.png")); SetPosX(100.0f); SetPosY(100.0f); SetLayer(0); SetWidth(32); SetHeight(32); }
Object::Object(float x, float y , String pathName, float sx, float sy) { SetLayer(3); SetPosition(x, y); SetName("object"); SetSprite(pathName); SetSize(sx, sy); SetDensity(0.0f); SetFriction(0.0f); SetRestitution(0.1f); InitPhysics(); }
void LoadStage(Stage_T stagesel){ layer = (StageLayer*)malloc(sizeof(StageLayer)); switch(stagesel){ case ST_PLATFORM: st.bg = "images/bgimage1.png"; SetLayer(layer,1,512,384,1536,1152,768,576,"images/bgimage2.png",1); SetLayer(layer->next,2,512,384,1536,1152,768,576,"images/bgimage2.png",1); SetLayer(layer->next->next,0,0,0,1024,768,0,0,"images/stage.png",0); platform.p_ypos = 540; platform.p_left = 220; platform.p_right = 790; platform.next=NULL; // platform.next = (Platform*)malloc(sizeof(Platform)); // platform.next->p_ypos = 740; // platform.next->p_left = 0; // platform.next->p_right = 1024; // platform.next->next=NULL; st.P1spawn= 270; st.P2spawn = 740; break; case ST_DEBUG: case ST_FIELD: st.bg = "images/bgtest.png"; platform.p_ypos = 600; platform.p_left = 0; platform.p_right = 1025; SetLayer(layer,0,512,660,1722,162,861,81,"images/train.png",0); st.P1spawn = 200; st.P2spawn = 820; break; } st.platform_list = &platform; st.layer_list = layer; DrawBG(st.bg); }
void TEXTE_PCB::Flip(const wxPoint& aCentre ) { m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y ); // NEGATE( m_Orient ); not needed: m_Mirror handles this if( GetLayer() == LAYER_N_BACK || GetLayer() == LAYER_N_FRONT || GetLayer() == SILKSCREEN_N_BACK || GetLayer() == SILKSCREEN_N_FRONT ) { m_Mirror = not m_Mirror; /* inverse mirror */ } SetLayer( BOARD::ReturnFlippedLayerNumber( GetLayer() ) ); }
void Game_Event::Setup(RPG::EventPage* new_page) { page = new_page; if (page == NULL) { tile_id = 0; SetSpriteName(""); SetSpriteIndex(0); SetDirection(RPG::EventPage::Direction_down); //move_type = 0; through = true; trigger = -1; list.clear(); interpreter.reset(); return; } SetSpriteName(page->character_name); SetSpriteIndex(page->character_index); tile_id = page->character_name.empty() ? page->character_index : 0; if (GetDirection() != page->character_direction) { SetDirection(page->character_direction); SetPrelockDirection(page->character_direction); } if (original_pattern != page->character_pattern) { pattern = page->character_pattern; original_pattern = pattern; } //opacity = page.opacity; //opacity = page.translucent ? 192 : 255; //blend_type = page.blend_type; move_type = page->move_type; SetMoveSpeed(page->move_speed); SetMoveFrequency(page->move_frequency); original_move_route = page->move_route; SetOriginalMoveRouteIndex(0); animation_type = page->animation_type; SetLayer(page->layer); trigger = page->trigger; list = page->event_commands; through = false; // Free resources if needed interpreter.reset(); if (trigger == RPG::EventPage::Trigger_parallel) { interpreter.reset(new Game_Interpreter_Map()); } CheckEventTriggerAuto(); }
void hsGMaterial::ReplaceLayer(plLayerInterface* oldLay, plLayerInterface* newLay, bool piggyBack) { hsTArray<plLayerInterface*>& layers = piggyBack ? fPiggyBacks : fLayers; int i; for( i = 0; i < layers.GetCount(); i++ ) { if( layers[i] == oldLay ) break; } hsAssert(i < layers.GetCount(), "Replacing a layer we don't have"); if( i >= layers.GetCount() ) return; SetLayer(newLay, i, piggyBack); }
void Game_Vehicle::Refresh() { if (!driving && Main_Data::game_player->GetVehicle() == this) driving = true; if (driving) SetMapId(Game_Map::GetMapId()); else if (IsInCurrentMap()) MoveTo(GetX(), GetY()); switch (type) { case None: break; case Boat: case Ship: SetLayer(RPG::EventPage::Layers_same); SetMoveSpeed(RPG::EventPage::MoveSpeed_normal); break; case Airship: SetLayer(driving ? RPG::EventPage::Layers_above : RPG::EventPage::Layers_below); SetMoveSpeed(RPG::EventPage::MoveSpeed_double); break; } walk_animation = (type != Airship) || driving; }
// T H E C O I N (entity) Coin::Coin(int x, int y, Sprite *sprite) : Entity(), collected(false), start(x, y), reset(false) { position = Vector2(x, y); SetLayer(-1); SetGraphic(sprite); AddTag("COIN"); SetCollider(new RectangleCollider(8, 8)); while(Collide("WALL")) { position = Vector2(((int) rand() % 160 / 8) * 8 + 4, ((int) rand() % 120 / 8) * 8 + 4); start = Vector2(position.x, position.y); } }
void MODULE::Flip( const wxPoint& aCentre ) { // Move module to its final position: wxPoint finalPos = m_Pos; finalPos.y = aCentre.y - ( finalPos.y - aCentre.y ); /// Mirror the Y position SetPosition( finalPos ); // Flip layer SetLayer( FlipLayer( GetLayer() ) ); // Reverse mirror orientation. NEGATE( m_Orient ); NORMALIZE_ANGLE_POS( m_Orient ); // Mirror pads to other side of board about the x axis, i.e. vertically. for( D_PAD* pad = m_Pads; pad; pad = pad->Next() ) pad->Flip( m_Pos ); // Mirror reference. m_Reference->FlipWithModule( m_Pos.y ); // Mirror value. m_Value->FlipWithModule( m_Pos.y ); // Reverse mirror module graphics and texts. for( EDA_ITEM* item = m_Drawings; item; item = item->Next() ) { switch( item->Type() ) { case PCB_MODULE_EDGE_T: ( (EDGE_MODULE*) item )->Flip( m_Pos ); break; case PCB_MODULE_TEXT_T: static_cast<TEXTE_MODULE*>( item )->FlipWithModule( m_Pos.y ); break; default: wxMessageBox( wxT( "MODULE::Flip() error: Unknown Draw Type" ) ); break; } } CalculateBoundingBox(); }
void TEXTE_MODULE::Copy( TEXTE_MODULE* source ) { if( source == NULL ) return; m_Pos = source->m_Pos; SetLayer( source->GetLayer() ); m_Mirror = source->m_Mirror; m_NoShow = source->m_NoShow; m_Type = source->m_Type; m_Orient = source->m_Orient; m_Pos0 = source->m_Pos0; m_Size = source->m_Size; m_Thickness = source->m_Thickness; m_Italic = source->m_Italic; m_Bold = source->m_Bold; m_Text = source->m_Text; }
void sStatusBorder::OnPaint(int layer) { int left = Client.SizeX(); int spacers = 0; for(auto &i : Items) { left -= i.Size; if(i.Size==0) spacers++; } int x = Client.x0; int n = 0; for(auto &i : Items) { i.r.y0 = Client.y1-Height+1; i.r.y1 = Client.y1; i.r.x0 = x; x += i.Size; if(i.Size==0) { x += (n+1)*left/spacers - n*left/spacers; n++; } i.r.x1 = x; } auto pnt = Painter(); auto sty = Style(); sRect r = Client; r.y0 = r.y1 - Height; r.y1 = r.y0 + 1; pnt->SetLayer(layer+0); pnt->Rect(sty->Colors[sGC_Draw],r); int flag = 1; for(auto i : Items) { sty->Rect(layer,this,sSK_StatusBorder,i.r,flag,i.Text); flag = 0; } }
Player::Player(Vector2 pos) : Entity() { position = pos; SetLayer(-10); AddTag("Player"); SetCollider(new RectangleCollider(40, 64)); sprite = new Sprite("Graphics/Player.png", FILTER_NONE, 64, 64); SetGraphic(sprite); speed = 100.0f; gravity = 0.25f; velocity = Vector2(0.0f, 0.0f); jump = 8.0f; maxSpeed = 4.0f; leanAmount = 1.5f; }
// T H E S P I K E (entity) Spike::Spike(int x, int y, Sprite *sprite) : Entity() { position = Vector2(x, y); SetLayer(-1); SetGraphic(sprite); AddTag("SPIKE"); SetCollider(new RectangleCollider(8, 8)); if(position.x == -1 && position.y == -1) { position = Vector2(((int) rand() % 160 / 8) * 8 + 4, ((int) rand() % 120 / 8) * 8 + 4); while(Collide("WALL")) { position = Vector2(((int) rand() % 160 / 8) * 8 + 4, ((int) rand() % 120 / 8) * 8 + 4); } while(!Collide("WALL")) { position.y += 1; } } }
void SaveSubWindowAttributes::SetFromNode(DataNode *parentNode) { if(parentNode == 0) return; DataNode *searchNode = parentNode->GetNode("SaveSubWindowAttributes"); if(searchNode == 0) return; DataNode *node; if((node = searchNode->GetNode("position")) != 0) SetPosition(node->AsIntArray()); if((node = searchNode->GetNode("size")) != 0) SetSize(node->AsIntArray()); if((node = searchNode->GetNode("layer")) != 0) SetLayer(node->AsInt()); if((node = searchNode->GetNode("transparency")) != 0) SetTransparency(node->AsDouble()); if((node = searchNode->GetNode("omitWindow")) != 0) SetOmitWindow(node->AsBool()); }
void EDGE_MODULE::Flip( const wxPoint& aCentre ) { wxPoint pt; switch( GetShape() ) { case S_ARC: SetAngle( -GetAngle() ); //Fall through default: case S_SEGMENT: pt = GetStart(); MIRROR( pt.y, aCentre.y ); SetStart( pt ); pt = GetEnd(); MIRROR( pt.y, aCentre.y ); SetEnd( pt ); MIRROR( m_Start0.y, 0 ); MIRROR( m_End0.y, 0 ); break; case S_POLYGON: // polygon corners coordinates are always relative to the // footprint position, orientation 0 for( auto iter = m_Poly.Iterate(); iter; iter++ ) { MIRROR( iter->y, 0 ); } break; } // DRAWSEGMENT items are not usually on copper layers, but // it can happen in microwave apps. // However, currently, only on Front or Back layers. // So the copper layers count is not taken in account SetLayer( FlipLayer( GetLayer() ) ); }
mitk::Label::Label() : PropertyList() { if (GetProperty("locked") == nullptr) SetLocked(true); if (GetProperty("visible") == nullptr) SetVisible(true); if (GetProperty("opacity") == nullptr) SetOpacity(0.6); if (GetProperty("center.coordinates") == nullptr) { mitk::Point3D pnt; pnt.SetElement(0, 0); pnt.SetElement(1, 0); pnt.SetElement(2, 0); SetCenterOfMassCoordinates(pnt); } if (GetProperty("center.index") == nullptr) { mitk::Point3D pnt; pnt.SetElement(0, 0); pnt.SetElement(1, 0); pnt.SetElement(2, 0); SetCenterOfMassIndex(pnt); } if (GetProperty("color") == nullptr) { mitk::Color col; col.Set(0, 0, 0); SetColor(col); } if (GetProperty("name") == nullptr) SetName("noName!"); if (GetProperty("value") == nullptr) SetValue(0); if (GetProperty("layer") == nullptr) SetLayer(0); DICOMSegmentationPropertyHandler::SetDICOMSegmentProperties(this); }
void DIMENSION::Copy( DIMENSION* source ) { m_Value = source->m_Value; SetLayer( source->GetLayer() ); m_Width = source->m_Width; m_Shape = source->m_Shape; m_Height = source->m_Height; m_Unit = source->m_Unit; SetTimeStamp( GetNewTimeStamp() ); m_Text.Copy( &source->m_Text ); m_crossBarO = source->m_crossBarO; m_crossBarF = source->m_crossBarF; m_featureLineGO = source->m_featureLineGO; m_featureLineGF = source->m_featureLineGF; m_featureLineDO = source->m_featureLineDO; m_featureLineDF = source->m_featureLineDF; m_arrowD1F = source->m_arrowD1F; m_arrowD2F = source->m_arrowD2F; m_arrowG1F = source->m_arrowG1F; m_arrowG2F = source->m_arrowG2F; }
void Game_Vehicle::Update() { Game_Character::Update(); if (type == Airship) { if (IsAscending()) { data.remaining_ascent -= 8; if (!IsAscending()) walk_animation = true; } else if (IsDescending()) { data.remaining_descent -= 8; if (!IsDescending()) { if (CanLand()) { SetLayer(RPG::EventPage::Layers_below); driving = false; data.flying = false; } else { // Can't land here, ascend again data.remaining_ascent = SCREEN_TILE_WIDTH; } } } } }
void EDGE_MODULE::Flip(const wxPoint& aCentre ) { wxPoint pt; switch( GetShape() ) { case S_ARC: SetAngle( -GetAngle() ); //Fall through default: case S_SEGMENT: pt = GetStart(); pt.y -= aCentre.y; pt.y = -pt.y; pt.y += aCentre.y; SetStart( pt ); pt = GetEnd(); pt.y -= aCentre.y; pt.y = -pt.y; pt.y += aCentre.y; SetEnd( pt ); NEGATE( m_Start0.y ); NEGATE( m_End0.y ); break; case S_POLYGON: // polygon corners coordinates are always relative to the // footprint position, orientation 0 for( unsigned ii = 0; ii < m_PolyPoints.size(); ii++ ) NEGATE( m_PolyPoints[ii].y ); } SetLayer( FlipLayer( GetLayer() ) ); }
void PCB_TARGET::Flip(const wxPoint& aCentre ) { m_Pos.y = aCentre.y - ( m_Pos.y - aCentre.y ); SetLayer( FlipLayer( GetLayer() ) ); }