/*---------------------------------------------------------------------------* Copyright (C) 2010-2012 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. *---------------------------------------------------------------------------*/ #ifndef __DEMOWIN_HELPERS_H_ #define __DEMOWIN_HELPERS_H_ // Returns darker or lighter with a higher status (opposite brightness if status == -1) CVec4 WhiteDarker(int status); CVec4 BlackLighter(int status); // Literally does nothing void DoNothing(); void DoNothingVoidP(void*); // Does nothing, returns true bool BoolDoNothing(); bool BoolDoNothingVoidP(void*); // Returns if the values are close bool CloseEnough(float a, float b); // Takes the core as 0, 1, or 2 and turns it into the value the system wants (1, 2, 4) int GetCore(int core); // A "safe" version of strcat char* strcat_s(char* dest, int len, const char* src); // A "safe" version of strcpy char* strcpy_s(char* dest, int len, const char* src); // A "safe" version of sprintf int sprintf_s(char* dest, int len, const char* src, ...); // A "safe" version of vsprintf int vsprintf_s(char* dest, int len, const char* src, va_list list); // A "safe" version of strcat template char* strcat_s(char (&dest)[len], const char* src) { return strcat_s(dest, len, src); } // A "safe" version of strcpy template char* strcpy_s(char (&dest)[len], const char* src) { return strcpy_s(dest, len, src); } // A "safe" version of sprintf template int sprintf_s(char (&dest)[len], const char* src, ...) { dest[len - 1] = 0; va_list args; va_start (args, src); int count = vsprintf(dest, src, args); va_end (args); ASSERT(dest[len - 1] == 0); return count; } // A "safe" version of vsprintf template int vsprintf_s(char (&dest)[len], const char* src, va_list list) { dest[len - 1] = 0; int count = vsprintf(dest, src, list); ASSERT(dest[len - 1] == 0); return count; } #endif