當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetLayer函數代碼示例

本文整理匯總了C++中GetLayer函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetLayer函數的具體用法?C++ GetLayer怎麽用?C++ GetLayer使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetLayer函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetScreenY

int Game_Character::GetScreenZ() const {
	int z = this == Main_Data::game_player.get() ? 1 : 0;

	// For events on the screen, this should be inside a 0-40 range
	z += GetScreenY() >> 3;

	z += GetLayer() * 50;

	return z;
}
開發者ID:KitoHo,項目名稱:Player,代碼行數:10,代碼來源:game_character.cpp

示例2: GetWorld

CCommonCtrl::~CCommonCtrl()
{
#if !defined(__CLIENT)
	#ifdef __LAYER_1021
	GetWorld()->m_respawner.Increment( GetRespawn(), m_nRespawnType, FALSE, GetLayer() );
	#else	// __LAYER_1021
	GetWorld()->m_respawner.Increment( GetRespawn(), m_nRespawnType, FALSE );
	#endif	// __LAYER_1021
#endif
}
開發者ID:careysky,項目名稱:FlyFF,代碼行數:10,代碼來源:CommonCtrl.cpp

示例3: RenderSprite

void CComponent_Items::RenderSprite(const CNetObj_TU_Sprite *pPrev, const CNetObj_TU_Sprite *pCurrent)
{
	if(pCurrent->m_ItemLayer != GetLayer()) return;

	float Angle = mix(2.0*pi*static_cast<float>(pPrev->m_Angle)/360.0f, 2.0*pi*static_cast<float>(pCurrent->m_Angle)/360.0f, Client()->IntraGameTick());
	float Size = mix(pPrev->m_Size, pCurrent->m_Size, Client()->IntraGameTick());
	vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
	
	TUKernel()->AssetsRenderer()->DrawSprite(pCurrent->m_SpriteId, Pos, Size, Angle, 0x0, 1.0f);
}
開發者ID:teeworlds-modapi,項目名稱:teeworlds,代碼行數:10,代碼來源:items.cpp

示例4: GetPlotOptions

bool PLOT_CONTROLLER::OpenPlotfile( const wxString &aSuffix,
                                    PlotFormat     aFormat,
                                    const wxString &aSheetDesc )
{
    LOCALE_IO toggle;

    /* Save the current format: sadly some plot routines depends on this
       but the main reason is that the StartPlot method uses it to
       dispatch the plotter creation */
    GetPlotOptions().SetFormat( aFormat );

    // Ensure that the previous plot is closed
    ClosePlot();

    // Now compute the full filename for the output and start the plot
    // (after ensuring the output directory is OK)
    wxString outputDirName = GetPlotOptions().GetOutputDirectory() ;
    wxFileName outputDir = wxFileName::DirName( outputDirName );
    wxString boardFilename = m_board->GetFileName();

    if( EnsureFileDirectoryExists( &outputDir, boardFilename ) )
    {
        // outputDir contains now the full path of plot files
        m_plotFile = boardFilename;
        m_plotFile.SetPath( outputDir.GetPath() );
        wxString fileExt = GetDefaultPlotExtension( aFormat );

        // Gerber format can use specific file ext, depending on layers
        // (now not a good practice, because the official file ext is .gbr)
        if( GetPlotOptions().GetFormat() == PLOT_FORMAT_GERBER &&
            GetPlotOptions().GetUseGerberProtelExtensions() )
            fileExt = GetGerberProtelExtension( GetLayer() );

        // Build plot filenames from the board name and layer names:
        BuildPlotFileName( &m_plotFile, outputDir.GetPath(), aSuffix, fileExt );

        m_plotter = StartPlotBoard( m_board, &GetPlotOptions(), ToLAYER_ID( GetLayer() ),
                                    m_plotFile.GetFullPath(), aSheetDesc );
    }

    return( m_plotter != NULL );
}
開發者ID:AlexanderBrevig,項目名稱:kicad-source-mirror,代碼行數:42,代碼來源:pcbplot.cpp

