Exemple #1
0
int CHudScoreboard :: DrawScoreboard( float fTime )
{
	GetAllPlayersInfo();

//	Packetloss removed on Kelly 'shipping nazi' Bailey's orders
//	if ( cl_showpacketloss && cl_showpacketloss->value && ( ScreenWidth >= 400 ) )
//	{
//		can_show_packetloss = 1;
//	}

	// just sort the list on the fly
	// list is sorted first by frags, then by deaths
	float list_slot = 0;

	// print the heading line

	DrawUtils::DrawRectangle(xstart, ystart, xend - xstart, yend - ystart,
		m_colors.r, m_colors.g, m_colors.b, m_colors.a, m_bDrawStroke);

	int ypos = ystart + (list_slot * ROW_GAP) + 5;

	DrawUtils::DrawHudString( NAME_POS_START(), ypos, NAME_POS_END(), (char*)(gHUD.m_Teamplay ? "TEAMS" : "PLAYERS"), 255, 140, 0 );
	DrawUtils::DrawHudStringReverse( KILLS_POS_END(), ypos, 0, "KILLS", 255, 140, 0 );
	DrawUtils::DrawHudString(	DEATHS_POS_START(), ypos, DEATHS_POS_END(), "DEATHS", 255, 140, 0 );
	DrawUtils::DrawHudStringReverse( PING_POS_END(), ypos, PING_POS_START(), "PING", 255, 140, 0 );

	list_slot += 2;
	ypos = ystart + (list_slot * ROW_GAP);
	FillRGBA( xstart, ypos, xend - xstart, 1, 255, 140, 0, 255);  // draw the separator line
	
	list_slot += 0.8;

	if ( gHUD.m_Teamplay )
	{
		DrawTeams( list_slot );
	}
	else
	{
		// it's not teamplay,  so just draw a simple player list
		DrawPlayers( list_slot );
	}
	return 1;
}
Exemple #2
0
//Scoreboard entry point
//	This will be called even if the scoreboard is not showing - and will return false if it has faded aka 'not showing'
//	It will return true if the scoreboard is showing
qboolean CG_DrawQ3PScoreboard( void ) {
	vector4 fadeWhite = { 1.0f, 1.0f, 1.0f, 1.0f };
	float fade = 1.0f;

	if ( cg.warmup && !cg.showScores )
		return qfalse;

	if ( !cg.showScores && cg.snap->ps.pm_type != PM_DEAD && cg.snap->ps.pm_type != PM_INTERMISSION ) {
		if ( CG_FadeColor2( &fadeWhite, cg.scoreFadeTime, 300.0f ) )
			return qfalse;

		fade = fadeWhite.a;
	}

	DrawPlayerCount( fade );
	DrawPlayers( fade );

	DrawServerInfo( fade );
	DrawClientInfo( fade );

	CG_LoadDeferredPlayers();
	return qtrue;
}
Exemple #3
0
static Boolean MainFormHandleEvent (EventPtr e)
{
        Boolean handled = false;
        FormPtr frm;
    
        switch (e->eType) {
        case frmOpenEvent:
                frm = FrmGetActiveForm();
                DrawIntro();
                FrmDrawForm(frm);
                DrawState();  // Draw those dice!
                handled = true;
                break;

        case frmUpdateEvent:
                DrawPlayers();
                break;

        case menuEvent:
                MenuEraseStatus(NULL);

                switch(e->data.menu.itemID) {
                case MenuItem_Help:
                        FrmHelp( GenericHelp );
                        break;

                case MenuItem_About:
                        FrmAlert(About_Info);
                        break;

                case MenuItem_New:
                        DialogNewGame();
                        break;

                case MenuItem_Reset:
                        ResetCubes();
                        DrawState();
                        break;

                case MenuItem_Defaults:
                        Defaults();
                        ResetCubes();
                        DrawState();
                        break;

                case MenuItem_Variants:
                        if ( GetCurrPlayer() < 0 ) {
                                DialogVariants();
                        } else {
                                FrmAlert(NoVariants);
                        }
                        break;

                case MenuItem_Preferences:
                        DialogPreferences();
                        break;


                }
                handled = true;
                break;

        case ctlSelectEvent:
                switch(e->data.ctlSelect.controlID) {

                case btn_Stay:
                        ShowButtons(false);
                        Stay();
                        break;

                case btn_Info:
                                //FrmAlert(About_Info);
                        DialogStatus();
                        break;
		
                case btn_Roll:
                        if ( isGameOn() ) {
                                ShowButtons(false);
                                Roll();
                        } else {
                                DialogNewGame();
                        }
                        break;

                case btnTopStatus:
                        FrmHelp( TS_LastLicks );
                        break;

                }
                handled = true;
                break;

        case winExitEvent:
                if( e->data.winExit.exitWindow ==
                    (WinHandle)FrmGetFormPtr(MainForm) )
                {
                                /* Turn off animations and the AI */
                        FreezeBit = true;
                }
                break;

        case winEnterEvent:
                if (e->data.winEnter.enterWindow ==
                    (WinHandle)FrmGetFormPtr(MainForm) &&
                    e->data.winEnter.enterWindow ==
                    (WinHandle)FrmGetFirstForm ())
                {
                                /* Turn back on animations and the AI */
                        FreezeBit = false;
                }

        default:
                break;
        }

        return handled;
}
Exemple #4
0
//add
void WorldDrawer2d::init(){
	cs1 = new CoordinateSystem2d();
	cs2 = new CoordinateSystem2d();
	cs_used.push_back(cs2);
	cs_used.push_back(cs1);
	DrawCircle(&o1,0.0f,0.0f,0.5f);
	o1->scaleRelativeToPoint(o1->points.at(0),0.5f,0.5f);
	DrawCircle(&b1,1.0f,1.0f,1.0f);
	DrawCircle(&b2,1.0f,1.0f,1.0f);
	DrawCircle(&b3,1.0f,1.0f,1.0f);
	DrawCircle(&b4,1.0f,1.0f,1.0f);
	DrawTribune(&spectatori);
	DrawFour(0.25f,18.0f,&o3,1.0f,1.0f,1.0f);
	DrawFour(0.25f,18.0f,&o4,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o5,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o6,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o7,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o8,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o9,1.0f,1.0f,1.0f);
	DrawFour(4.0f,0.25f,&o10,1.0f,1.0f,1.0f);
	DrawFour(0.25f,1.0f,&o11,1.0f,1.0f,1.0f);
	DrawFour(0.25f,1.0f,&o12,1.0f,1.0f,1.0f);
	DrawFour(0.25f,1.0f,&o13,1.0f,1.0f,1.0f);
	DrawFour(0.25f,1.0f,&o14,1.0f,1.0f,1.0f);
	DrawFour(12.0f,0.1f,&o15,1.0f,1.0f,1.0f);
	DrawFour(6.0f,0.1f,&o16,1.0f,1.0f,1.0f);
	DrawFour(6.0f,0.1f,&o17,1.0f,1.0f,1.0f);
	DrawFour(0.1f,1.3f,&o18,1.0f,1.0f,1.0f);
	DrawFour(0.1f,1.3f,&o19,1.0f,1.0f,1.0f);
	DrawFour(0.1f,1.3f,&o20,1.0f,1.0f,1.0f);
	DrawFour(0.1f,1.3f,&o21,1.0f,1.0f,1.0f);

	DrawPlayers(&players1,1.0f,1.0f,0.0f);
	DrawPlayers(&players2,1.0f,0.1f,0.1f);
	DrawScore(1.0f,1.0f,0.0f,1.0f,0.1f,0.1f);
	DrawField(18,12);
	
	o3->translate(12.25f,0.0f);
	o4->translate(-12.25f,0.0f);
	o5->translate(-8.25f,18.0f);
	o6->translate(8.25f,18.0f);
	o7->translate(-8.25f,-18.0f);
	o8->translate(8.25f,-18.0f);
	o9->translate(0.0f,19.7f);
	o10->translate(0.0f,-19.7f);
	o11->translate(4.0f,18.75f);
	o12->translate(-4.0f,18.75f);
	o13->translate(-4.0f,-18.75f);
	o14->translate(4.0f,-18.75f);
	o16->translate(0.0f,15.5f);
	o17->translate(0.0f,-15.5f);
	o18->translate(6.0f,16.8f);
	o19->translate(-6.0f,16.8f);
	o20->translate(6.0f,-16.8f);
	o21->translate(-6.0f,-16.8f);
	players1.at(0)->translate(0.0f,17.7f);
	players1.at(1)->translate(-5.0f,10.0f);
	players1.at(2)->translate(5.0f,10.0f);
	players1.at(3)->translate(3.0f,-3.0f);
	players1.at(4)->translate(-6.0f,-3.0f);
	players1.at(5)->translate(0.0f,-9.0f);
	players2.at(0)->translate(0.0f,-17.7f);
	players2.at(1)->translate(5.0f,-10.0f);
	players2.at(2)->translate(-5.0f,-10.0f);
	players2.at(3)->translate(-3.0f,3.0f);
	players2.at(4)->translate(6.0f,3.0f);
	players2.at(5)->translate(0.0f,9.0f);

	putBall();
	b1->scaleRelativeToPoint(b1->points[0],0.75f,0.75f);
	b2->scaleRelativeToPoint(b2->points[0],0.75f,0.75f);
	b3->scaleRelativeToPoint(b3->points[0],0.75f,0.75f);
	b4->scaleRelativeToPoint(b4->points[0],0.75f,0.75f);

	b1->translate(-4.0f,18.0f);
	b2->translate(4.0f,18.0f);
	b3->translate(-4.0f,-18.0f);
	b4->translate(4.0f,-18.0f);

}
Exemple #5
0
void View::Draw(const Model &model) const {
  ofPushMatrix();
  SetupViewpoint();
  ofBackground(ofColor::white);
  //CHASERS-------------------
  for (int i = 0; i < model.nChasers; i++){
    model.topChaser[i]->draw();
    model.botChaser[i]->draw();
    model.rightChaser[i]->draw();
    model.leftChaser[i]->draw();
  }
  DrawGravity(model);
  DrawPlayers(model);
  
  ofColor ball_color = model.last_hit_player == 1 ? color_p1 :
      model.last_hit_player == 2 ? color_p2 : ofColor::white;
  DrawBallTrail(model, model.ball_trail, ball_color);
  DrawStrikeIndicator(model);
  DrawBall(model.ball, ball_color);
  
  for (float x=-10; x<GRID_W; x+=(1.0/6.0)) {
    for (float y=-5; y<GRID_H; y+=(1.0/6.0)) {
      if (ofDist(model.ball->GetPosition().x, model.ball->GetPosition().y, x, y)<0.3) {
        if (ball_color==color_p1){
          ofSetColor(color_p1.r,ofRandom(10,60),color_p1.b, 100);
        }else if(ball_color==color_p2){
          ofSetColor(ofRandom(10,60),color_p2.g,color_p2.b, 100);
        }else{
          ofSetColor(ofRandom(200,250),ofRandom(200,250),ofRandom(200,250), 200);
        }
        ofCircle(x, y, 0.1);
      }
      else if (ofDist(model.player1_top->GetPosition().x, model.player1_top->GetPosition().y, x, y)<0.4 ||
               ofDist(model.player1_bottom->GetPosition().x, model.player1_bottom->GetPosition().y, x, y)<0.4) {
        ofSetColor(color_p1.r,ofRandom(10,60),color_p1.b, 155);
        ofCircle(x, y, 0.12);
      }
      else if (ofDist(model.player2_top->GetPosition().x, model.player2_top->GetPosition().y, x, y)<0.4 ||
               ofDist(model.player2_bottom->GetPosition().x, model.player2_bottom->GetPosition().y, x, y)<0.4) {
        ofSetColor(ofRandom(10,60),color_p2.g,color_p2.b, 155);
        ofCircle(x, y, 0.12);
      }
      else if (ofDist(model.ball->GetPosition().x, model.ball->GetPosition().y, x, y)< model.p1glowMax){
        ofNoFill();
        ofSetColor(color_p1.r,ofRandom(10,60),color_p1.b, 135);
        ofCircle(x, y, 0.12);
        ofFill();
      }
      else if (ofDist(model.ball->GetPosition().x, model.ball->GetPosition().y, x, y)< model.p2glowMax){
        ofNoFill();
        ofSetColor(ofRandom(10,60),color_p2.g,color_p2.b, 135);
        ofCircle(x, y, 0.12);
        ofFill();
      }
      
      
      else {
        ofFill();
        ofSetColor(ofRandom(0,10),ofRandom(0,10),ofRandom(10,20), 20);
        ofTriangle(x, y+0.7, x-0.6, y-0.6, x+0.6, y-0.6);

      }

    }



    
  }
  DrawCourt(model);
  DrawScore(model);
  if (model.show_winning_state) {
    DrawTriangles(model);
  }
  ofPopMatrix();

  //DrawFramesPerSecond(model);
}
Exemple #6
0
int CHudScoreboard :: DrawTeams( float list_slot )
{
	int j;
	int ypos = ystart + (list_slot * ROW_GAP) + 5;

	// clear out team scores
	for ( int i = 1; i <= m_iNumTeams; i++ )
	{
		if ( !g_TeamInfo[i].scores_overriden )
			g_TeamInfo[i].frags = g_TeamInfo[i].deaths = 0;
		g_TeamInfo[i].sumping = 0;
		g_TeamInfo[i].players = 0;
		g_TeamInfo[i].already_drawn = FALSE;
	}

	// recalc the team scores, then draw them
	for ( int i = 1; i < MAX_PLAYERS; i++ )
	{
		if ( !g_PlayerInfoList[i].name || !g_PlayerInfoList[i].name[0] )
			continue; // empty player slot, skip

		if ( g_PlayerExtraInfo[i].teamname[0] == 0 )
			continue; // skip over players who are not in a team

		// find what team this player is in
		for ( j = 1; j <= m_iNumTeams; j++ )
		{
			if ( !stricmp( g_PlayerExtraInfo[i].teamname, g_TeamInfo[j].name ) )
				break;
		}

		if ( j > m_iNumTeams )  // player is not in a team, skip to the next guy
			continue;

		if ( !g_TeamInfo[j].scores_overriden )
		{
			g_TeamInfo[j].frags += g_PlayerExtraInfo[i].frags;
			g_TeamInfo[j].deaths += g_PlayerExtraInfo[i].deaths;
		}

		g_TeamInfo[j].sumping += g_PlayerInfoList[i].ping;

		if ( g_PlayerInfoList[i].thisplayer )
			g_TeamInfo[j].ownteam = TRUE;
		else
			g_TeamInfo[j].ownteam = FALSE;

		g_TeamInfo[j].players++;
	}

	// Draw the teams
	int iSpectatorPos = -1;

	while( true )
	{
		int highest_frags = -99999; int lowest_deaths = 99999;
		int best_team = 0;

		for ( int i = 1; i <= m_iNumTeams; i++ )
		{
			// don't draw team without players
			if ( g_TeamInfo[i].players <= 0 )
				continue;

			if (!strnicmp(g_TeamInfo[i].name, "SPECTATOR", MAX_TEAM_NAME))
			{
				iSpectatorPos = i;
				continue;
			}

			if ( !g_TeamInfo[i].already_drawn && g_TeamInfo[i].frags >= highest_frags )
			{
				if ( g_TeamInfo[i].frags > highest_frags || g_TeamInfo[i].deaths < lowest_deaths )
				{
					best_team = i;
					lowest_deaths = g_TeamInfo[i].deaths;
					highest_frags = g_TeamInfo[i].frags;
				}
			}
		}

		// draw the best team on the scoreboard
		if ( !best_team )
		{
			// if spectators is found and still not drawn
			if( iSpectatorPos != -1 && g_TeamInfo[iSpectatorPos].already_drawn == FALSE )
				best_team = iSpectatorPos;
			else break;
		}
		// draw out the best team
		team_info_t *team_info = &g_TeamInfo[best_team];

		// don't draw team without players
		if ( team_info->players <= 0 )
			continue;

		ypos = ystart + (list_slot * ROW_GAP);

		// check we haven't drawn too far down
		if ( ypos > yend )  // don't draw to close to the lower border
			break;

		int r, g, b;
		char teamName[64];

		GetTeamColor( r, g, b, team_info->teamnumber );
		switch( team_info->teamnumber )
		{
		case TEAM_TERRORIST:
			snprintf(teamName, sizeof(teamName), "Terrorists   -   %i players", team_info->players);
			DrawUtils::DrawHudNumberString( KILLS_POS_END(),  ypos, KILLS_POS_START(),  team_info->frags,  r, g, b );
			break;
		case TEAM_CT:
			snprintf(teamName, sizeof(teamName), "Counter-Terrorists   -   %i players", team_info->players);
			DrawUtils::DrawHudNumberString( KILLS_POS_END(),  ypos, KILLS_POS_START(),  team_info->frags,  r, g, b );
			break;
		case TEAM_SPECTATOR:
		case TEAM_UNASSIGNED:
			strncpy( teamName, "Spectators", sizeof(teamName) );
			break;
		}

		DrawUtils::DrawHudString( NAME_POS_START(),		 ypos, NAME_POS_END(),   teamName,   r, g, b );
		DrawUtils::DrawHudNumberString( PING_POS_END(),  ypos, PING_POS_START(),  team_info->sumping / team_info->players,  r, g, b );

		team_info->already_drawn = TRUE;  // set the already_drawn to be TRUE, so this team won't get drawn again

		// draw underline
		list_slot += 1.2f;
		FillRGBA( xstart, ystart + (list_slot * ROW_GAP), xend - xstart, 1, r, g, b, 255);

		list_slot += 0.4f;
		// draw all the players that belong to this team, indented slightly
		list_slot = DrawPlayers( list_slot, 10, team_info->name );
	}

	// draw all the players who are not in a team
	list_slot += 4.0f;
	DrawPlayers( list_slot, 0, "" );

	return 1;
}
int CHudScoreboard :: Draw( float fTime )
{
	if ( !m_iShowscoresHeld && gHUD.m_Health.m_iHealth > 0 && !gHUD.m_iIntermission )
		return 1;


	GetAllPlayersInfo();

	// just sort the list on the fly
	// list is sorted first by frags, then by deaths
	float list_slot = 0;
	int xpos_rel = (ScreenWidth - SCOREBOARD_WIDTH) / 2;

	// print the heading line
	int ypos = ROW_RANGE_MIN + (list_slot * ROW_GAP);
	int	xpos = NAME_RANGE_MIN + xpos_rel;

	if ( !gHUD.m_Teamplay ) 
		gHUD.DrawHudString( xpos, ypos, NAME_RANGE_MAX + xpos_rel, "Player", 255, 140, 0 );
	else
		gHUD.DrawHudString( xpos, ypos, NAME_RANGE_MAX + xpos_rel, "Teams", 255, 140, 0 );

	gHUD.DrawHudStringReverse( KILLS_RANGE_MAX + xpos_rel, ypos, 0, "kills", 255, 140, 0 );
	gHUD.DrawHudString( DIVIDER_POS + xpos_rel, ypos, ScreenWidth, "/", 255, 140, 0 );
	gHUD.DrawHudString( DEATHS_RANGE_MIN + xpos_rel + 5, ypos, ScreenWidth, "deaths", 255, 140, 0 );
	gHUD.DrawHudString( PING_RANGE_MAX + xpos_rel - 35, ypos, ScreenWidth, "latency", 255, 140, 0 );

	list_slot += 1.2;
	ypos = ROW_RANGE_MIN + (list_slot * ROW_GAP);
	xpos = NAME_RANGE_MIN + xpos_rel;
	FillRGBA( xpos - 5, ypos, PING_RANGE_MAX - 5, 1, 255, 140, 0, 255);  // draw the seperator line
	
	list_slot += 0.8;

	if ( !gHUD.m_Teamplay )
	{
		// it's not teamplay,  so just draw a simple player list
		DrawPlayers( xpos_rel, list_slot );
		return 1;
	}

	// clear out team scores
	for ( int i = 1; i <= m_iNumTeams; i++ )
	{
		if ( !m_TeamInfo[i].scores_overriden )
			m_TeamInfo[i].frags = m_TeamInfo[i].deaths = 0;
		m_TeamInfo[i].ping = m_TeamInfo[i].packetloss = 0;
	}

	// recalc the team scores, then draw them
	for ( i = 1; i < MAX_PLAYERS; i++ )
	{
		if ( m_PlayerInfoList[i].name == NULL )
			continue; // empty player slot, skip

		if ( m_PlayerExtraInfo[i].teamname[0] == 0 )
			continue; // skip over players who are not in a team

		// find what team this player is in
		for ( int j = 1; j <= m_iNumTeams; j++ )
		{
			if ( !stricmp( m_PlayerExtraInfo[i].teamname, m_TeamInfo[j].name ) )
				break;
		}
		if ( j > m_iNumTeams )  // player is not in a team, skip to the next guy
			continue;

		if ( !m_TeamInfo[j].scores_overriden )
		{
			m_TeamInfo[j].frags += m_PlayerExtraInfo[i].frags;
			m_TeamInfo[j].deaths += m_PlayerExtraInfo[i].deaths;
		}

		m_TeamInfo[j].ping += m_PlayerInfoList[i].ping;
		m_TeamInfo[j].packetloss += m_PlayerInfoList[i].packetloss;

		if ( m_PlayerInfoList[i].thisplayer )
			m_TeamInfo[j].ownteam = TRUE;
		else
			m_TeamInfo[j].ownteam = FALSE;
	}

	// find team ping/packetloss averages
	for ( i = 1; i <= m_iNumTeams; i++ )
	{
		m_TeamInfo[i].already_drawn = FALSE;

		if ( m_TeamInfo[i].players > 0 )
		{
			m_TeamInfo[i].ping /= m_TeamInfo[i].players;  // use the average ping of all the players in the team as the teams ping
			m_TeamInfo[i].packetloss /= m_TeamInfo[i].players;  // use the average ping of all the players in the team as the teams ping
		}
	}

	// Draw the teams
	while ( 1 )
	{
		int highest_frags = -99999; int lowest_deaths = 99999;
		int best_team = 0;

		for ( i = 1; i <= m_iNumTeams; i++ )
		{
			if ( m_TeamInfo[i].players < 0 )
				continue;

			if ( !m_TeamInfo[i].already_drawn && m_TeamInfo[i].frags >= highest_frags )
			{
				if ( m_TeamInfo[i].frags > highest_frags || m_TeamInfo[i].deaths < lowest_deaths )
				{
					best_team = i;
					lowest_deaths = m_TeamInfo[i].deaths;
					highest_frags = m_TeamInfo[i].frags;
				}
			}
		}

		// draw the best team on the scoreboard
		if ( !best_team )
			break;

		// draw out the best team
		team_info_t *team_info = &m_TeamInfo[best_team];

		ypos = ROW_RANGE_MIN + (list_slot * ROW_GAP);

		// check we haven't drawn too far down
		if ( ypos > ROW_RANGE_MAX )  // don't draw to close to the lower border
			break;

		xpos = NAME_RANGE_MIN + xpos_rel;
		int r = 255, g = 225, b = 55; // draw the stuff kinda yellowish
		
		if ( team_info->ownteam ) // if it is their team, draw the background different color
		{
			// overlay the background in blue,  then draw the score text over it
			FillRGBA( NAME_RANGE_MIN + xpos_rel - 5, ypos, PING_RANGE_MAX - 5, ROW_GAP, 0, 0, 255, 70 );
		}

		// draw their name (left to right)
		gHUD.DrawHudString( xpos, ypos, NAME_RANGE_MAX + xpos_rel, team_info->name, r, g, b );

		// draw kills (right to left)
		xpos = KILLS_RANGE_MAX + xpos_rel;
		gHUD.DrawHudNumberString( xpos, ypos, KILLS_RANGE_MIN + xpos_rel, team_info->frags, r, g, b );

		// draw divider
		xpos = DIVIDER_POS + xpos_rel;
		gHUD.DrawHudString( xpos, ypos, xpos + 20, "/", r, g, b );

		// draw deaths
		xpos = DEATHS_RANGE_MAX + xpos_rel;
		gHUD.DrawHudNumberString( xpos, ypos, DEATHS_RANGE_MIN + xpos_rel, team_info->deaths, r, g, b );

		// draw ping
		// draw ping & packetloss
		static char buf[64];
		sprintf( buf, "%d", team_info->ping );
		xpos = ((PING_RANGE_MAX - PING_RANGE_MIN) / 2) + PING_RANGE_MIN + xpos_rel + 25;
		UnpackRGB( r, g, b, RGB_YELLOWISH );
		gHUD.DrawHudStringReverse( xpos, ypos, xpos - 50, buf, r, g, b );

	/*  Packetloss removed on Kelly 'shipping nazi' Bailey's orders
		sprintf( buf, " %d", team_info->packetloss );
		gHUD.DrawHudString( xpos, ypos, xpos+50, buf, r, g, b );
	*/

		team_info->already_drawn = TRUE;  // set the already_drawn to be TRUE, so this team won't get drawn again
		list_slot++;

		// draw all the players that belong to this team, indented slightly
		list_slot = DrawPlayers( xpos_rel, list_slot, 10, team_info->name );
	}

	// draw all the players who are not in a team
	list_slot += 0.5;
	DrawPlayers( xpos_rel, list_slot, 0, "" );

	return 1;
}
		void ScoreboardView::Draw() {
			SPADES_MARK_FUNCTION();
			
			world = client->GetWorld();
			if(!world){
				// no world
				return;
			}
			ctf = dynamic_cast<CTFGameMode *>(world->GetMode());
			tc = dynamic_cast<TCGameMode *>(world->GetMode());
			
			Handle<IImage>image;
			IFont *font;
			Vector2 pos, size;
			char buf[256];
			std::string str;
			float scrWidth = renderer->ScreenWidth();
			float scrHeight = renderer->ScreenHeight();
			const Vector4 whiteColor = {1,1,1,1};
			Handle<IImage> whiteImage = renderer->RegisterImage("Gfx/White.tga");
			
			float teamBarTop = 120.f;
			float teamBarHeight = 60.f;
			float contentsLeft = scrWidth * .5f - 400.f;
			float contentsRight = scrWidth * .5f + 400.f;
			float playersHeight = 300.f;
			float playersTop = teamBarTop + teamBarHeight;
			float playersBottom = playersTop + playersHeight;
			
			// draw shadow
			image = renderer->RegisterImage("Gfx/Scoreboard/TopShadow.tga");
			size.y = 32.f;
			renderer->SetColor(MakeVector4(0,0,0,0.2f));
			renderer->DrawImage(image, AABB2(0, teamBarTop-size.y,
											 scrWidth, size.y));
			renderer->SetColor(MakeVector4(0,0,0,0.2f));
			renderer->DrawImage(image, AABB2(0, playersBottom + size.y,
											 scrWidth, -size.y));
			
			// draw scores
			image = renderer->RegisterImage("Gfx/Scoreboard/ScoresBg.tga");
			size = MakeVector2(180.f, 32.f);
			pos = MakeVector2((scrWidth - size.x) * .5f,
							  teamBarTop - size.y);
			renderer->SetColor(MakeVector4(1.f, .45f, .2f, 1.f));
			renderer->DrawImage(image, AABB2(pos.x,pos.y,size.x,size.y));
			
			pos.y = pos.y + 5.f;
			font = client->designFont;
			
			sprintf(buf, "%d", GetTeamScore(0));
			size = font->Measure(buf);
			pos.x = scrWidth * .5f - size.x - 16.f;
			font->Draw(buf, pos + MakeVector2(0, 1), 1.f,
					   MakeVector4(0, 0, 0, 0.3));
			font->Draw(buf, pos, 1.f, whiteColor);
			
			sprintf(buf, "%d", GetTeamScore(1));
			size = font->Measure(buf);
			pos.x = scrWidth * .5f + 16.f;
			font->Draw(buf, pos + MakeVector2(0, 1), 1.f,
					   MakeVector4(0, 0, 0, 0.3));
			font->Draw(buf, pos, 1.f, whiteColor);
			
			sprintf(buf, "-");
			size = font->Measure(buf);
			pos.x = scrWidth * .5f  - size.x * .5f;
			font->Draw(buf, pos + MakeVector2(0, 1), 1.f,
					   MakeVector4(0, 0, 0, 0.3));
			font->Draw(buf, pos, 1.f, whiteColor);
			
			// draw team bar
			image = whiteImage;
			renderer->SetColor(AdjustColor(GetTeamColor(0), 0.8f, 0.3f));
			renderer->DrawImage(image,
								AABB2(0, teamBarTop,
									  scrWidth * .5f, teamBarHeight));
			renderer->SetColor(AdjustColor(GetTeamColor(1), 0.8f, 0.3f));
			renderer->DrawImage(image,
								AABB2(scrWidth * .5f, teamBarTop,
									  scrWidth * .5f, teamBarHeight));
			
			image = renderer->RegisterImage("Gfx/Scoreboard/Grunt.tga");
			size.x = 120.f; size.y = 60.f;
			renderer->DrawImage(image,
								AABB2(contentsLeft, teamBarTop + teamBarHeight - size.y,
									  size.x, size.y));
			renderer->DrawImage(image,
								AABB2(contentsRight, teamBarTop + teamBarHeight - size.y,
									  -size.x, size.y));
			
			font = client->bigTextFont;
			str = world->GetTeam(0).name;
			pos.x = contentsLeft + 110.f;
			pos.y = teamBarTop + 5.f;
			font->Draw(str, pos + MakeVector2(0, 2), 1.f,
					   MakeVector4(0, 0, 0, 0.5));
			font->Draw(str, pos, 1.f, whiteColor);
			
			str = world->GetTeam(1).name;
			size = font->Measure(str);
			pos.x = contentsRight - 110.f - size.x;
			pos.y = teamBarTop + 5.f;
			font->Draw(str, pos + MakeVector2(0, 2), 1.f,
					   MakeVector4(0, 0, 0, 0.5));
			font->Draw(str, pos, 1.f, whiteColor);
			
			// players background
			image = renderer->RegisterImage("Gfx/Scoreboard/PlayersBg.tga");
			renderer->SetColor(MakeVector4(0, 0, 0, 1.f));
			renderer->DrawImage(image,
								AABB2(0, playersTop,
									  scrWidth, playersHeight));
			
			// draw players
			DrawPlayers(0, contentsLeft, playersTop,
						(contentsRight - contentsLeft) * .5f,
						playersHeight);
			DrawPlayers(1, scrWidth * .5f, playersTop,
						(contentsRight - contentsLeft) * .5f,
						playersHeight);
		}