/*---------------------------------------------------------------------------* Project: NintendoWare File: dev_Utility.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: 22599 $ *---------------------------------------------------------------------------*/ #include #if defined(NW_DEV_ENABLED) #include #if defined(NW_PLATFORM_CTR) #include #else #include #endif //-------------------------------------------------------------------------- void NW_DEV_LOG( const char* fmt, ... ) { const int BUFFER_SIZE = 260; char buffer[ BUFFER_SIZE ]; std::va_list vargs; va_start(vargs, fmt); int len = nw::ut::vsnprintf(buffer, BUFFER_SIZE, BUFFER_SIZE - 1, fmt, vargs); va_end(vargs); #if defined(NW_PLATFORM_CTR) nn::svc::OutputDebugString( buffer, len ); #else OutputDebugStringA( buffer ); #endif } namespace nw { namespace dev { //-------------------------------------------------------------------------- int FormatToByte(GLint format) { int byte = 0; switch (format) { case GL_RGBA8_OES: { byte = 4; } break; case GL_RGB8_OES: { byte = 3; } break; case GL_RGBA4: { byte = 2; } break; case GL_RGB5_A1: { byte = 2; } break; case GL_RGB565: { byte = 2; } break; default: { NW_ASSERTMSG(false, "Invalid Color Format."); } break; } return byte; } //-------------------------------------------------------------------------- int CalcMemorySize(GLint format, int width, int height) { int pixelSize = FormatToByte(format); return width * height * pixelSize; } } // namespace nw::dev } // namespace nw #endif