示例5: RenderModAPISprite

void CModAPI_Component_Items::RenderModAPISprite(const CNetObj_ModAPI_Sprite *pPrev, const CNetObj_ModAPI_Sprite *pCurrent)
{
    if(pCurrent->m_ItemLayer != GetLayer()) return;
    if(!ModAPIGraphics()) return;

    float Angle = mix(2.0*pi*static_cast<float>(pPrev->m_Angle)/360.0f, 2.0*pi*static_cast<float>(pCurrent->m_Angle)/360.0f, Client()->IntraGameTick());
    float Size = mix(pPrev->m_Size, pCurrent->m_Size, Client()->IntraGameTick());
    vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());

    ModAPIGraphics()->DrawSprite(RenderTools(), pCurrent->m_SpriteId, Pos, Size, Angle, 0);
}
開發者ID:teeworlds-modapi,項目名稱:mod-target,代碼行數:11,代碼來源:items.cpp

示例6: GetLayer

void
LayerComposite::AddBlendModeEffect(EffectChain& aEffectChain)
{
  gfx::CompositionOp blendMode = GetLayer()->GetEffectiveMixBlendMode();
  if (blendMode == gfx::CompositionOp::OP_OVER) {
    return;
  }

  aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE] = new EffectBlendMode(blendMode);
  return;
}
開發者ID:rtrsparq,項目名稱:gecko-dev,代碼行數:11,代碼來源:LayerManagerComposite.cpp

示例7: GetLayer

	void DeferredRenderQueue::AddMesh(int renderOrder, const Material* material, const MeshData& meshData, const Boxf& meshAABB, const Matrix4f& transformMatrix)
	{
		if (material->IsBlendingEnabled() || material->IsDepthSortingEnabled()) //< Fixme: Deferred Shading should be able to handle depth sorting
			// Deferred Shading cannot handle blended objects, put them in the forward list
			m_forwardQueue->AddMesh(renderOrder, material, meshData, meshAABB, transformMatrix);
		else
		{
			Layer& currentLayer = GetLayer(renderOrder);
			MeshPipelineBatches& opaqueModels = currentLayer.opaqueModels;

			const MaterialPipeline* materialPipeline = material->GetPipeline();

			auto pipelineIt = opaqueModels.find(materialPipeline);
			if (pipelineIt == opaqueModels.end())
			{
				BatchedMaterialEntry materialEntry;
				pipelineIt = opaqueModels.insert(MeshPipelineBatches::value_type(materialPipeline, std::move(materialEntry))).first;
			}

			BatchedMaterialEntry& materialEntry = pipelineIt->second;
			MeshMaterialBatches& materialMap = materialEntry.materialMap;

			auto materialIt = materialMap.find(material);
			if (materialIt == materialMap.end())
			{
				BatchedModelEntry entry;
				entry.materialReleaseSlot.Connect(material->OnMaterialRelease, this, &DeferredRenderQueue::OnMaterialInvalidation);

				materialIt = materialMap.insert(MeshMaterialBatches::value_type(material, std::move(entry))).first;
			}

			BatchedModelEntry& entry = materialIt->second;
			entry.enabled = true;

			MeshInstanceContainer& meshMap = entry.meshMap;

			auto it2 = meshMap.find(meshData);
			if (it2 == meshMap.end())
			{
				MeshInstanceEntry instanceEntry;
				if (meshData.indexBuffer)
					instanceEntry.indexBufferReleaseSlot.Connect(meshData.indexBuffer->OnIndexBufferRelease, this, &DeferredRenderQueue::OnIndexBufferInvalidation);

				instanceEntry.vertexBufferReleaseSlot.Connect(meshData.vertexBuffer->OnVertexBufferRelease, this, &DeferredRenderQueue::OnVertexBufferInvalidation);

				it2 = meshMap.insert(std::make_pair(meshData, std::move(instanceEntry))).first;
			}

			std::vector<Matrix4f>& instances = it2->second.instances;
			instances.push_back(transformMatrix);

			materialEntry.maxInstanceCount = std::max(materialEntry.maxInstanceCount, instances.size());
		}
	}
