view light.cc @ 100:e5f2eb98b575

change cc
author e085768
date Thu, 02 Jun 2011 18:19:07 +0900
parents c534f339ee8b
children 6ef3b0efdeaf
line wrap: on
line source

/* light.c */

#include <stdio.h>
#include "libps2.h"
#include "light.h"

#include "sjoy.h" // ps2関連ファイルから

FMATRIX normal_light;
FMATRIX light_color;


void init_light(LIGHT *l)
{
  //Three lights in all.
  //   The color of the light of "light0" is color0.
  //   The color of the light of "light1" is color1.
  //   The color of the light of "light2" is color2.
  

  l->light0[0] = 0.0;
  l->light0[1] = 0.0;
  l->light0[2] = 1.0;
  l->light0[3] = 1.0;

  l->light1[0] = 0.0;
  l->light1[1] = -1.0;
  l->light1[2] = 0.0;
  l->light1[3] = 1.0;

  l->light2[0] = 1.0;
  l->light2[1] = 1.0;
  l->light2[2] = 1.0;
  l->light2[3] = 1.0;

  l->color0[0] = 0.4;
  l->color0[1] = 0.4;
  l->color0[2] = 0.4;
  l->color0[3] = 1.0;

  l->color1[0] = 0.4;
  l->color1[1] = 0.4;
  l->color1[2] = 0.4;
  l->color1[3] = 1.0;

  l->color2[0] = 0.4;
  l->color2[1] = 0.4;
  l->color2[2] = 0.4;
  l->color2[3] = 1.0;

//Reflection degree of light
  l->ambient[0] = 0.4;
  l->ambient[1] = 0.4;
  l->ambient[2] = 0.4;
  l->ambient[3] = 1.0;

}

// 自作:miya
void ps2_vu0_normal_light_matrix(FMATRIX light_color, FVECTOR l0, FVECTOR l1, FVECTOR l2)
{
  printf("test\n");
}

// 自作:miya
void ps2_vu0_light_color_matrix( FMATRIX light_color, FVECTOR c0, FVECTOR c1, FVECTOR c2, FVECTOR a)
{
  printf("test\n");
}

void set_light(LIGHT *l)
{
  ps2_vu0_normal_light_matrix(normal_light, l->light0, l->light1, l->light2);
  ps2_vu0_light_color_matrix(light_color, l->color0, l->color1, l->color2, l->ambient);
}