/*---------------------------------------------------------------------------* Project: NintendoWare File: gfx_AnimHelper.cpp Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. $Revision: 19657 $ *---------------------------------------------------------------------------*/ #include "precompiled.h" #include #include namespace nw { namespace gfx { //----------------------------------------------------------------------------- void* GetBaseObject(nw::gfx::ResMaterial resMat, const char* name) { // TODO: 仮実装。辞書を使用した処理の最適化が必要。 if (std::strcmp(name, "MaterialColor") == 0) { return resMat.GetMaterialColor().ptr(); } else if (std::strcmp(name, "TextureCoordinators[0]") == 0) { return resMat.GetTextureCoordinators(0).ptr(); } else if (std::strcmp(name, "TextureCoordinators[1]") == 0) { return resMat.GetTextureCoordinators(1).ptr(); } else if (std::strcmp(name, "TextureCoordinators[2]") == 0) { return resMat.GetTextureCoordinators(2).ptr(); } else if (std::strcmp(name, "TextureMappers[0]") == 0) { return resMat.GetTextureMappers(0).ptr(); } else if (std::strcmp(name, "TextureMappers[1]") == 0) { return resMat.GetTextureMappers(1).ptr(); } else if (std::strcmp(name, "TextureMappers[2]") == 0) { return resMat.GetTextureMappers(2).ptr(); } else if (std::strcmp(name, "TextureMappers[0].Sampler") == 0) { return reinterpret_cast(resMat.GetTextureMappers(0).ref().toSampler.to_ptr()); } else if (std::strcmp(name, "TextureMappers[1].Sampler") == 0) { return reinterpret_cast(resMat.GetTextureMappers(1).ref().toSampler.to_ptr()); } else if (std::strcmp(name, "TextureMappers[2].Sampler") == 0) { return reinterpret_cast(resMat.GetTextureMappers(2).ref().toSampler.to_ptr()); } else if (std::strcmp(name, "FragmentOperation.BlendOperation") == 0) { return resMat.GetFragmentOperation().GetBlendOperation().ptr(); } else { NW_ASSERT(false); return NULL; } } } // namespace gfx } // namespace nw