示例#1
0
void screen_level_screen_update(int *screen_type, int curr_joypad1, int prev_joypad1)
{
	rand();
	engine_tile_manager_update_middle();
	if (0 == curr_joypad1)
	{
		return;
	}

	// Select level and return.
	if (curr_joypad1 & JOY_FIREA && !(prev_joypad1 & JOY_FIREA) || curr_joypad1 & JOY_FIREB && !(prev_joypad1 & JOY_FIREB))
	{
		*screen_type = 4;//screen_type_ready;
		return;
	}

	if (curr_joypad1 & JOY_LEFT && !(prev_joypad1 & JOY_LEFT))
	{
		hacker_level = !hacker_level;
	}
	else if (curr_joypad1 & JOY_RIGHT && !(prev_joypad1 & JOY_RIGHT))
	{
		hacker_level = !hacker_level;
	}
	else if (curr_joypad1 & JOY_UP && !(prev_joypad1 & JOY_UP))
	{
		hacker_level = !hacker_level;
	}
	else if (curr_joypad1 & JOY_DOWN && !(prev_joypad1 & JOY_DOWN))
	{
		hacker_level = !hacker_level;
	}

	display_arrow();
}
/* openGL display function */
void display()
{
  GLfloat light_position[] = {0.0,0.0,0.0,0.0};
  light_position[0] = light1_x;
  light_position[1] = light1_y;
  light_position[2] = light1_z;

  /* the shadow matrix */
  M[0]= 1; M[4]= 0; M[8] =(-1*(light1_x)/light1_z); M[12]= 0;
  M[1]= 0; M[5]= 1; M[9] =(-1*(light1_y)/light1_z); M[13]= 0;
  M[2]= 0; M[6]= 0; M[10]= 0;                       M[14]= 0;
  M[3]= 0; M[7]= 0; M[11]= 0;                       M[15]= 1;

  /* specular highlights have color 'mat_specular'*/
  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);
  /* shininess ('N') = mat_shininess*/
  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);

  /* replaces the matrix in the top of the stack with the identity matrix */
  glLoadIdentity(); 

  /* If the window is the main one, we want the 2D view, otherwise we want
     the position alterable 3D view */
  if(glutGetWindow() == window_main)
    gluLookAt(set_eye_x,set_eye_y,set_eye_z, 0,0,0, 0,0,1); 
  else{
    gluLookAt(18,4,10, 0,0,0, 0,0,1); 
    
    glRotatef(sphi, 0, 0, 1);
    glRotatef(stheta, 1, 0, 0);
  }
    
  /* move light0 to 'light_position' */
  glLightfv(GL_LIGHT0, GL_POSITION, light_position); 

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  
  /* initialize the quadric object */
  quadObj = gluNewQuadric();

  /* Draws the TRING Board */
  drawBoard();

  /* Displays the cue arrow */
  if(no_motion)
    display_arrow();

  /* specular highlights have color 'mat_specular'*/
  glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, mat_specular);

  /* shininess ('N') = mat_shininess*/
  glMaterialfv(GL_FRONT_AND_BACK, GL_SHININESS, mat_shininess);

  /* Display the balls */
  drawPoolBalls();

  glutSwapBuffers();    
  glFlush();
}
示例#3
0
void screen_level_screen_load()
{
	engine_tile_manager_draw();
	engine_font_manager_draw_text(LOCALE_TITLE, GLOBAL_LFT_SIDE, GLOBAL_TOP_LINE);
	engine_font_manager_draw_text(LOCALE_LEVEL, GLOBAL_LFT_SIDE, GLOBAL_MID_LINE);

	engine_font_manager_draw_text(LOCALE_LEVEL1, GLOBAL_TXT_START, GLOBAL_TXT_LINE2);
	engine_font_manager_draw_text(LOCALE_LEVEL2, GLOBAL_TXT_START, GLOBAL_TXT_LINE3);
	display_arrow();
}