gfxinit.c
1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*============================================================================
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(),
};