void CGraphicsState::SetDefaults(int iNumTextureLayers, D3DTEXTUREFILTERTYPE iFilter)
{
	SetNumTextures(iNumTextureLayers);
	SetNumSamplers(iNumTextureLayers);

	SetDefaultTextureArgs();
	SetDefaultSamplerStates(iFilter);
}
void CGraphicsState::SetZeroTextureDefault(void)
{
	SetNumTextures(0);
	SetNumSamplers(0);
}
예제 #3
0
BOOL CGrdLandIO::Read(FILE *Stream)
{
    CHECKTRUE(StartChunk(Stream,"GrdLand"));
    fpos_t Pos;
    int PosOk;
    PosOk = fgetpos(Stream, &Pos );
    if(!ReadLong(Stream,"Version",(LONG*)&Version)) {
        PosOk = fsetpos(Stream, &Pos );
        DebugPrint("No Version Number\n");
        Version = 0;
    }
    m_Version = Version;
    CHECKTRUE(ReadFloat(Stream,"3DPosition",&m_CameraXPos));
    CHECKTRUE(ReadFloat(Stream,NULL,&m_CameraYPos));
    CHECKTRUE(ReadFloat(Stream,NULL,&m_CameraZPos));
    CHECKTRUE(ReadFloat(Stream,"3DRotation",&m_CameraXRot));
    CHECKTRUE(ReadFloat(Stream,NULL,&m_CameraYRot));
    CHECKTRUE(ReadFloat(Stream,NULL,&m_CameraZRot));
    CHECKTRUE(ReadLong(Stream,"2DPosition",(LONG*)&m_ScrollX));
    CHECKTRUE(ReadLong(Stream,NULL,(LONG*)&m_ScrollY));
    if(Version >= 1) {
        CHECKTRUE(ReadLong(Stream,"CustomSnap",(LONG*)&m_SnapX));
        CHECKTRUE(ReadLong(Stream,NULL,(LONG*)&m_SnapZ));
        CHECKTRUE(ReadLong(Stream,"SnapMode",(LONG*)&m_SnapMode));
        CHECKTRUE(ReadLong(Stream,"Gravity",(LONG*)&m_EnableGravity));
    } else {
        m_SnapMode = 0;
        m_SnapX = 256;
        m_SnapZ = 256;
        m_EnableGravity = 1;
    }
    CHECKTRUE(ReadLong(Stream,"HeightScale",(LONG*)&m_HeightScale));
    CHECKTRUE(ReadLong(Stream,"MapWidth",(LONG*)&m_MapWidth));
    CHECKTRUE(ReadLong(Stream,"MapHeight",(LONG*)&m_MapHeight));
    CHECKTRUE(ReadLong(Stream,"TileWidth",(LONG*)&m_TileWidth));
    CHECKTRUE(ReadLong(Stream,"TileHeight",(LONG*)&m_TileHeight));
    if(Version >= 3) {
        CHECKTRUE(ReadLong(Stream,"SeaLevel",(LONG*)&m_SeaLevel));
    } else {
        m_SeaLevel = 100;
    }
    CHECKTRUE(ReadLong(Stream,"TextureWidth",(LONG*)&m_TextureWidth));
    CHECKTRUE(ReadLong(Stream,"TextureHeight",(LONG*)&m_TextureHeight));

    DWORD NumTextures;
    DWORD i;

    CHECKTRUE(ReadLong(Stream,"NumTextures",(LONG*)&NumTextures));
    SetNumTextures(NumTextures);

    CHECKTRUE(StartChunk(Stream,"Textures"));
    for(i=0; i<NumTextures; i++) {
        CHECKTRUE(ReadStringAlloc(Stream,NULL,&m_TextureNames[i]));
    }
    CHECKTRUE(EndChunk(Stream));

    CHECKTRUE(ReadLong(Stream,"NumTiles",(LONG*)&m_NumTiles));
    m_Tiles = new CGrdTileIO*[m_NumTiles];

    CHECKTRUE(StartChunk(Stream,"Tiles"));
    for(i=0; i<m_NumTiles; i++) {
        m_Tiles[i] = new CGrdTileIO;
        m_Tiles[i]->Read(Stream);
    }
    CHECKTRUE(EndChunk(Stream));

    CHECKTRUE(EndChunk(Stream));

    return	TRUE;
}