gfxinit.c 1.16 KB
/*============================================================================
  NuSYSTEM サンプルプログラム「SNAKE TAIL HACK」
  
  gfxinit.c
  
  Copyright (C) 1997, NINTENDO Co,Ltd.
  ============================================================================*/

#include <ultra64.h>
#include "graphic.h"

/* ビューポート構造体 */
static Vp vp = {
    SCREEN_WD*2, SCREEN_HT*2, G_MAXZ/2, 0, /* scale */
    SCREEN_WD*2, SCREEN_HT*2, G_MAXZ/2, 0, /* translate */
};

Lights1 sun_light = gdSPDefLights1(  80,  80,  80, /* no ambient light */
				   200, 200, 200, /* white light */
				   0,   -1,   1);

/* RDPの設定 */
Gfx setup_rdpstate[] = {
    gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
    gsDPSetColorDither(G_CD_BAYER),
    gsDPSetFogColor(255, 0, 0, 255),
    gsDPSetScissor(G_SC_NON_INTERLACE, 0,0, 319,239),
    gsDPPipeSync(),
    gsSPEndDisplayList(),
};

/* RSPの設定 */
Gfx setup_rspstate[] = {
    gsSPViewport(&vp),
    gsSPClearGeometryMode((G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH | 
			   G_CULL_BOTH | G_FOG | G_LIGHTING)),
    gsSPTexture(0, 0, 0, 0, G_OFF),
    gsSPSetLights1(sun_light),
    gsSPFogPosition(996, 1000),
    gsSPEndDisplayList(),
};