Author Topic: Code crashing calc  (Read 35875 times)

0 Members and 1 Guest are viewing this topic.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Code crashing calc
« Reply #15 on: August 02, 2010, 12:26:13 am »
What is your texture list?

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Code crashing calc
« Reply #16 on: August 02, 2010, 10:25:13 am »
The one already there.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Code crashing calc
« Reply #17 on: August 02, 2010, 12:39:10 pm »
Post your code.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Code crashing calc
« Reply #18 on: August 02, 2010, 12:50:06 pm »
My generate function does not make changes to anything but its internal variables. Aside from calling generate once, the only other change I made was to testlevel.c, as I described above.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Code crashing calc
« Reply #19 on: August 02, 2010, 01:06:37 pm »
Post testlevel.c.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Code crashing calc
« Reply #20 on: August 02, 2010, 04:40:57 pm »
Here it is.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Code crashing calc
« Reply #21 on: August 02, 2010, 06:06:14 pm »
Your height array is incorrect, I think. The rows have been shifted a bit, so now the spaces on your map are getting the wrong height data.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Code crashing calc
« Reply #22 on: August 03, 2010, 02:45:27 pm »
I fixed that, and now I can see the blocks, but the height of the camera looks wrong, and I can't move around. I'm attaching the whole source directory.

Offline bwang

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 634
  • Rating: +30/-11
    • View Profile
Re: Code crashing calc
« Reply #23 on: August 03, 2010, 04:14:42 pm »
I messed around with your code, and discovered that you are doing something really weird in maze.c, which messes up the external variables in testlevel.c. The Nspire's support for global variables is pretty delicate at the moment, so if something doesn't work, try moving the contents of testlevel.c into main().
You probably want to have generate() take paramenters, so it should look something like:
Code: [Select]
void generate(int* maze)
where maze is the array you are writing to.
Oh, and random thought: I feel slightly happier about Ncaster now. With a map that dense, I was expecting it to be unbearably slow, but apparently that's not happening :).
« Last Edit: August 03, 2010, 04:16:00 pm by bwang »