LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   JA Coding (http://www.lucasforums.com/forumdisplay.php?f=539)
-   -   [QuickFix/Guide] Compiling on Visual Studio C++ 2008 (http://www.lucasforums.com/showthread.php?t=201790)

TrippHop 12-07-2009 03:42 AM

[QuickFix/Guide] Compiling on Visual Studio C++ 2008
 
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"

Quote:

inside you will find
Code:

#include "afxres.h"
change to:
Code:

#include "winresrc.h"
also change:
Code:

"#include ""afxres.h""\r\n"
to:
Code:

"#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
Code:

int PC_ExpandBuiltinDefine(source_t *source, token_t *deftoken, define_t *define, token_t **firsttoken, token_t **lasttoken)
and just underneath where it says:
Code:

unsigned long t;        //        time_t t; //to prevent LCC warning
change it to:
Code:

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 )
Code:

curtime = ctime((const long *)&t);
and change it to:
Code:

curtime = ctime(&t);
Step #4: Disable warnings
(optional)
paste this into disablewarnings.h after the #ifdef _WIN32

Code:

//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.

-=*Raz0r*=- 12-11-2009 02:00 AM

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.

TrippHop 04-18-2010 02:54 PM

Sorry guys, I still haven't gotten to writing a linux tutorial yet. I still plan on writing one for linux, and I will also write one for mac. I am just really busy with Uni :P


All times are GMT -4. The time now is 12:33 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.