Rename peer->network (thank you, eclipse!)

This commit is contained in:
simon.kagstrom 2010-02-14 08:10:11 +00:00
parent 7b3cd3555a
commit a0fb08b79f
4 changed files with 16 additions and 16 deletions

View File

@ -214,7 +214,7 @@ public:
char server_hostname[255]; char server_hostname[255];
int server_port; int server_port;
int network_connection_type; int network_connection_type;
Network *peer; Network *network;
int linecnt; int linecnt;
bool fake_key_sequence; bool fake_key_sequence;

View File

@ -60,12 +60,12 @@ void C64::c64_ctor1(void)
sizeof(this->server_hostname)); sizeof(this->server_hostname));
this->server_port = 46214; this->server_port = 46214;
this->network_connection_type = NONE; this->network_connection_type = NONE;
this->peer = NULL; this->network = NULL;
if (network_server_connect) { if (network_server_connect) {
printf("Connecting to %s\n", network_server_connect); printf("Connecting to %s\n", network_server_connect);
strcpy(this->server_hostname, network_server_connect); strcpy(this->server_hostname, network_server_connect);
this->peer = new Network(this->server_hostname, this->server_port); this->network = new Network(this->server_hostname, this->server_port);
this->network_connection_type = CONNECT; this->network_connection_type = CONNECT;
} }
} }
@ -150,9 +150,9 @@ void C64::network_vblank()
Uint32 now = SDL_GetTicks(); Uint32 now = SDL_GetTicks();
#endif #endif
if (this->peer) { if (this->network) {
Uint8 *master = this->TheDisplay->BitmapBase(); Uint8 *master = this->TheDisplay->BitmapBase();
Network *remote = this->peer; Network *remote = this->network;
uint8 *js; uint8 *js;
static bool has_throttled; static bool has_throttled;
@ -161,7 +161,7 @@ void C64::network_vblank()
if (this->network_connection_type != CONNECT) if (this->network_connection_type != CONNECT)
remote->Disconnect(); remote->Disconnect();
delete remote; delete remote;
this->peer = NULL; this->network = NULL;
return; return;
} }
@ -172,10 +172,10 @@ void C64::network_vblank()
else else
js = &TheCIA1->Joystick2; js = &TheCIA1->Joystick2;
} else if (this->network_connection_type == CONNECT) { } else if (this->network_connection_type == CONNECT) {
network_connection_error_t err = this->peer->ConnectFSM(); network_connection_error_t err = this->network->ConnectFSM();
if (err == OK) { if (err == OK) {
if (this->peer->is_master) if (this->network->is_master)
this->network_connection_type = MASTER; this->network_connection_type = MASTER;
else else
this->network_connection_type = CLIENT; this->network_connection_type = CLIENT;
@ -186,7 +186,7 @@ void C64::network_vblank()
if (err == VERSION_ERROR) if (err == VERSION_ERROR)
Gui::gui->status_bar->queueMessage("Get a new version at http://www.c64-network.org"); Gui::gui->status_bar->queueMessage("Get a new version at http://www.c64-network.org");
delete remote; delete remote;
this->peer = NULL; this->network = NULL;
} }
return; return;
} else { } else {
@ -205,7 +205,7 @@ void C64::network_vblank()
/* Disconnect or sending crap, remove this guy! */ /* Disconnect or sending crap, remove this guy! */
Gui::gui->status_bar->queueMessage("Peer disconnected"); Gui::gui->status_bar->queueMessage("Peer disconnected");
delete remote; delete remote;
this->peer = NULL; this->network = NULL;
if (this->network_connection_type == CLIENT) if (this->network_connection_type == CLIENT)
this->Reset(); this->Reset();
this->network_connection_type = NONE; this->network_connection_type = NONE;

View File

@ -926,7 +926,7 @@ void MOS6581::EmulateLine(void)
static NetworkUpdateSoundInfo *cur = NULL; static NetworkUpdateSoundInfo *cur = NULL;
if (!cur) { if (!cur) {
cur = TheC64->peer->DequeueSound(); cur = TheC64->network->DequeueSound();
} }
while (cur) { while (cur) {
@ -936,7 +936,7 @@ void MOS6581::EmulateLine(void)
break; break;
/* Delayed long enough - write to the SID! */ /* Delayed long enough - write to the SID! */
this->WriteRegister(cur->adr, cur->val); this->WriteRegister(cur->adr, cur->val);
cur = TheC64->peer->DequeueSound(); cur = TheC64->network->DequeueSound();
} }
} }
if (TheC64->network_connection_type == MASTER || if (TheC64->network_connection_type == MASTER ||
@ -951,7 +951,7 @@ void DigitalRenderer::WriteRegister(uint16 adr, uint8 byte)
if (TheC64) { if (TheC64) {
if (TheC64->network_connection_type == MASTER) if (TheC64->network_connection_type == MASTER)
TheC64->peer->RegisterSidWrite(TheC64->linecnt, adr, byte); TheC64->network->RegisterSidWrite(TheC64->linecnt, adr, byte);
} }
int v = adr/7; // Voice number int v = adr/7; // Voice number

View File

@ -210,11 +210,11 @@ public:
{ {
PeerInfo *peer = this->peers[which - 1]; PeerInfo *peer = this->peers[which - 1];
TheC64->peer->SelectPeer(peer->hostname, TheC64->network->SelectPeer(peer->hostname,
peer->public_port, peer->server_id); peer->public_port, peer->server_id);
} }
else else
TheC64->peer->CancelPeerSelection(); TheC64->network->CancelPeerSelection();
Gui::gui->popView(); Gui::gui->popView();
} }
@ -229,7 +229,7 @@ public:
virtual void escapeCallback(int which) virtual void escapeCallback(int which)
{ {
TheC64->peer->CancelPeerSelection(); TheC64->network->CancelPeerSelection();
Gui::gui->popView(); Gui::gui->popView();
} }