Let me know if you'd like to see anything in more
detail.
Project directory structure
The directory structure of the project is modified from the original
source release to be more lcc-win32-friendly:
qs-lcc: c sources for glQuake.
-doc: Docs about this port.
--origdoc: The gnu licence
and other source docs.
-gas2masm: A separate lcc project for gas2masm.
--lcc: Release directory
for gas2masm. Contains gas2masm.exe.
-lcc: Release directory for glQuake. Contains the glquake.exe.
-lib: Libraries. See library notes below. Contains opengl32.lib
and quakeasm.lib
-libsrc: Library source.
Libraries
The opengl32.lib (import library) that comes with lcc does not contain
all the imports required by glQuake. The missing ones were pasted
from the opengl.exp file as necessary and a new opengl32.lib was built.
Note that this does not include all missing openGL imports, so additional
imports may be needed if more opengl features are added.
I put assembly into a static library for convenience. If you wish
to rebuild or modify this library yourself you will need to install MASM.
Steps to create the assembly library:
-
Create preprocessor output file: lcc -EP -DGLQUAKE
math.s This will write a file called math.i.
-
Remove extra spaces in math.i and rename to math.spp. gas2masm is
expecting a preprocessor output file in the format Visual C++ uses.
lcc's preprocessor output is slightly different because it creates additional
spaces at some points in the text. There may be some other differences
as well, but only the additiona spaces seem to be a problem. These
additional spaces must be found and deleted. To find them, run gas2masm
<math.i >math.asm and it will give some sort of error
and a line number. Go to the line number and you will find the spaces.
If the spaces don't stand out from spaces that should be there, you can
compare the line to a similar line in an .spp file I've already corrected
(search these files w/ grep), compare the line to a similar line in an
.spp file output from VC++, or use good old trial and error. Repeat
the process until gas2masm converts the file successfully. Search
and replace may come in handy. Yes, what a pain!
-
Once you get the .i file to convert to asm, (Hooray!) you can rename it
to .spp if you wish. I did it for convention and to keep from accidentally
deleting it.
-
Running masm on it outputs the .obj: ml
/c /Cp /coff /Zm /Zi math.asm
-
Make a static library: lcclib quakeasm.lib
*.obj
Changes from the original released source
-
Grep for //QS-LCC to see changes.
Quite a few changes throughout the source to add proQuake, all are commented
with "JPG". Numerous minor differences from the orginal proQuake.
See the Quake Info Pool for information regarding bug fixes commented
with "Maddes". Source from QIP includes work by various people as
commented.
Quake Engine Resources tutorial 4, motion and animation interpolation,
is applied with the exception of shadow interpolation (shadows really need
a complete overhaul to volumetric to be useable). Look for "fenix"
in the code.
Show frames per second and water ripple from QuakeForge. Look
for "QuakeForge".
The changes I made in the source are commented with "jf". Deletion of
unreferenced variables is an exception to this rule. The following
is a search(grep) of my changes as of 18 Jan. as and example to help you
find them:
Wedit output window search:
Tue Jan 18 00:31:50 2000
Searching for 'jf' in
'*.c *.h': 48 hits.
[net_wipx.c:42] //jf
The structure sockaddr_ipx is not in lcc includes. Definition is added
here.
[net_wipx.c:50] //jf
Several protocol family defines are not in lcc includes. Added here.
[console.c:26] #include
<io.h> //jf Instead of <unistd.h>.
[cd_win.c:24] #include
<mmsystem.h> //jf Add this include.
[common.c:1066] //jf
Comment out the Sys_Error below to play your own TOTAL conversion
[common.c:1067] //jf
without the need for the standard pak0.pak.
[common.c:1068] //jf
Sys_Error ("You must have the registered version to use modified games");
[conproc.c:23] #include
<ctype.h> //jf add this include for isalpha, iswhatever prototypes
[gl_draw.c:147] return
(0); //jf Dummy return to appease compiler warning.
[gl_rsurf.c:894] //jf
Just a question: Is there any reason to
[gl_rsurf.c:895] //jf
keep both versions of function R_DrawWaterSurfaces?
[gl_rsurf.c:1432] return
0; //jf just to appease compiler warning.
[in_win.c:875] //jf
Make this switch statement technically correct. Another compiler
[in_win.c:876] //jf
warning message bites the dust!
[in_win.c:877] //jf
case JOY_AXIS_V:
[in_win.c:878] //jf
return &ji.dwVpos;
[in_win.c:880] return
&ji.dwVpos; //jf the default
[mathlib.c:88] //jf
Pragma to not optimize w/ VC++... any problem for lcc?
[mathlib.c:89] //jf
#ifdef _WIN32
[mathlib.c:90] //jf
#pragma optimize( "", off )
[mathlib.c:91] //jf
#endif
[mathlib.c:149] //jf
turn optimizations back on for VC++...what about lcc?
[mathlib.c:150] //jf
#ifdef _WIN32
[mathlib.c:151] //jf
#pragma optimize( "", on )
[mathlib.c:152] //jf
#endif
[net_dgrm.c:23] //#define
BAN_TEST jf- Maybe get this to work later. Pointless with open source.
[snd_mix.c:23] //jf
In general- change all "short" to "unsigned short"
[sys_win.c:27] #include
<direct.h> //jf Add header. It defines mkdir.
[sys_win.c:249] mkdir
(path); //jf mkdir instead of _mkdir in response
[sys_win.c:250] //jf
to "no prototype for _mkdir" warning.
[glquake.h:253] //jf
Added prototypes that were missing.
[glquake.h:268] //jf
Several prototypes moved from r_local.h to here.
[quakedef.h:328] extern
int r_pixbytes; //jf This is defined in r_main.
[quakedef.h:340] //jf
More missed prototypes.
[r_local.h:250] /*jf
moved particle prototypes to glquake.h
[r_local.h:304] //jf
Moved a few of the following prototypes to glquake.h,
[r_local.h:305] //jf
where modules that need them can see them, such as gl_rsurf.c.
[r_local.h:307] //jf
void R_StoreEfrags (efrag_t **ppefrag);
[r_local.h:313] //jf
void R_AnimateLight (void);
[r_local.h:320] //jf
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
[winquake.h:25] #include
<ws2spi.h> //jf Add include for lcc.
[winquake.h:26] #include
<mmsystem.h> //jf Add include for lcc.
[winquake.h:30] //jf
Add standard change display settings flags which are not in lcc includes
[winquake.h:42] #include
<dsound.h> //jf You must correct a typo(?) in lcc's dsound.h!
[winquake.h:43] //jf
change: STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX);
[winquake.h:44] //jf
to: STDMETHOD(SetFormat) (THIS_ LPWAVEFORMATEX);
[winquake.h:91] void
IN_Accumulate (void); //jf this prototype was missing.
[winquake.h:110] LONG
CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
//jf Added missing prototype.
: : |