Пример #1
0
void CHelp::Loop(double timestep) {
	Music.Update ();
	check_gl_error();
    ClearRenderContext ();
	ScopedRenderMode rm(GUI);
    SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow (timestep);
		draw_ui_snow();
    }

	FT.AutoSizeN (4);
	FT.SetColor (colWhite);
	FT.DrawString (xleft1, AutoYPosN (5), Trans.Text (57));

	FT.AutoSizeN (3);
	int offs = FT.AutoDistanceN (2);
	FT.DrawString (xleft1, ytop, Trans.Text(44));
	FT.DrawString (xleft1, ytop + offs, Trans.Text(45));
	FT.DrawString (xleft1, ytop + offs * 2, Trans.Text(46));
	FT.DrawString (xleft1, ytop + offs * 3, Trans.Text(47));
	FT.DrawString (xleft1, ytop + offs * 4, Trans.Text(48));
	FT.DrawString (xleft1, ytop + offs * 5, Trans.Text(49));
	FT.DrawString (xleft1, ytop + offs * 6, Trans.Text(50));
	FT.DrawString (xleft1, ytop + offs * 7, Trans.Text(51));
	FT.DrawString (xleft1, ytop + offs * 8,Trans.Text(52));
	FT.DrawString (xleft1, ytop + offs * 9, Trans.Text(53));
	FT.DrawString (xleft1, ytop + offs * 10, Trans.Text(54));
	FT.DrawString (xleft1, ytop + offs * 11, Trans.Text(55));
	FT.DrawString (xleft1, ytop + offs * 12, Trans.Text(56));

	FT.DrawString (CENTER, AutoYPosN (90), Trans.Text(65));
    Winsys.SwapBuffers();
}
Пример #2
0
static void credits_loop( scalar_t time_step )
{
    int width, height;
    width = getparam_x_resolution();
    height = getparam_y_resolution();
    
    check_gl_error();
    
    update_audio();
    
    clear_rendering_context();
    
    set_gl_options( GUI );
    
    ui_setup_display();
    
    draw_credits_text( time_step );
    
    if (getparam_ui_snow()) {
        update_ui_snow( time_step, False );
        draw_ui_snow();
    }
    
    ui_draw_menu_decorations();
    
    ui_draw();
    
    reshape( width, height );
    
    winsys_swap_buffers();
} 
Пример #3
0
static void preference_loop( scalar_t time_step )
{
    check_gl_error();
    
    update_audio();
    
    set_gl_options( GUI );
    
    clear_rendering_context();
    
    ui_setup_display();
    
    if (getparam_ui_snow()) {
        update_ui_snow( time_step, False );
        draw_ui_snow();
    }
    
    ui_draw_menu_decorations();
    
    draw_preference();
    
    ui_draw();
    
    reshape( getparam_x_resolution(), getparam_y_resolution() );
    
    winsys_swap_buffers();
}
Пример #4
0
void CLoading::Loop(float time_step) {
	ScopedRenderMode rm(GUI);
	Winsys.clear();

	if (param.ui_snow) {
		update_ui_snow(time_step);
		draw_ui_snow();
	}

	sf::Sprite logo(Tex.GetSFTexture(TEXLOGO));
	logo.setScale(0.35f, 0.35f);
	logo.setPosition((Winsys.resolution.width - logo.getTextureRect().width*0.35f) / 2, 40);
	Winsys.draw(logo);
	DrawGUIFrame();

	FT.SetColor(colDYell);
	FT.AutoSizeN(5);
	FT.DrawString(CENTER, AutoYPosN(60), Trans.Text(29) + " '" + g_game.course->name + '\'');
	FT.SetColor(colWhite);
	FT.DrawString(CENTER, AutoYPosN(70), Trans.Text(30));
	Winsys.SwapBuffers();

	Course.LoadCourse(g_game.course);
	g_game.location_id = Course.GetEnv();
	Env.LoadEnvironment(g_game.location_id, g_game.light_id);
	State::manager.RequestEnterState(Intro);
}
Пример #5
0
static void GameSelectLoop (double time_step) {
	int ww = param.x_resolution;
	int hh = param.y_resolution;

	check_gl_error();
	Music.Update ();    
    set_gl_options (GUI);
    ClearRenderContext ();
    SetupGuiDisplay ();
    
	if (param.ui_snow) {
		update_ui_snow (time_step);
		draw_ui_snow();
    }

	Tex.Draw (T_TITLE, CENTER, AutoYPosN (5), param.scale);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

	PrintTextButton (0, scope);
	PrintTextButton (1, scope);
	PrintTextButton (2, scope);
	PrintTextButton (3, scope);
	PrintTextButton (4, scope);
	PrintTextButton (5, scope);
	PrintTextButton (6, scope);

	if (param.ice_cursor) DrawCursor ();
	Reshape (ww, hh);
	Winsys.SwapBuffers ();
}
Пример #6
0
void CNewPlayer::Loop(float timestep) {
	sf::Color col;

	ScopedRenderMode rm(GUI);
	Winsys.clear();

	if (param.ui_snow) {
		update_ui_snow(timestep);
		draw_ui_snow();
	}

	textfield->UpdateCursor(timestep);

	DrawGUIBackground(Winsys.scale);

	FT.SetColor(colWhite);
	FT.AutoSizeN(4);
	FT.DrawString(CENTER, AutoYPosN(30), Trans.Text(66));

	if (avatar->focussed()) col = colDYell;
	else col = colWhite;
	Players.GetAvatarTexture(avatar->GetValue())->DrawFrame(
	    prevleft, prevtop, prevwidth, prevwidth, 2, col);

	DrawGUI();
	Winsys.SwapBuffers();
}
Пример #7
0
void RegistLoop (double timestep ){
	int ww = param.x_resolution;
	int hh = param.y_resolution;
	Music.Update ();    
	check_gl_error();
    ClearRenderContext ();
    set_gl_options (GUI);
    SetupGuiDisplay ();
	TColor col;
		
	update_ui_snow (timestep);
	draw_ui_snow();

	Tex.Draw (BOTTOM_LEFT, 0, hh - 256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), scale);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top, 
