📄 gamelayoutersinktexture.cpp
字号:
// ***************************************************************
// GameLayouterSinkTexture version: 1.0
// -------------------------------------------------------------
// File Name: GameLayouterSinkTexture.cpp
// Created: 2007/07/18
// Modified: 2007/07/18 17:53
// Author: William.Liang
// Msn: lwq49@msn.com
// Email: lwq49@21cn.com, lwq49@msn.com
// Description:
//
// Purpose:
// -------------------------------------------------------------
// license:
//
// The contents of this file are subject to the Mozilla Public
// License Version 1.1 (the "License"); you may not use this file
// except in compliance with the License. You may obtain a copy
// of the License at http://www.mozilla.org/MPL/ Software dis-
// tributed under the License is distributed on an "AS IS"
// basis, WITHOUT WARRANTY OF ANY KIND, either express or im-
// plied. See the License for the specific language governing
// rights and limitations under the License.
//
// The Initial Developer of the Original Code is William.Liang .
// Copyright (C) 2007 - All Rights Reserved.
// ***************************************************************
#include "StdAfx.h"
#include ".\GameLayouterSinkTexture.h"
#include ".\ResourceLib.h"
//************************************
// <p>Description: 构造函数</p>
//************************************
CGameLayouterSinkTexture::CGameLayouterSinkTexture(void)
{
}
//************************************
// <p>Description: 析构函数</p>
//************************************
CGameLayouterSinkTexture::~CGameLayouterSinkTexture(void)
{
}
//************************************
// <p>Description: 回调处理方法</p>
// <p>Parameters: </p>
// <p> _CString szNodeName</p>
// <p> _CString szParentName</p>
// <p> LPVOID lpParam</p>
//
// <p>Returns: void</p>
//************************************
void CGameLayouterSinkTexture::Processer(_CString szNodeName, _CString szParentName, LPVOID lpParam){
_CStringList* pList = NULL;
if(szNodeName == "Packet"){
//检查上层的结构格式
if(m_pIGameLayouter->ValidNodePath("Resources.Packets")){
//加载资源包
pList = ((_CStringList*)lpParam);
_CString szFileName = pList->GetBy("FileName");
if(!(szFileName.IsNull() || szFileName==""))
m_lpFMHandles->pResourceLib->LoadTexture(szFileName);
goto Push_Node_Stack;
}
}
if(szNodeName == "Texture"){
//检查上层的结构格式
if(m_pIGameLayouter->ValidNodePath("Resources.Textures")){
//加载资源
pList = ((_CStringList*)lpParam);
_CString szFileName = pList->GetBy("FileName");
_CString szKey = pList->GetBy("Name");
if(szKey.IsNull() || szKey=="") szKey = szFileName;
_CString szType = pList->GetBy("Type");
enResourceType ResourceType = Resource_Picture;
if(szType=="Effect"){
ResourceType = Resource_Effect;
}
else{
if(szType=="Music"){
ResourceType = Resource_Music;
}
else{
if(szType=="Stream"){
ResourceType = Resource_Stream;
}
}
}
m_lpFMHandles->pResourceLib->Add(szFileName, szKey, ResourceType);
goto Push_Node_Stack;
}
}
Push_Node_Stack:
return;
}
//************************************
// <p>Description: 设置上级接口</p>
// <p>Parameters: </p>
// <p> IGameLayouter * pIGameLayouter</p>
// <p> LPFRAMEMANAGERHANDLE pFMHandles</p>
//
// <p>Returns: void</p>
//************************************
void CGameLayouterSinkTexture::SetGameLayouter(IGameLayouter* pIGameLayouter, LPFRAMEMANAGERHANDLE pFMHandles){
m_pIGameLayouter = pIGameLayouter;
m_lpFMHandles = pFMHandles;
}
//************************************
// <p>Description: 接口查询</p>
// <p>Parameters: </p>
// <p> const IID & Guid</p>
// <p> DWORD dwQueryVer</p>
//
// <p>Returns: void *</p>
//************************************
void * CGameLayouterSinkTexture::QueryInterface(const IID & Guid, DWORD dwQueryVer){
QUERYINTERFACE(IGameLayouterSink,Guid,dwQueryVer);
QUERYINTERFACE_IUNKNOWNEX(IGameLayouterSink,Guid,dwQueryVer);
return NULL;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -