The Ur-Quan Masters Discussion Forum

The Ur-Quan Masters Re-Release => General UQM Discussion => Topic started by: Anarchy_Balsac on December 16, 2005, 04:21:37 am



Title: Questions about the source code
Post by: Anarchy_Balsac on December 16, 2005, 04:21:37 am
1). Do you need all 3 of the files specified in the downloads section to modify and compile it, or just one?

2). Does anyone know what the function that defines the kohr-ah death march looks like or is called?

3). Same as #2, but this time I'm looking for the one that periodically subtracts fuel as your travelling.


Title: Re: Questions about the source code
Post by: Novus on December 16, 2005, 09:39:12 am
1). Do you need all 3 of the files specified in the downloads section to modify and compile it, or just one?
If you mean SDL, SDL_image and libogg/libvorbis, the answer is yes.

Quote
2). Does anyone know what the function that defines the kohr-ah death march looks like or is called?
src/sc2code/gameev.c contains a lot of code related to the Kohr-Ah death march (especially black_urquan_genocide). src/sc2code/globdata.h contains the constant YEARS_TO_KOHRAH_VICTORY that defines when it starts.

Quote
3). Same as #2, but this time I'm looking for the one that periodically subtracts fuel as your travelling.
MoveSIS in src/sc2code/hyper.c calls DeltaSISGauges to decrement fuel.


Title: Re: Questions about the source code
Post by: Anarchy_Balsac on December 17, 2005, 05:09:08 am
Hmm, these appear to be libraries rather than actual programs. What programming language do I need then? C or C++? I have C++(though not with me at the moment), but could easily get C if I had to. Still, I need to know which.


Title: Re: Questions about the source code
Post by: JonoPorter on December 17, 2005, 07:37:32 am
Hmm, these appear to be libraries rather than actual programs. What programming language do I need then? C or C++? I have C++(though not with me at the moment), but could easily get C if I had to. Still, I need to know which.
It's written in C.


Title: Re: Questions about the source code
Post by: Novus on December 17, 2005, 01:58:02 pm
Hmm, these appear to be libraries rather than actual programs. What programming language do I need then? C or C++? I have C++(though not with me at the moment), but could easily get C if I had to. Still, I need to know which.
I'm assuming "I have C++" means "I have [insert brand here] C++ compiler". Practically every C++ compiler can compile C just fine, so you shouldn't have any problems with that.


Title: Re: Questions about the source code
Post by: Anarchy_Balsac on December 18, 2005, 01:37:40 am
Alright, So far I've found these:

if (dx == 0 && dy == 0)
         {
            // Arrived at the victim's home world. Cleanse it.
            TemplatePtr->ShipInfo.ship_flags &= ~(GOOD_GUY | BAD_GUY);
            TemplatePtr->ShipInfo.actual_strength = 0;
         }

if (best_dist < 0 && best_dx == 0 && best_dy == 0)
   {
      // All spheres of influence are gone - game over.
      GLOBAL (CurrentActivity) &= ~IN_BATTLE;
      GLOBAL_SIS (CrewEnlisted) = (COUNT)~0;

      SET_GAME_STATE (KOHR_AH_KILLED_ALL, 1);
   }

Those are the main problem. Although I should be able to eliminate the function altogether without problem.

Lastly, I may as well ask how to make sure my compiler compiles the whole source code, instead of just one file. Oh and where the game decrements fuel when landing on planets(cus that's annoying too).