scoreboard fixed

This commit is contained in:
Magnus Auvinen 2008-08-27 19:50:33 +00:00
parent 8f23204eef
commit ae364d4d29
11 changed files with 46 additions and 33 deletions

View file

@ -14,6 +14,9 @@ extern "C" {
#include "e_if_msg.h"
#include "e_if_modc.h"
#include "e_console.h"
#include "e_config.h"
#ifdef __cplusplus
}
#endif

View file

@ -1,7 +1,7 @@
#ifndef _RINGBUFFER_H
#define _RINGBUFFER_H
typedef struct
typedef struct RINGBUFFER
{
/* what you need */
struct RBITEM_t *next_alloc;

View file

@ -1,7 +1,4 @@
extern "C" {
#include <engine/e_console.h>
}
#include <engine/e_client_interface.h>
#include "binds.hpp"
BINDS::BINDS()

View file

@ -1,15 +1,10 @@
#include <string.h> // strcmp
extern "C" {
#include <engine/e_console.h>
}
#include <engine/e_client_interface.h>
#include <game/generated/g_protocol.hpp>
#include <game/generated/gc_data.hpp>
#include <game/client/gameclient.hpp>
//#include <game/client/gc_anim.hpp>
#include <game/client/gc_client.hpp>
#include "chat.hpp"

View file

@ -3,10 +3,9 @@
#include <base/system.h>
extern "C" {
#include <engine/e_client_interface.h>
#include <engine/e_config.h>
#include <engine/e_console.h>
extern "C" {
#include <engine/e_ringbuffer.h>
#include <engine/client/ec_font.h>
}

View file

@ -1,11 +1,4 @@
extern "C" {
#include <engine/e_client_interface.h>
#include <engine/e_config.h>
#include <engine/e_console.h>
#include <engine/e_ringbuffer.h>
#include <engine/client/ec_font.h>
}
#include <game/client/component.hpp>
class CONSOLE : public COMPONENT
@ -14,11 +7,11 @@ class CONSOLE : public COMPONENT
{
public:
char history_data[65536];
RINGBUFFER *history;
struct RINGBUFFER *history;
char *history_entry;
char backlog_data[65536];
RINGBUFFER *backlog;
struct RINGBUFFER *backlog;
LINEINPUT input;

View file

@ -1,9 +1,4 @@
extern "C" {
#include <engine/e_config.h>
#include <engine/e_console.h>
#include <engine/e_client_interface.h>
}
#include <base/math.hpp>
#include <game/collision.hpp>
#include <game/client/gameclient.hpp>

View file

@ -1,5 +1,4 @@
#include <string.h>
#include <engine/e_client_interface.h>
#include <game/generated/g_protocol.hpp>
#include <game/generated/gc_data.hpp>
@ -8,6 +7,27 @@
#include <game/client/gc_render.hpp>
#include "scoreboard.hpp"
SCOREBOARD::SCOREBOARD()
{
on_reset();
}
void SCOREBOARD::con_key_scoreboard(void *result, void *user_data)
{
((SCOREBOARD *)user_data)->active = console_arg_int(result, 0) != 0;
}
void SCOREBOARD::on_reset()
{
active = false;
}
void SCOREBOARD::on_init()
{
MACRO_REGISTER_COMMAND("+scoreboard", "", con_key_scoreboard, this);
}
void SCOREBOARD::render_goals(float x, float y, float w)
{
float h = 50.0f;
@ -204,6 +224,8 @@ void SCOREBOARD::render_scoreboard(float x, float y, float w, int team, const ch
void SCOREBOARD::on_render()
{
if(!active)
return;
// TODO: repair me
/*

View file

@ -5,7 +5,15 @@ class SCOREBOARD : public COMPONENT
void render_goals(float x, float y, float w);
void render_spectators(float x, float y, float w);
void render_scoreboard(float x, float y, float w, int team, const char *title);
static void con_key_scoreboard(void *result, void *user_data);
bool active;
public:
SCOREBOARD();
virtual void on_reset();
virtual void on_init();
virtual void on_render();
};

View file

@ -21,6 +21,7 @@
#include "components/debughud.hpp"
#include "components/controls.hpp"
#include "components/effects.hpp"
#include "components/scoreboard.hpp"
GAMECLIENT gameclient;
@ -40,6 +41,7 @@ static HUD hud;
static DEBUGHUD debughud;
static CONTROLS controls;
static EFFECTS effects;
static SCOREBOARD scoreboard;
static PLAYERS players;
static ITEMS items;
@ -85,6 +87,7 @@ void GAMECLIENT::on_init()
all.add(chat);
all.add(&broadcast);
all.add(&debughud);
all.add(&scoreboard);
all.add(&motd);
all.add(menus);
all.add(console);

View file

@ -3,9 +3,7 @@
#include <engine/e_client_interface.h>
extern "C" {
#include <engine/e_config.h>
#include <engine/client/ec_font.h>
#include <engine/e_console.h>
};
#include <game/generated/gc_data.hpp>