Comments (3)
The games can be divided into three groups:
- A full cleanup was applied baseq2, xatrix and rogue. They should be as good as it gets.
- ctf has gotten a lesser amount of cleanup, but enough to be fine.
- Everything else is handled on a best effort base. It might be good enough but it's far from being fine.
3zb2 falls into the later group. I hacked this "port" in two hours. I did just enough changes that it builds with a modern toolchain and works good enough for multiplayer testing.
In file included from /home/arjen/dev/Q2RTX/workingdir/_yquake2/3zb2/src/g_ctf.c:1:
/home/arjen/dev/Q2RTX/workingdir/_yquake2/3zb2/src/g_ctf.c: In function ‘SelectCTFSpawnPoint’:
/home/arjen/dev/Q2RTX/workingdir/_yquake2/3zb2/src/header/local.h:537:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
537 | #define FOFS(x) (int)&(((edict_t *)0)->x)
| ^
/home/arjen/dev/Q2RTX/workingdir/_yquake2/3zb2/src/g_ctf.c:410:31: note: in expansion of macro ‘FOFS’
410 | while ((spot = G_Find (spot, FOFS(classname), cname)) != NULL)
| ^~~~
This means that the code isn't 64 bit clean. On x86 / i386 pointers and integers were 32 bit long. It was a common pattern to cast pointers into integers, the code exactly does this. It cannot work on 64 bit platforms like Linux and Unix were pointers are 64 bit and integers stayed at 32 bits. In this case you can properly use size_t
instead: https://github.com/yquake2/xatrix/blob/master/src/header/local.h#L493
3zb2 is under the SDK license which is incompatible to the GPL. You can copy code from the other addons but not from the GPL licensed YQ2 itself and ctf.
from 3zb2.
note that the warnings should be harmless - an unused variable doesn't matter at all, and the FOFS macro is used to calculate the offset of a member of the edict_t struct within that struct, which will easily fit into a 32bit int (as sizeof(edict_t)
is a lot smaller than 2GB). Would probably be cleaner to use offsetof()
than hacking a custom offsetof-like thing, but it should work anyway..
from 3zb2.
I suspected it would be a 32-bit/64-bit issue as it was mentioned on stackoverflow but your explanations I can work with. Thanks.
from 3zb2.
Related Issues (12)
- Cant build with cmake, project files invalid HOT 1
- How do you compile this for windows? HOT 2
- Help Needed on Linux HOT 1
- -arch i386 should be removed for Darwin
- How to run with Yamagi Quake2 on Linux? HOT 2
- Can't build on Windows HOT 1
- [WIP] [Enhancement] Rogue and Zaero support. HOT 4
- Build issues using mingw on windows HOT 2
- Resolve issues found by PVS HOT 3
- CMakeLists.txt tries to build non-existing g_turret.c HOT 1
- locating 3ZBConfig.cfg w/ +basedir
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 3zb2.