danishpastery / libnltrack

Automatically exported from code.google.com/p/libnltrack
0 stars 0 forks source link

Memory Allocation for 2d array float terrainHeight[][] in NlTrack Structure is too small for high detail terrain setting #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
/* NLTRACK type */
typedef struct
{
    /* NLIM */
    int nlimsize;
    char major;
    char minor;
    char revision;
    char markup;
    char reserved;
    int use16friction;

    /* TRCK */
  int trcksize;
  int style;
  int numTrains;
  int numCars;

    Train *train;
    Color trackSpineColor, trackRailColor, trackCrosstieColor;
    Color supportsColor;
    Color trainSeatColor;
    Color trainRestraintColor;
    Color trainColor;
    Color trainGearColor;
    char reserved0, reserved1, reserved2, reserved3;
    int trackMode;
    int useTunnelColor;
    Color tunnelColor;

    /* INFO */
    int infosize;
    char *authorComments;

    /* BEZR */
    int bezrsize;
    int numBeziers;
    Bezier *beziers;

    /* SEGM */
    int segmsize;
    int totalSegments;
    int trackClosedCircuit;
    SEGMSegment *segs;

    /* SUPP */
    int suppsize;

    /* FUND */
  int fundsize;
  int totalFundNodes;
  FundNode *fundNodes;

    /* RASC */
  int rascsize;
  int totalSegment;
  SegmentNodes *seg;

    /* FREN */
  int frensize;
  int totalFreeNodes;
  FreeNode *freeNodes;

    /* TUBE */
    int tubesize;
    int totalTubes;
    Tube *tubes;

    /* CATW */
  int catwsize;
  int totalCatwalks;
  Catwalk *catwalks;

    /* SCEN */
    int scensize;
    int chunkscen;
    int totalTrees;
    Tree *trees;

    /* SCOB */
    int scobsize;
    int totalObjects;
    SCOBObject *objects;

    /* ENVC */
    int envcsize;
    char *envFilename, *reservedString;

    /* TERA */
    int terasize;
    int sizeX, sizeZ;
    float scaleX, scaleZ;
    char *groundTextureFilename;
    float numGroundTextureRepeats;
    char *detailTextureFilename;
    float numDetailTextureRepeats;
    int enableWater;
    float seaLevel;
    char *waterTextureFilename;
    float numWaterTextureRepeats;
    char waterReflectiveness;
    int useWaves;
    float waveScale;
    float terrainHeight[300][300];
} NlTrack;

!!! float terrainHeight[300][300] !!!

300x300 is too small in high detail terrain mode. I modified it in 450x450 and 
recompiled. Now seems to work fine on my tracks.
I compiled it on MinGW GCC 4.5.2. 
I attach the compiled library and header. 

!!! Be Careful !!! Not fully Tested yet...

Original issue reported on code.google.com by joshua9...@gmail.com on 17 Apr 2011 at 1:24

GoogleCodeExporter commented 8 years ago
... dont know if providing compiled library violates the license statements. I 
removed the files. Sorry.

Original comment by joshua9...@gmail.com on 17 Apr 2011 at 1:29

GoogleCodeExporter commented 8 years ago
Please send me an eMail to ercan.akyuerek@gmail.com ...
Have more Ideas ;)

Original comment by ercan.ak...@googlemail.com on 18 Apr 2011 at 11:22