/*--------------------------------------------------------------------------
  Project:  Manual 2D Library - m2d
  File:     texMap.h

  Copyright (C)2007-2009 Nintendo  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: 1.10 $
 *-------------------------------------------------------------------------*/

#ifndef NTMV_M2D_TEXMAP_H_
#define NTMV_M2D_TEXMAP_H_

#if defined(__CWCC__)
#pragma once
#endif

// #define NTMV_M2D_USE_DIRECTTEXTURE

#include <nitro/types.h>
#if defined(NTMV_M2D_USE_DIRECTTEXTURE)
#include <ntmv/m2d/directTexture.h>
#else   // #if defined(NTMV_M2D_USE_DIRECTTEXTURE)
#include <ntmv/m2d/texture.h>
#endif  // #if defined(NTMV_M2D_USE_DIRECTTEXTURE)

namespace ntmv
{
namespace m2d
{

/*
    Texture mapping class
*/
class TexMap
{
#if defined(NTMV_M2D_USE_DIRECTTEXTURE)
public:
                        TexMap()
                        :   mpDirectImg(0)
                        {
                        }

    void                Set(DirectTexture* pDirectImg)        { mpDirectImg = pDirectImg; }

    DirectTexture*      GetImage() const            { return mpDirectImg; }
    const Size          GetSize() const             { return mpDirectImg->GetSize(); }

private:
    DirectTexture*      mpDirectImg;
#else   // #if defined(NTMV_M2D_USE_DIRECTTEXTURE)
public:
                        TexMap()
                        :   mpTexture(0)
                        {}

    void                Set(Texture* pTexture)      { mpTexture = pTexture; }

    Texture*            GetTexture() const          { return mpTexture; }
    const Size          GetSize() const             { return mpTexture->GetSize(); }

private:
    Texture*            mpTexture;
#endif  // #if defined(NTMV_M2D_USE_DIRECTTEXTURE)
};

}   // namespace m2d
}   // namespace ntmv

/* NTMV_M2D_TEXMAP_H_ */
#endif
