summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--The Mana World.dev22
-rw-r--r--src/main.cpp2
-rw-r--r--src/net/network.cpp24
-rw-r--r--src/net/network.h3
-rw-r--r--tmw.cbp10
6 files changed, 52 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index d2e0ee22..e77de982 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-11-09 Eugenio Favalli <elvenprogrammer@gmail.com>
+
+ * src/main.cpp, src/net/network.cpp, src/net/network.h,
+ The Mana World.dev, tmw.cbp: Fixed a conflict with Windows headers and
+ updated project files.
+
2006-11-05 Bjørn Lindeijer <bjorn@lindeijer.nl>
* src/gui/trade.cpp: Fixed money field to no longer hide below the
diff --git a/The Mana World.dev b/The Mana World.dev
index 4c250deb..1d731b14 100644
--- a/The Mana World.dev
+++ b/The Mana World.dev
@@ -1,7 +1,7 @@
[Project]
FileName=The Mana World.dev
Name=tmw
-UnitCount=237
+UnitCount=239
Type=0
Ver=1
ObjFiles=
@@ -2427,3 +2427,23 @@ Priority=1000
OverrideBuildCmd=0
BuildCmd=
+[Unit238]
+FileName=src\gui\shoplistbox.cpp
+CompileCpp=1
+Folder=tmw
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
+[Unit239]
+FileName=src\gui\shoplistbox.h
+CompileCpp=1
+Folder=tmw
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
diff --git a/src/main.cpp b/src/main.cpp
index 8cd993fb..0e0fad2f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -578,7 +578,7 @@ int main(int argc, char *argv[])
network->flush();
network->dispatchMessages();
- if (network->getState() == Network::ERROR)
+ if (network->getState() == Network::NET_ERROR)
{
state = ERROR_STATE;
errorMessage = "Got disconnected from server!";
diff --git a/src/net/network.cpp b/src/net/network.cpp
index a7ff6d1d..8da0033d 100644
--- a/src/net/network.cpp
+++ b/src/net/network.cpp
@@ -107,7 +107,7 @@ Network::~Network()
{
clearHandlers();
- if (mState != IDLE && mState != ERROR)
+ if (mState != IDLE && mState != NET_ERROR)
disconnect();
SDL_DestroyMutex(mMutex);
@@ -118,7 +118,7 @@ Network::~Network()
bool Network::connect(const std::string &address, short port)
{
- if (mState != IDLE && mState != ERROR)
+ if (mState != IDLE && mState != NET_ERROR)
{
logger->log("Tried to connect an already connected socket!");
return false;
@@ -127,7 +127,7 @@ bool Network::connect(const std::string &address, short port)
if (address.empty())
{
logger->log("Empty address given to Network::connect()!");
- mState = ERROR;
+ mState = NET_ERROR;
return false;
}
@@ -146,7 +146,7 @@ bool Network::connect(const std::string &address, short port)
if (!mWorkerThread)
{
logger->log("Unable to create network worker thread");
- mState = ERROR;
+ mState = NET_ERROR;
return false;
}
@@ -233,7 +233,7 @@ void Network::flush()
if (ret < (int)mOutSize)
{
logger->log("Error in SDLNet_TCP_Send(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
}
mOutSize = 0;
SDL_mutexV(mMutex);
@@ -287,7 +287,7 @@ MessageIn Network::getNextMessage()
{
while (!messageReady())
{
- if (mState == ERROR)
+ if (mState == NET_ERROR)
break;
}
@@ -315,7 +315,7 @@ bool Network::realConnect()
if (SDLNet_ResolveHost(&ipAddress, mAddress.c_str(), mPort) == -1)
{
logger->log("Error in SDLNet_ResolveHost(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
return false;
}
@@ -325,7 +325,7 @@ bool Network::realConnect()
if (!mSocket)
{
logger->log("Error in SDLNet_TCP_Open(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
return false;
}
@@ -344,14 +344,14 @@ void Network::receive()
if (!(set = SDLNet_AllocSocketSet(1)))
{
logger->log("Error in SDLNet_AllocSocketSet(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
return;
}
if (SDLNet_TCP_AddSocket(set, mSocket) == -1)
{
logger->log("Error in SDLNet_AddSocket(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
}
while (mState == CONNECTED)
@@ -382,7 +382,7 @@ void Network::receive()
else if (ret < 0)
{
logger->log("Error in SDLNet_TCP_Recv(): %s", SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
}
else {
mInSize += ret;
@@ -408,7 +408,7 @@ void Network::receive()
// more than one socket is ready..
// this should not happen since we only listen once socket.
logger->log("Error in SDLNet_TCP_Recv(), %d sockets are ready : %s", numReady, SDLNet_GetError());
- mState = ERROR;
+ mState = NET_ERROR;
break;
}
}
diff --git a/src/net/network.h b/src/net/network.h
index f4637f73..13929ec1 100644
--- a/src/net/network.h
+++ b/src/net/network.h
@@ -63,12 +63,13 @@ class Network
void dispatchMessages();
void flush();
+ // ERROR replaced by NET_ERROR because already defined in Windows
enum {
IDLE,
CONNECTED,
CONNECTING,
DATA,
- ERROR
+ NET_ERROR
};
protected:
diff --git a/tmw.cbp b/tmw.cbp
index 25bddfa4..3a1295c9 100644
--- a/tmw.cbp
+++ b/tmw.cbp
@@ -659,6 +659,16 @@
<Option link="0"/>
<Option target="default"/>
</Unit>
+ <Unit filename="src\gui\shoplistbox.cpp">
+ <Option compilerVar="CPP"/>
+ <Option target="default"/>
+ </Unit>
+ <Unit filename="src\gui\shoplistbox.h">
+ <Option compilerVar=""/>
+ <Option compile="0"/>
+ <Option link="0"/>
+ <Option target="default"/>
+ </Unit>
<Unit filename="src\gui\skill.cpp">
<Option compilerVar="CPP"/>
<Option target="default"/>