Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Trouble with the Counts

edited 2006 Feb 9 in Developers
<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>

Comments

  • <blockquote>Danij, you have set up map data counters (numlines, numsides, etc.) in p_mapsetup.c on game-side in addition to the engine's map data counters. These strike me as redundant.</blockquote>
    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.
  • <blockquote>Is it just these counters that are a problem?</blockquote>All global identifiers are affected. This means functions and variables. No function or global variable in the engine should have the same name as one in a game lib (or other dynamically linked lib).

    So far I haven't discovered any other name clashes, but then again I haven't gotten very far in my debugging yet. :)
  • Hows progress on the debugging?
  • I haven't had much time to do anything related to Doomsday. I'll continue with the debugging and trying to get jHexen running and loading a map during the weekend.
Sign In or Register to comment.