//////////////////////////////////////////////////////////////////////////////
//
// Asura_PS2_CharDefines.h
//
// By: Morgan Parry.
//
// Copyright (c) 2002 Rebellion. All rights reserved.
//
// Various DEFINES for character animation and rendering parameters. This
// file is only intended to hold DEFINES so that it can be used directly by
// the PC tools.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef ___ASURA_PS2_CHARDEFINES_H___
#define ___ASURA_PS2_CHARDEFINES_H___ 1

// M A C R O S ///////////////////////////////////////////////////////////////

#define ASURA_PS2_MAX_BONES_PER_MODEL						(60)

// (MP - 17.04.2002) Note that many pieces of code assume this is 4 so that
// various bits of data fit neatly into a QW. Decreasing it would be quite
// simple but increasing it would be significantly more work.
#define ASURA_PS2_MAX_BONES_PER_MODEL_VERTEX				(4)

// (PSJE - 20.11.2002) The following defines are for the VU1 Skinned characters
// See VU1_Skinning.vcl and VU1_Skinning_Dredd.vcl for details of the values
#define ASURA_PS2_SKINNING__QWS_PER_INPUT_VERTEX			(5)
#define ASURA_PS2_SKINNING__QWS_PER_OUTPUT_VERTEX			(3)
#define ASURA_PS2_SKINNING__QWS_PER_VERTEX					(ASURA_PS2_SKINNING__QWS_PER_INPUT_VERTEX+ASURA_PS2_SKINNING__QWS_PER_OUTPUT_VERTEX)
#define ASURA_PS2_SKINNING__QWS_PASS1_SETUP					(6)
#define ASURA_PS2_SKINNING__QWS_PASS2_SETUP					(4)
#define ASURA_PS2_SKINNING__QWS_SHADOW_SETUP				(3)
#define ASURA_PS2_SKINNING__QWS_TOTAL_SETUP					(ASURA_PS2_SKINNING__QWS_PASS1_SETUP+ASURA_PS2_SKINNING__QWS_PASS2_SETUP+ASURA_PS2_SKINNING__QWS_SHADOW_SETUP)
#define ASURA_PS2_SKINNING__QWS_CONSTANTS					(14)
#define ASURA_PS2_SKINNING__QWS_CONSTANTS_GRAPHICS_NOVEL	(21)
#define ASURA_PS2_SKINNING__QWS_FOR_OUTPUT_GIFTAGS			(2)
#define ASURA_PS2_SKINNING__MAX_BONES						(63)
// Bone limit due to packing (bone indicies*4) into a byte

// The maximum number of vertices per strip for smooth skins depends on the bone count for the skin
#define ASURA_PS2_MAX_VERTICES_PER_SMOOTH_SKIN_STRIP( uBoneQty )	( (1024 - ( ASURA_PS2_SKINNING__QWS_TOTAL_SETUP + ASURA_PS2_SKINNING__QWS_FOR_OUTPUT_GIFTAGS + (((uBoneQty<<2)<ASURA_PS2_SKINNING__QWS_CONSTANTS_GRAPHICS_NOVEL)?ASURA_PS2_SKINNING__QWS_CONSTANTS_GRAPHICS_NOVEL:(uBoneQty<<2))) ) / (ASURA_PS2_SKINNING__QWS_PER_VERTEX<<1) )

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef ___ASURA_PS2_CHARDEFINES_H___