開發者ID:Ardakaniz,項目名稱:NazaraEngine,代碼行數:54,代碼來源:DeferredRenderQueue.cpp

示例8: main

int main()
{
	
	FILE* fp = nullptr;
	fopen_s(&fp, "import.psd", "rb");

	if (fp == nullptr) return 0;

	std::vector<uint8_t> data;
	fseek(fp, 0, SEEK_END);
	auto length = ftell(fp);
	fseek(fp, 0, SEEK_SET);

	data.resize(length);
	fread(data.data(), 1, length, fp);
	fclose(fp);

	auto doc = PSDParser::Document::Create(data.data(), data.size());

	for (auto i = 0; i < doc->GetLayerCount(); i++)
	{
		auto layer = doc->GetLayer(i);

		auto name = layer->GetName();
		auto rect = layer->GetRect();
		
		std::vector<uint8_t> bmp;
		auto height = rect.Bottom - rect.Top;
		auto width = rect.Right - rect.Left;
		bmp.resize(width * height * 4);

		for (int32_t y = 0; y < height; y++)
		{
			for (int32_t x = 0; x < width; x++)
			{
				auto p = (uint8_t*) layer->GetData();

				bmp[(x + y * width) * 4 + 0] = p[x * 4 + width * y + 0];
				bmp[(x + y * width) * 4 + 1] = p[x * 4 + width * y + 1];
				bmp[(x + y * width) * 4 + 2] = p[x * 4 + width * y + 2];
				bmp[(x + y * width) * 4 + 3] = p[x * 4 + width * y + 3];

			}
		}

		

		BitmapWriter::Write("test.bmp", (uint32_t*)(bmp.data()), width, height);

		//break;
	}

	return 0;
}
開發者ID:altseed,項目名稱:Altseed,代碼行數:54,代碼來源:main.cpp

示例9: RenderModAPIText

void CModAPI_Component_Items::RenderModAPIText(const CNetObj_ModAPI_Text *pPrev, const CNetObj_ModAPI_Text *pCurrent)
{
    if(pCurrent->m_ItemLayer != GetLayer()) return;
    if(!TextRender()) return;

    vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());

    char aText[64];
    IntsToStr(pCurrent->m_aText, 16, &aText[0]);

    ModAPIGraphics()->DrawText(TextRender(), aText, Pos, ModAPI_IntToColor(pCurrent->m_Color), pCurrent->m_Size, pCurrent->m_Alignment);
}
開發者ID:teeworlds-modapi,項目名稱:mod-target,代碼行數:12,代碼來源:items.cpp

示例10: GetLayer

Matrix4x4
HostLayer::GetShadowTransform() {
  Matrix4x4 transform = mShadowTransform;
  Layer* layer = GetLayer();

  transform.PostScale(layer->GetPostXScale(), layer->GetPostYScale(), 1.0f);
  if (const ContainerLayer* c = layer->AsContainerLayer()) {
    transform.PreScale(c->GetPreXScale(), c->GetPreYScale(), 1.0f);
  }

  return transform;
}
開發者ID:ollie314,項目名稱:gecko-dev,代碼行數:12,代碼來源:LayerManagerComposite.cpp

示例11: CheckEventTriggerTouch

bool Game_Event::CheckEventTriggerTouch(int x, int y) {
	if (Game_Map::GetInterpreter().IsRunning())
		return false;

	if (trigger == RPG::EventPage::Trigger_collision && !IsJumping()) {
		if (Main_Data::game_player->IsInPosition(GetX(), GetY()) && GetLayer() == RPG::EventPage::Layers_same) {
			return false;
		}

		if (Main_Data::game_player->IsInPosition(x, y) && !Main_Data::game_player->IsBlockedByMoveRoute()) {
			if (Main_Data::game_player->InAirship() && GetLayer() == RPG::EventPage::Layers_same) {
				return false;
			}

			Start();
			return true;
		}
	}

	return false;
}
開發者ID:Zegeri,項目名稱:Player,代碼行數:21,代碼來源:game_event.cpp