//			0, colMBackgr, col, 0.2);

	FT.AutoSizeN (3);
	FT.SetColor (colWhite);
	int top = AutoYPosN (24);
	FT.DrawString (area.left, top, "Select your player name:");
	FT.DrawString (area.left + framewidth + arrowwidth, top, "Select a character:");

	FT.AutoSizeN (4);
	if (curr_focus == 0) col = colDYell; else col = colWhite;
	DrawFrameX (area.left, area.top, framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + 20, area.top, Players.GetName (curr_player));
	Tex.DrawDirectFrame (Players.GetAvatarID (curr_player), 
		area.left + 60, AutoYPosN (40), texsize, texsize, 3, colWhite);

	if (curr_focus == 1) col = colDYell; else col = colWhite;
	DrawFrameX (area.left + framewidth + arrowwidth, area.top, 
		framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + framewidth + arrowwidth + 20, 
		area.top, CharList[curr_character].name);
	Tex.DrawDirectFrame (CharList[curr_character].preview, 
		area.right - texsize - 60 - arrowwidth, 
		AutoYPosN (40), texsize, texsize, 3, colWhite);


	FT.SetColor (colWhite);
	PrintArrow (0, (curr_player > 0));	

	PrintArrow (1, (curr_player < last_player));
	PrintArrow (2, (curr_character > 0));	
	PrintArrow (3, (curr_character < last_character));

	PrintTextButton (0, curr_focus);
	PrintTextButton (1, curr_focus);

	if (param.ice_cursor) DrawCursor ();
    Winsys.SwapBuffers();
} 
Пример #8
0
void CEventSelect::Loop(float timestep) {
	ScopedRenderMode rm(GUI);
	Winsys.clear();

	if (param.ui_snow) {
		update_ui_snow(timestep);
		draw_ui_snow();
	}

	DrawGUIBackground(Winsys.scale);

	cupLocked->SetVisible(Events.IsUnlocked(event->GetValue(), cup->GetValue()) == false);

	selectedEvent->Focussed(event->focussed());
	selectedEvent->SetString(Events.EventList[event->GetValue()].name);

	selectedCup->SetActive(Events.IsUnlocked(event->GetValue(), cup->GetValue()));
	selectedCup->Focussed(cup->focussed());
	selectedCup->SetString(Events.GetCupTrivialName(event->GetValue(), cup->GetValue()));

	textbuttons[0]->SetActive(Events.IsUnlocked(event->GetValue(), cup->GetValue()));
	DrawGUI();

	Winsys.SwapBuffers();
}
Пример #9
0
void CreditsLoop (double time_step) {
	int ww = param.x_resolution;
	int hh = param.y_resolution;
	
	Music.Update ();    
	check_gl_error();
    ClearRenderContext ();
    set_gl_options (GUI);
    SetupGuiDisplay ();

//	DrawBackLogo (-1,  AutoYPos (200), 1.0);
	DrawCreditsText (time_step);
	if (param.ui_snow) {
		update_ui_snow (time_step);
		draw_ui_snow();
    }
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
 	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), param.scale);
	

	Reshape (ww, hh);
    Winsys.SwapBuffers();
}
Пример #10
0
void CCredits::Loop() {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;

	Music.Update ();
	check_gl_error();
	ClearRenderContext ();
	ScopedRenderMode rm(GUI);
	SetupGuiDisplay ();

	DrawCreditsText ();
	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow();
	}
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	//Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), Winsys.scale);


	Reshape (ww, hh);
	Winsys.SwapBuffers();
}
Пример #11
0
 /*! 
  Mode loop function
  \author  jfpatry
  \date    Created:  2000-09-24
  \date    Modified: 2000-09-24
  */
 static void race_select_loop( scalar_t time_step )
 {
     check_gl_error();
     
     update_audio();
     
     set_gl_options( GUI );
     
     clear_rendering_context();
     
     ui_setup_display();
     
     if (getparam_ui_snow()) {
         update_ui_snow( time_step, 
                        (bool_t) ( wind_ssbtn != NULL && 
                                  ssbutton_get_state( wind_ssbtn ) ) );
         draw_ui_snow();
     }
     
     ui_draw_menu_decorations();
     
     set_widget_positions_and_draw_decorations();
     
     ui_draw();
     
     reshape( getparam_x_resolution(), getparam_y_resolution() );
     
     winsys_swap_buffers();
 }
Пример #12
0
void EventSelectLoop (double timestep) {
	int ww = param.x_resolution;
	int hh = param.y_resolution;
	TColor col;
		
	check_gl_error();
   	set_gl_options (GUI );
	Music.Update ();    
    ClearRenderContext ();
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow (timestep);
		draw_ui_snow ();
	}

	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), param.scale);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	
//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top, 
//			0, colMBackgr, colBlack, 0.2);

	FT.AutoSizeN (3);
	FT.SetColor (colWhite);
	FT.DrawString (area.left, AutoYPosN (30), Trans.Text (6));
	FT.DrawString (area.left,AutoYPosN (45), Trans.Text (7));
	if (Events.IsUnlocked (curr_event, curr_cup) == false) {
		FT.SetColor (colLGrey);
 		FT.DrawString (CENTER, AutoYPosN (58), Trans.Text (10));
	}

	FT.AutoSizeN (4);

	if (curr_focus == 0) col = colDYell; else col = colWhite;
	DrawFrameX (area.left, frametop1, framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (colDYell);
	FT.DrawString (area.left + 20, frametop1, EventList[curr_event].name);

	if (curr_focus == 1) col = colDYell; else col = colWhite;
	DrawFrameX (area.left, frametop2, framewidth, frameheight, 3, colMBackgr, col, 1.0);
	if (Events.IsUnlocked (curr_event, curr_cup)) FT.SetColor (colDYell); 
		else FT.SetColor (colLGrey);
	FT.DrawString (area.left + 20, frametop2, Events.GetCupTrivialName (curr_event, curr_cup));

	PrintArrow (0, (curr_event > 0));	
	PrintArrow (1, (curr_event < last_event));
	PrintArrow (2, (curr_cup > 0));	
	PrintArrow (3, (curr_cup < last_cup));

	if (Events.IsUnlocked (curr_event, curr_cup)) PrintTextButton (0, curr_focus);
	PrintTextButton (1, curr_focus);

	if (param.ice_cursor) DrawCursor ();
    SDL_GL_SwapBuffers ();
}
Пример #13
0
void CScore::Loop () {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;

	Music.Update ();
	check_gl_error();
	ClearRenderContext ();
	ScopedRenderMode rm(GUI);
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow();
	}

	Tex.Draw (BOTTOM_LEFT, 0, hh - 256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	//Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), Winsys.scale);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

	FT.AutoSizeN (7);
	FT.SetColor (colWhite);
	FT.DrawString (CENTER, AutoYPosN (Winsys.resolution.width > Winsys.resolution.height ? 6 : 22), Trans.Text(62));

	DrawFrameX (area.left, frametop, framewidth - 93, frameheight, 3, colMBackgr, colWhite, 1.0);
	FT.AutoSizeN (4);
	FT.SetColor (colDYell);
	FT.DrawString (area.left+20, frametop, CourseList[course->GetValue()].name);

	const TScoreList *list = Score.GetScorelist (course->GetValue());

	FT.SetColor (colWhite);
	if (list != NULL) {
		FT.AutoSizeN (3);
		if (list->numScores < 1) {
			FT.DrawString (CENTER, area.top + 140, Trans.Text(63));
		} else {
			for (int i=0; i<min(MAX_SCORES, list->numScores); i++) {
				int y = listtop + i*linedist;
				FT.DrawString (area.left, y, ordinals[i]);
				FT.DrawString (area.left + dd1, y, Int_StrN (list->scores[i].points));
				FT.DrawString (area.left + dd2, y, list->scores[i].player);
				FT.DrawString (area.left + dd3, y,
				               Int_StrN (list->scores[i].herrings) + "  herrings");
				FT.DrawString (area.left + dd4, y,
				               Float_StrN (list->scores[i].time, 1) + "  sec");
			}
		}
	} else Message ("score list out of range");

	DrawGUI();

	Winsys.SwapBuffers();
}
void CEventSelect::Loop (double timestep) {
    int ww = Winsys.resolution.width;
    int hh = Winsys.resolution.height;
    TColor col;

    check_gl_error();
    ScopedRenderMode rm(GUI);
    Music.Update ();
    ClearRenderContext ();
    SetupGuiDisplay ();

    if (param.ui_snow) {
        update_ui_snow (timestep);
        draw_ui_snow ();
    }

    Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), Winsys.scale);
    Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
    Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
    Tex.Draw (TOP_LEFT, 0, 0, 1);
    Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

    FT.AutoSizeN (3);
    FT.SetColor (colWhite);
    FT.DrawString (area.left, AutoYPosN (30), Trans.Text (6));
    FT.DrawString (area.left,AutoYPosN (45), Trans.Text (7));
    if (Events.IsUnlocked (event->GetValue(), cup->GetValue()) == false) {
        FT.SetColor (colLGrey);
        FT.DrawString (CENTER, AutoYPosN (58), Trans.Text (10));
    }

    FT.AutoSizeN (4);

    if (event->focussed()) col = colDYell;
    else col = colWhite;
    DrawFrameX (area.left, frametop1, framewidth, frameheight, 3, colMBackgr, col, 1.0);
    FT.SetColor (colDYell);
    FT.DrawString (area.left + 20, frametop1, EventList[event->GetValue()].name);

    if (cup->focussed()) col = colDYell;
    else col = colWhite;
    DrawFrameX (area.left, frametop2, framewidth, frameheight, 3, colMBackgr, col, 1.0);
    if (Events.IsUnlocked (event->GetValue(), cup->GetValue()))
        FT.SetColor (colDYell);
    else
        FT.SetColor (colLGrey);
    FT.DrawString (area.left + 20, frametop2, Events.GetCupTrivialName (event->GetValue(), cup->GetValue()));

    textbuttons[0]->SetActive(Events.IsUnlocked (event->GetValue(), cup->GetValue()));
    DrawGUI();

    Winsys.SwapBuffers();
}
Пример #15
0
void
GameMode::drawSnow(float timeStep, bool windy)
{
	// check wether ui snow is 
	if(PPConfig.getBool("ui_snow")){
		// update and draw snow
		update_ui_snow(timeStep, windy);
		draw_ui_snow();
    }
}
Пример #16
0
void CRegist::Loop (double timestep) {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;
	Music.Update ();
	check_gl_error();
    ClearRenderContext ();
    ScopedRenderMode rm(GUI);
    SetupGuiDisplay ();
	TColor col;

	if (param.ui_snow) {
		update_ui_snow (timestep);
		draw_ui_snow();
	}

	Tex.Draw (BOTTOM_LEFT, 0, hh - 256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), scale);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, col, 0.2);

	FT.AutoSizeN (3);
	FT.SetColor (colWhite);
	int top = AutoYPosN (24);
	FT.DrawString (area.left, top, Trans.Text(58));
	FT.DrawString (area.left + framewidth + arrowwidth, top, Trans.Text(59));

	FT.AutoSizeN (4);
	if (player->focussed()) col = colDYell; else col = colWhite;
	DrawFrameX (area.left, area.top, framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + 20, area.top, Players.GetName (player->GetValue()));
	Players.GetAvatarTexture(player->GetValue())->DrawFrame(
		area.left + 60, AutoYPosN (40), texsize, texsize, 3, colWhite);

	if (character->focussed()) col = colDYell; else col = colWhite;
	DrawFrameX (area.left + framewidth + arrowwidth, area.top,
		framewidth, frameheight, 3, colMBackgr, col, 1.0);
	FT.SetColor (col);
	FT.DrawString (area.left + framewidth + arrowwidth + 20,
		area.top, Char.CharList[character->GetValue()].name);
	if(Char.CharList[character->GetValue()].preview != NULL)
		Char.CharList[character->GetValue()].preview->DrawFrame(
			area.right - texsize - 60 - arrowwidth,
			AutoYPosN (40), texsize, texsize, 3, colWhite);


	FT.SetColor (colWhite);
	DrawGUI();

    Winsys.SwapBuffers();
}
Пример #17
0
void CGameConfig::Loop () {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;

	Music.Update ();

	check_gl_error();
	Music.Update ();
	ScopedRenderMode rm(GUI);
	ClearRenderContext ();
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow();
	}

	//Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), 1.0);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

	FT.AutoSizeN (4);

	FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top, Trans.Text(86));
	FT.DrawString (area.left, area.top + dd, Trans.Text(94));
	FT.DrawString (area.left, area.top + dd * 2, Trans.Text(33));
	FT.DrawString (area.left, area.top + dd * 3, Trans.Text(34));
	FT.DrawString (area.left, area.top + dd * 4, Trans.Text(36));
	FT.DrawString (area.left, area.top + dd * 5, Trans.Text(35));

	FT.DrawString (area.left+240, area.top, Trans.Text(87 + vid_orient->GetValue()));
	FT.DrawString (area.left+240, area.top + dd, Float_StrN(sensit->GetValue() / 10.0f, 1));
	FT.DrawString (area.left+240, area.top + dd * 2, Int_StrN (mus_vol->GetValue()));
	FT.DrawString (area.left+240, area.top + dd * 3, Int_StrN (sound_vol->GetValue()));
	FT.DrawString (area.left+240, area.top + dd * 4, Int_StrN (detail_level->GetValue()));
	FT.DrawString (area.left+240, area.top + dd * 5, Trans.languages[language->GetValue()].language);

	DrawGUI();

	Reshape (ww, hh);
	Winsys.SwapBuffers ();
}
Пример #18
0
/*! 
 Mode loop function
 \author  jfpatry
 \date    Created:  2000-09-24
 \date    Modified: 2000-09-24
 */
static void race_select_loop( scalar_t time_step )
{
    use_hud_program();
    
    check_gl_error();
    
    update_audio();
    
    set_gl_options( GUI );
    
    clear_rendering_context();
    
    ui_setup_display();
    
    if (getparam_ui_snow()) {
        update_ui_snow( time_step, False );
        draw_ui_snow();
    }
    
    ui_draw_menu_decorations(False);
	
	if (price_update)
	{
		update_text();
		price_update = False;
	}
    
	GameMenu_draw();

	draw_preview();
    
	winsys_update_joysticks();

    ui_draw();
    
    reshape( getparam_x_resolution(), getparam_y_resolution() );
    
    winsys_swap_buffers();
}
Пример #19
0
void CNewPlayer::Loop() {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;
	TColor col;

	Music.Update ();
	check_gl_error();
	ClearRenderContext ();
	ScopedRenderMode rm(GUI);
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow();
	}

	textfield->UpdateCursor();

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, col, 0.2);

	Tex.Draw (BOTTOM_LEFT, 0, hh - 256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);
	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), Winsys.scale);

	FT.SetColor (colWhite);
	FT.AutoSizeN (4);
	FT.DrawString (CENTER, AutoYPosN (30), Trans.Text(66));

	if (avatar->focussed()) col = colDYell;
	else col = colWhite;
	Players.GetAvatarTexture(avatar->GetValue())->DrawFrame(
	    prevleft, prevtop, prevwidth, prevwidth, 2, col);

	DrawGUI();
	Winsys.SwapBuffers();
}
Пример #20
0
void CEvent::Loop (double timestep) {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;

	check_gl_error();
	ScopedRenderMode rm(GUI);
	Music.Update ();
    ClearRenderContext ();
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow (timestep);
		draw_ui_snow ();
	}
	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), Winsys.scale);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

	if (ready == 0) {			// cup not finished
		FT.AutoSizeN (6);
		FT.SetColor (colWhite);
		FT.DrawString (CENTER, AutoYPosN (25), ecup->name);

		DrawBonusExt (bonustop, (int)ecup->races.size(), curr_bonus);

		DrawFrameX (area.left, frametop, framewidth,
			(int)ecup->races.size() * dist + 20, 3, colBackgr, colWhite, 1);

		for (size_t i=0; i<ecup->races.size(); i++) {
			FT.AutoSizeN (3);

			int y = frametop + 10 + (int)i * dist;
			if (i == curr_race)
				FT.SetColor (colDYell);
			else
				FT.SetColor (colWhite);
			FT.DrawString (area.left + 29, y, Course.CourseList[ecup->races[i]->course].name);
			Tex.Draw (CHECKBOX, area.right -54, y, texsize, texsize);
			if (curr_race > i) Tex.Draw (CHECKMARK, area.right-50, y + 4, 0.8);
		}

		FT.AutoSizeN (3);
		int ddd = FT.AutoDistanceN (1);
		FT.SetColor (colDBlue);
		string info = Trans.Text(11);
		info += "   " + Int_StrN (ecup->races[curr_race]->herrings.i);
		info += "   " + Int_StrN (ecup->races[curr_race]->herrings.j);
		info += "   " + Int_StrN (ecup->races[curr_race]->herrings.k);
		FT.DrawString (CENTER, framebottom+15, info);

		info = Trans.Text(12);
		info += "   " + Float_StrN (ecup->races[curr_race]->time.x, 0);
		info += "   " + Float_StrN (ecup->races[curr_race]->time.y, 0);
		info += "   " + Float_StrN (ecup->races[curr_race]->time.z, 0);
		info += "  " + Trans.Text(14);
		FT.DrawString (CENTER, framebottom+15+ddd, info);

	} else if (ready == 1) {		// cup successfully finished
		FT.AutoSizeN (5);
		FT.SetColor (colWhite);
		FT.DrawString (CENTER, messtop, Trans.Text(16));
		DrawBonusExt (bonustop, (int)ecup->races.size(), curr_bonus);
		int res = resultlevel(curr_bonus, ecup->races.size());
		FT.DrawString (CENTER, messtop2, Trans.Text(17) + "  "+Int_StrN (res));
	} else if (ready == 2) {		// cup finished but failed
		FT.AutoSizeN (5);
		FT.SetColor (colLRed);
		FT.DrawString (CENTER, messtop, Trans.Text(18));
		DrawBonusExt (bonustop, ecup->races.size(), curr_bonus);
		FT.DrawString (CENTER, messtop2, Trans.Text(19));
	}

	textbuttons[0]->SetVisible(ready < 1);
	textbuttons[1]->SetVisible(ready < 1);
	textbuttons[2]->SetVisible(!(ready < 1));

	DrawGUI ();
    Winsys.SwapBuffers();
}
void CGameConfig::Loop () {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;

	Music.Update ();

	check_gl_error();
	Music.Update ();
	ScopedRenderMode rm(GUI);
	ClearRenderContext ();
	SetupGuiDisplay ();

	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow();
	}

	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), 1.0);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

	FT.AutoSizeN (4);

#ifndef PANDORA
	if (resolution->focussed()) FT.SetColor (colDYell);
	else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd, Trans.Text(32));
#endif
	if (mus_vol->focussed()) FT.SetColor (colDYell);
	else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*2, Trans.Text(33));
	if (sound_vol->focussed()) FT.SetColor (colDYell);
	else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*3, Trans.Text(34));
	if (detail_level->focussed()) FT.SetColor (colDYell);
	else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*4, Trans.Text(36));
	if (language->focussed()) FT.SetColor (colDYell);
	else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*5, Trans.Text(35));

	FT.SetColor (colWhite);
#ifndef PANDORA
	FT.DrawString (area.left+240, area.top + dd, res_names[resolution->GetValue()]);
#endif
	FT.DrawString (area.left+240, area.top + dd*2, Int_StrN (mus_vol->GetValue()));
	FT.DrawString (area.left+240, area.top + dd*3, Int_StrN (sound_vol->GetValue()));
	FT.DrawString (area.left+240, area.top + dd*4, Int_StrN (detail_level->GetValue()));
	FT.DrawString (area.left+240, area.top + dd*5, Trans.languages[language->GetValue()].language);

#if defined (_WIN32)
	if (fullscreen->checked != param.fullscreen) {
		FT.SetColor (colDYell);
		FT.AutoSizeN (4);
		FT.DrawString (CENTER, AutoYPosN (68), Trans.Text(84));
		FT.DrawString (CENTER, AutoYPosN (72), Trans.Text(85));
	} else {
		FT.SetColor (colLGrey);
		FT.AutoSizeN (3);
		FT.DrawString (CENTER, AutoYPosN (68), Trans.Text(41));
		FT.DrawString (CENTER, AutoYPosN (72), Trans.Text(42));
	}
#else
#ifndef PANDORA
	FT.SetColor (colWhite);
	FT.AutoSizeN (3);
	FT.DrawString (CENTER, AutoYPosN (68), Trans.Text(41));
	FT.DrawString (CENTER, AutoYPosN (72), Trans.Text(42));
#endif
#endif

	DrawGUI();

	Reshape (ww, hh);
	Winsys.SwapBuffers ();
}
Пример #22
0
void EventLoop (double timestep) {
    int ww = param.x_resolution;
    int hh = param.y_resolution;
    int i;
    TColor col;
    int y;
    string info;

    check_gl_error();
    set_gl_options (GUI );
    Music.Update ();
    ClearRenderContext ();
    SetupGuiDisplay ();

    if (param.ui_snow) {
        update_ui_snow (timestep);
        draw_ui_snow ();
    }
    Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), param.scale);
    Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
    Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
    Tex.Draw (TOP_LEFT, 0, 0, 1);
    Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

    if (ready == 0) {			// cup not finished
        FT.AutoSizeN (6);
        FT.SetColor (colWhite);
        FT.DrawString (CENTER, AutoYPosN (25), ecup->name);

        DrawBonusExt (bonustop, ecup->num_races, curr_bonus);

        DrawFrameX (area.left, frametop, framewidth,
                    ecup->num_races * dist + 20, 3, colBackgr, colWhite, 1);

        for (i=0; i<ecup->num_races; i++) {
            if (i == curr_race) col = colDYell;
            else col = colWhite;
            FT.AutoSizeN (3);

            y = frametop + 10 + i * dist;
            FT.SetColor (col);
            FT.DrawString (area.left + 29, y, Course.CourseList[ecourseidx[i]].name);
            Tex.Draw (CHECKBOX, area.right -54, y, texsize, texsize);
            if (curr_race > i) Tex.Draw (CHECKMARK, area.right-50, y + 4, 0.8);
        }

        FT.AutoSizeN (3);
        int ddd = FT.AutoDistanceN (1);
        FT.SetColor (colDBlue);
        info = Trans.Text(11);
        info += "   " + Int_StrN (eraces[curr_race]->herrings.i);
        info += "   " + Int_StrN (eraces[curr_race]->herrings.j);
        info += "   " + Int_StrN (eraces[curr_race]->herrings.k);
        FT.DrawString (CENTER, framebottom+15, info);

        info = Trans.Text(12);
        info += "   " + Float_StrN (eraces[curr_race]->time.x, 0);
        info += "   " + Float_StrN (eraces[curr_race]->time.y, 0);
        info += "   " + Float_StrN (eraces[curr_race]->time.z, 0);
        info += "  " + Trans.Text(14);
        FT.DrawString (CENTER, framebottom+15+ddd, info);

    } else if (ready == 1) {		// cup successfully finished
        FT.AutoSizeN (5);
        FT.SetColor (colWhite);
        FT.DrawString (CENTER, messtop, Trans.Text(16));
        DrawBonusExt (bonustop, ecup->num_races, curr_bonus);
        int res = resultlevel(curr_bonus, ecup->num_races);
        FT.DrawString (CENTER, messtop2, Trans.Text(17) + "  "+Int_StrN (res));
    } else if (ready == 2) {		// cup finished but failed
        FT.AutoSizeN (5);
        FT.SetColor (colLRed);
        FT.DrawString (CENTER, messtop, Trans.Text(18));
        DrawBonusExt (bonustop, ecup->num_races, curr_bonus);
        FT.DrawString (CENTER, messtop2, Trans.Text(19));
    }
    if (ready < 1) {
        PrintTextButton (0, curr_focus);
        PrintTextButton (1, curr_focus);
    } else PrintTextButton (2, curr_focus);

    if (param.ice_cursor) DrawCursor ();
    SDL_GL_SwapBuffers ();
}
Пример #23
0
void CRaceSelect::Loop() {
	int ww = Winsys.resolution.width;
	int hh = Winsys.resolution.height;
	TColor col;

	check_gl_error();
	ScopedRenderMode rm(GUI);
	ClearRenderContext ();
	SetupGuiDisplay ();

	Music.Update ();
	if (param.ui_snow) {
		update_ui_snow ();
		draw_ui_snow ();
	}

	//Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), 1.0);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top,
//			0, colMBackgr, colBlack, 0.2);

	// course selection
	col = colWhite;
	DrawFrameX (area.left, frametop, framewidth - 100, frameheight, 3, colMBackgr, col, 1.0);
	FT.AutoSizeN (4);
	FT.SetColor (colDYell);
	FT.DrawString (area.left+20, frametop, CourseList[course->GetValue()].name);

	if (CourseList[course->GetValue()].preview)
		CourseList[course->GetValue()].preview->DrawFrame(area.left + 3, prevtop, prevwidth, prevheight, 3, colWhite);

	DrawFrameX (area.right-boxwidth, prevtop-3, boxwidth, prevheight+6, 3, colBackgr, colWhite, 1.0);
	FT.AutoSizeN (2);
	FT.SetColor (colWhite);
	int dist = FT.AutoDistanceN (0);
	for (size_t i=0; i<CourseList[course->GetValue()].num_lines; i++) {
		FT.DrawString (boxleft+8, prevtop+i*dist, CourseList[course->GetValue()].desc[i]);
	}

	FT.DrawString (CENTER, prevtop + prevheight + 10, "Author:  " + CourseList[course->GetValue()].author);

	//FT.DrawString (CENTER, AutoYPosN (45), info);

	if (g_game.force_treemap) {
		FT.AutoSizeN (4);
		static const string forcetrees = "Load trees.png";
		string sizevar = "Size: ";
		sizevar += Int_StrN (g_game.treesize);
		sizevar += " Variation: ";
		sizevar += Int_StrN (g_game.treevar);
		FT.SetColor (colYellow);
		FT.DrawString (CENTER, AutoYPosN (85), forcetrees);
		FT.DrawString (CENTER, AutoYPosN (90), sizevar);
	}

	DrawGUI();

	Winsys.SwapBuffers();
}
Пример #24
0
void GameConfigLoop (double time_step) {
	int ww = param.x_resolution;
	int hh = param.y_resolution;

	Music.Update ();    
			
	check_gl_error();
	Music.Update ();    
    set_gl_options (GUI);
    ClearRenderContext ();
    SetupGuiDisplay ();
    
	if (param.ui_snow) {
		update_ui_snow (time_step);
		draw_ui_snow();
    }

	Tex.Draw (T_TITLE_SMALL, CENTER, AutoYPosN (5), 1.0);
	Tex.Draw (BOTTOM_LEFT, 0, hh-256, 1);
	Tex.Draw (BOTTOM_RIGHT, ww-256, hh-256, 1);
	Tex.Draw (TOP_LEFT, 0, 0, 1);
	Tex.Draw (TOP_RIGHT, ww-256, 0, 1);

//	DrawFrameX (area.left, area.top, area.right-area.left, area.bottom - area.top, 
//			0, colMBackgr, colBlack, 0.2);

	FT.AutoSizeN (4);
	PrintCheckbox (0, curr_focus, curr_fullscreen);

	if (curr_focus == 1) FT.SetColor (colDYell); else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd, Trans.Text(32));
	if (curr_focus == 2) FT.SetColor (colDYell); else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*2, Trans.Text(33));
	if (curr_focus == 3) FT.SetColor (colDYell); else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*3, Trans.Text(34));
	if (curr_focus == 4) FT.SetColor (colDYell); else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*4, Trans.Text(36));
	if (curr_focus == 5) FT.SetColor (colDYell); else FT.SetColor (colWhite);
	FT.DrawString (area.left, area.top + dd*5, Trans.Text(35));

	FT.SetColor (colWhite);
	FT.DrawString (area.left+240, area.top + dd, res_names[curr_res]);
	FT.DrawString (area.left+240, area.top + dd*2, Int_StrN (curr_mus_vol));
	FT.DrawString (area.left+240, area.top + dd*3, Int_StrN (curr_sound_vol));
	FT.DrawString (area.left+240, area.top + dd*4, Int_StrN (curr_detail_level));
	FT.DrawString (area.left+240, area.top + dd*5, LangList[curr_language].language);

	PrintArrow (0, (curr_res < (NUM_RESOLUTIONS-1)));
	PrintArrow (1, (curr_res > 0));	
	PrintArrow (2, (curr_mus_vol < 120));
	PrintArrow (3, (curr_mus_vol > 0));	
	PrintArrow (4, (curr_sound_vol < 120));
	PrintArrow (5, (curr_sound_vol > 0));	
	PrintArrow (6, (curr_detail_level < 3));
	PrintArrow (7, (curr_detail_level > 1));	
	PrintArrow (8, (curr_language > 0));	
 	PrintArrow (9, (curr_language < lastLang));
	
	PrintTextButton (0, curr_focus);
	PrintTextButton (1, curr_focus);

	#if defined (OS_WIN32_MINGW)
		if ((curr_res != prev_res || curr_fullscreen != prev_fullscreen) &&
		param.restart_on_res_change) {
			FT.SetColor (colDYell);
			FT.AutoSizeN (4);
			FT.DrawString (CENTER, AutoYPosN (68), "The video adjustments have changed,");
			FT.DrawString (CENTER, AutoYPosN (72), "You need to restart the game");
		} else {
			FT.SetColor (colLGrey);
			FT.AutoSizeN (3);
			FT.DrawString (CENTER, AutoYPosN (68), Trans.Text(41));
			FT.DrawString (CENTER, AutoYPosN (72), Trans.Text(42));
		}
	#else 
		FT.SetColor (colWhite);
		FT.AutoSizeN (3);
		FT.DrawString (CENTER, AutoYPosN (68), Trans.Text(41));
		FT.DrawString (CENTER, AutoYPosN (72), Trans.Text(42));
	#endif

	if (param.ice_cursor) DrawCursor ();
	Reshape (ww, hh);
	Winsys.SwapBuffers ();
}