Jump to content

Home

[QuickFix/Guide] Compiling on Visual Studio C++ 2008


TrippHop

Recommended Posts

Step #1: Fixing the resource files:

Inside the win32 folder there are a couple resource files.

Open up JK2cgame.rc, JK2game.rc, and ui.rc with a text editor and change all instances of "afxres.h" to "winresrc.h"

 

inside you will find

#include "afxres.h"

change to:

#include "winresrc.h"

 

also change:

"#include ""afxres.h""\r\n"

to:

"#include ""winresrc.h""\r\n"

 

Step #2: Fixing the powf function conflict

Find all the instances of powf and rename it to Q_powf.

( you will find it once in q_shared.h and q_math.c, twice in cg_view.c )

 

You may choose to use Visual Studio's provided powf function, which yields better results ingame imo, but it may mess up third person aim.

 

Step #3: Fixing botlib

 

Find this function in l_precomp.cpp

int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define, token_t **firsttoken, token_t **lasttoken)

 

and just underneath where it says:

unsigned long t;	//	time_t t; //to prevent LCC warning

 

change it to:

time_t;

 

then look for this in the switch() in the same function:

( this will appear twice, once under case BUILTIN_DATE, and case BUILTIN_TIME )

curtime = ctime((const long *)&t);

 

and change it to:

curtime = ctime(&t);

 

Step #4: Disable warnings

(optional)

paste this into disablewarnings.h after the #ifdef _WIN32

 

//for VS2008
#pragma warning(disable : 4005)		// macro redefinition
#pragma warning(disable : 4996)		// This function or variable may be unsafe...
#pragma warning(disable : 4204)		// nonstandard extension used : non-constant aggregate initializer
#pragma warning(disable : 4431)		// missing type specifier - int assumed. Note: C no longer supports default-int

 

now you are all ready to make your mod.

but i would pay a visit to this thread first:

http://www.lucasforums.com/showthread.php?t=140104

 

if anyone would like to contribute on how to setup the debugger that would be great.

 

I will add a guide later for compiling on linux when i get to it.

Link to comment
Share on other sites

For the debugger, here is my setup..

 

Client Game

Configuration: Debug

Linker -> General -> Output File: ..\..\ArbModding\cgamex86.dll

 

Game

Configuration: Debug

Linker -> General -> Output File: ..\..\ArbModding\jampgamex86.dll

Debugging -> Command: D:\Games\Star Wars Jedi Knight Jedi Academy\GameData\jampded.exe

Debugging -> Command Arguments: +set fs_cdpath "D:\Games\Star Wars Jedi Knight Jedi Academy\GameData" +set fs_game "ArbModding" +set fs_dirbeforepak 1 +set sv_pure 0 +set viewlog 1

Debugging -> Working Directory: ../..

 

User Interface

Configuration: Debug

Linker -> General -> Output File: ..\..\ArbModding\uix86.dll

Debugging -> Command: D:\Games\Star Wars Jedi Knight Jedi Academy\GameData\jamp.exe

Debugging -> Command Arguments: +set fs_cdpath "D:\Games\Star Wars Jedi Knight Jedi Academy\GameData" +set fs_game "ArbModding" +set fs_dirbeforepak 1 +set sv_pure 0 +set viewlog 1 +exec raz0r.cfg

Debugging -> Working Directory: ../..

 

Then set 'User Interface' as your start-up project, and use F5 to run JA.

 

 

Personally, I chose to remove the botlib module as it's completely unused. I also restructured my directories so it's easier to manage.

PM or ask here if anyone needs help setting up and tweaking things.

Link to comment
Share on other sites

  • 4 months later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...