示例12: NEGATE

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() ) );
}
開發者ID:p12tic,項目名稱:kicad-source-mirror,代碼行數:12,代碼來源:class_drawsegment.cpp

示例13: RenderText

void CComponent_Items::RenderText(const CNetObj_TU_Text *pPrev, const CNetObj_TU_Text *pCurrent)
{
	if(pCurrent->m_ItemLayer != GetLayer()) return;
	if(!TextRender()) return;

	vec2 Pos = mix(vec2(pPrev->m_X, pPrev->m_Y), vec2(pCurrent->m_X, pCurrent->m_Y), Client()->IntraGameTick());
	
	char aText[64];
	IntsToStr(pCurrent->m_aText, 16, &aText[0]);
	
	TUKernel()->AssetsRenderer()->DrawText(aText, Pos, tu::IntToColor(pCurrent->m_Color), pCurrent->m_Size, pCurrent->m_Alignment);
}
開發者ID:teeworlds-modapi,項目名稱:teeworlds,代碼行數:12,代碼來源:items.cpp

示例14: GetLayer

  //
  // Export
  //
  // Export this footprint to the given file name
  //
  Bool Type::Export(const char *fileName)
  {
    PTree tree;
    FScope *root, *cellInfo;
  
    // Add the top level scope
    root = tree.GetGlobalScope()->AddFunction("ConfigureFootPrint");

    // Get the layer used for zipping
    Layer &layer = GetLayer(LAYER_LOWER);

    // Save out the grid
    for (S32 z = 0; z <= size.z; z++)
    {
      for (S32 x = 0; x <= size.x; x++)
      {
        // Write out cell info
        cellInfo = root->AddFunction("SetupCell");
        cellInfo->AddArgInteger(x);
        cellInfo->AddArgInteger(z);

        // Is this cell on the footprint
        if (x < size.x && z < size.z)
        {
          Cell &cell = GetCell(x, z);
          StdSave::TypeU32(cellInfo, "Hide", cell.GetFlag(HIDE));
          StdSave::TypeU32(cellInfo, "SetBase", cell.GetFlag(SETBASE));
          StdSave::TypeU32(cellInfo, "Second", cell.GetFlag(SECOND));
          StdSave::TypeU32(cellInfo, "Dirs", cell.dirs);
          StdSave::TypeU32(cellInfo, "ClaimLo", cell.GetFlag(CLAIMLO));
          StdSave::TypeU32(cellInfo, "ClaimHi", cell.GetFlag(CLAIMHI));
          StdSave::TypeU32(cellInfo, "BlockLOS", cell.GetFlag(BLOCKLOS));

          if (cell.GetFlag(SURFACE))
          {
            MoveTable::KeyInfo *info = MoveTable::FindSurfaceInfo(cell.surface);

            if (info)
            {
              StdSave::TypeString(cellInfo, "Surface", info->ident.str);
            }
          }
        }

        Layer::Cell &cell = layer.GetCell(x, z);
        StdSave::TypeU32(cellInfo, "Zip", cell.GetFlag(Layer::ZIP));
      }
    }
  
    // Save out to disk
    return (tree.WriteTreeText(fileName));
  }
開發者ID:ZhouWeikuan,項目名稱:darkreign2,代碼行數:57,代碼來源:footprint_type.cpp

示例15: PlotOneBoardLayer

bool PLOT_CONTROLLER::PlotLayer()
{
    LOCALE_IO toggle;

    // No plot open, nothing to do...
    if( !m_plotter )
        return false;

    // Fully delegated to the parent
    PlotOneBoardLayer( m_board, m_plotter, ToLAYER_ID( GetLayer() ), GetPlotOptions() );

    return true;
}
開發者ID:AlexanderBrevig,項目名稱:kicad-source-mirror,代碼行數:13,代碼來源:pcbplot.cpp


注:本文中的GetLayer函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。