aboutsummaryrefslogtreecommitdiffstats
path: root/games/cube
diff options
context:
space:
mode:
authorarved <arved@FreeBSD.org>2007-08-03 22:01:44 +0800
committerarved <arved@FreeBSD.org>2007-08-03 22:01:44 +0800
commit428e9844330d447b4308c45d72eacf6d265fa3c1 (patch)
treee76418aeefdc866ca97c9dff08f21dc38d033ff2 /games/cube
parent3afa058c588cb994db3d426b770b3c8f25004cd4 (diff)
downloadfreebsd-ports-graphics-428e9844330d447b4308c45d72eacf6d265fa3c1.tar.gz
freebsd-ports-graphics-428e9844330d447b4308c45d72eacf6d265fa3c1.tar.zst
freebsd-ports-graphics-428e9844330d447b4308c45d72eacf6d265fa3c1.zip
Fix build on 64bit platforms
Diffstat (limited to 'games/cube')
-rw-r--r--games/cube/files/patch-clientextras.cpp16
-rw-r--r--games/cube/files/patch-server.cpp24
2 files changed, 36 insertions, 4 deletions
diff --git a/games/cube/files/patch-clientextras.cpp b/games/cube/files/patch-clientextras.cpp
new file mode 100644
index 00000000000..592ec6df6c8
--- /dev/null
+++ b/games/cube/files/patch-clientextras.cpp
@@ -0,0 +1,16 @@
+--- clientextras.cpp.orig 2007-08-03 15:45:28.000000000 +0200
++++ clientextras.cpp 2007-08-03 15:46:07.000000000 +0200
+@@ -14,11 +14,11 @@
+ int n = 3;
+ float speed = 100.0f;
+ float mz = d->o.z-d->eyeheight+1.55f*scale;
+- int basetime = -((int)d&0xFFF);
++ intptr_t basetime = -((intptr_t)d&0xFFF);
+ if(d->state==CS_DEAD)
+ {
+ int r;
+- if(hellpig) { n = 2; r = range[3]; } else { n = (int)d%3; r = range[n]; };
++ if(hellpig) { n = 2; r = range[3]; } else { n = (intptr_t)d%3; r = range[n]; };
+ basetime = d->lastaction;
+ int t = lastmillis-d->lastaction;
+ if(t<0 || t>20000) return;
diff --git a/games/cube/files/patch-server.cpp b/games/cube/files/patch-server.cpp
index 316b8130d2d..777abd25b69 100644
--- a/games/cube/files/patch-server.cpp
+++ b/games/cube/files/patch-server.cpp
@@ -1,5 +1,5 @@
---- server.cpp.orig Tue Feb 6 01:26:35 2007
-+++ server.cpp Tue Feb 6 01:27:06 2007
+--- server.cpp.orig 2007-08-03 15:52:35.000000000 +0200
++++ server.cpp 2007-08-03 15:58:58.000000000 +0200
@@ -104,7 +104,7 @@
void disconnect_client(int n, char *reason)
{
@@ -9,8 +9,24 @@
clients[n].type = ST_EMPTY;
send2(true, -1, SV_CDIS, n);
};
-@@ -408,6 +408,9 @@
- send2(true, -1, SV_CDIS, (int)event.peer->data);
+@@ -397,17 +397,20 @@
+ }
+ case ENET_EVENT_TYPE_RECEIVE:
+ brec += event.packet->dataLength;
+- process(event.packet, (int)event.peer->data);
++ process(event.packet, (intptr_t)event.peer->data);
+ if(event.packet->referenceCount==0) enet_packet_destroy(event.packet);
+ break;
+
+ case ENET_EVENT_TYPE_DISCONNECT:
+- if((int)event.peer->data<0) break;
+- printf("disconnected client (%s)\n", clients[(int)event.peer->data].hostname);
+- clients[(int)event.peer->data].type = ST_EMPTY;
+- send2(true, -1, SV_CDIS, (int)event.peer->data);
++ if((intptr_t)event.peer->data<0) break;
++ printf("disconnected client (%s)\n", clients[(intptr_t)event.peer->data].hostname);
++ clients[(intptr_t)event.peer->data].type = ST_EMPTY;
++ send2(true, -1, SV_CDIS, (intptr_t)event.peer->data);
event.peer->data = (void *)-1;
break;
+