Trouble with the Counts
<i>This post was originally made by <b>skyjake</b> on the dengDevs blog. It was posted under the categories: Games, Mac OS X, Unix/Linux.</i>
Danij, you have set up map data counters (numlines, numsides, etc.) in <tt>p_mapsetup.c</tt> on game-side in addition to the engine's map data counters. These strike me as redundant. Also, on Linux and Mac global variables from the engine and the game lib are in the same namespace, which wreaks havoc on map loading.
Wouldn't it be enough that the games just call DD_GetInteger(DD_LINE_COUNT), etc. when they need the counts? To make the transition easier, just use #define on game-side:
<pre>#define numlines DD_GetInteger(DD_LINE_COUNT)</pre>
Danij, you have set up map data counters (numlines, numsides, etc.) in <tt>p_mapsetup.c</tt> on game-side in addition to the engine's map data counters. These strike me as redundant. Also, on Linux and Mac global variables from the engine and the game lib are in the same namespace, which wreaks havoc on map loading.
Wouldn't it be enough that the games just call DD_GetInteger(DD_LINE_COUNT), etc. when they need the counts? To make the transition easier, just use #define on game-side:
<pre>#define numlines DD_GetInteger(DD_LINE_COUNT)</pre>
Comments
Yes, I only did that to save having to retrieve the values from Doomsday each time but it won't make much (if any) difference.
<blockquote>Also, on Linux and Mac global variables from the engine and the game lib are in the same namespace, which wreaks havoc on map loading.</blockquote>
Ah, I did not know that. Is it just these counters that are a problem?
<blockquote>To make the transition easier, just use #define on game-side</blockquote>
Will do.
So far I haven't discovered any other name clashes, but then again I haven't gotten very far in my debugging yet.