| Bugs and fixes | ||
| Watcom compile | ||
| Visual C++ comp. | ||
|
You can aslo subscribe (free) to a developers mailing list. A note on version names: naming conventions are: versions with a "W" in it are test versions compiled with Watcom Open Source. versions with "X" in them are stable releases to the community. |
The bugs and fixes described here date from before the developers mailing list was installed. Since then, many more bugs have been fixed (and created!).
Thanks to moje for helping out in the testing and to DeStRo of course for the WUT program that pointed me in the right direction.
Choppers do not land completely but hop up and down on the landing pad. They are not cleared so that others have to wait resulting in long lines of flying choppers that get no pad assigned. One of the worse examples is Taiwan skirmish 5 for red.
Note: this fix does not solve the "helicopters being
stuck at a powerline" thing, only the waiting lines at airports and farps
that are generated because choppers do not end their mission.
I have tried all kinds of things: lowering and raising the terrain elevation of the airport and farps, tweaking the aircraft size with the "centre_of_gravity_to_ground_distance" and finally settled for two changes:
That's all. In fact I still can't find where the helicopter is actually stopped! It's a complicated system of messages passed to entities of which there are about 1 zillion.
Note: after a brief time the rotors spin down, but
this may take a bit longer especially with large transport choppers.
Note: the behaviour is slightly different from version
1,5,1D but the code may not be exactly the same in the first place as 1.5.1D
is based on an older compiled 1.4.6x version. The result however is pretty
similar.
Sometimes a double mouse is visible (when the resilution in EECH is different from the desktop). This due to a bug in the mouse initialisation files.
- in modules/system/mouse.c (by "Andrew" in the developers forum)
To get rid of the second (windows) cursor when returning to EECH set mouse co-operative to NONEXCLUSIVE in initialise_mouse function :
ret = IDirectInputDevice7_SetCooperativeLevel ( direct_input_mouse, application_window, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
NOTE: there are two instances of this line (thanks Moje)!
To solve the problem with lack of mouse click in 2D until a keyboard key is pressed, clear the ALT modifier. Add the following in beginning of process_mouse_event function :
if ((current_modifier_states & (1 << MODIFIER_LEFT_ALT))
||
(current_modifier_states & (1 << MODIFIER_RIGHT_ALT)))
{
current_modifier_states = MODIFIER_NONE;
}
A bug makes it impossible to load saved campaigns with builds made with VC/gcc or anything that is not watcom.
Faulty function is unpack_bit and pack_bit
in the file APHAVOC\SOURCE\ENTITY\SYSTEM\EN_FUNCS\EN_PACK.C
The following code fixes this bug and for vc adds a much faster version (similar
to watcom). Three steps:
step 1) unpack_bit: Simply replace ifdef/endif braced lines with this:
Code: #ifdef __WATCOMC__
void unpack_bit (int *unpacked_data, unsigned char *unpack_ptr);
#pragma aux unpack_bit = \
"shl byte ptr [edx],1" \
"rcr dword ptr [eax],1" \
parm [eax] [edx] \
modify exact [];
#else
// VC Intel version
#if defined(_MSC_VER) && defined(_M_IX86)
static __inline void unpack_bit (int *unpacked_data, unsigned
char *unpack_ptr)
{
__asm
{
mov eax, [unpack_ptr]
shl byte ptr [eax],1
mov eax, [unpacked_data]
rcr dword ptr [eax],1
}
}
#else
// generic C version
void unpack_bit (int *unpacked_data, unsigned char *unpack_ptr)
{
unsigned int // changed from RW's signed
unpacked_value,
temp;
unsigned char
packed_value;
packed_value = *unpack_ptr;
temp = packed_value;
temp <<= 24; // changed from RW's 23
temp &= 0x80000000;
unpacked_value = *unpacked_data;
unpacked_value >>= 1;
unpacked_value |= temp;
packed_value <<= 1;
*unpacked_data = unpacked_value;
*unpack_ptr = packed_value;
}
#endif
#endif
step 2) pack_bit: Simply replace ifdef/endif braced lines with this:
#ifdef __WATCOMC__
void pack_bit (int *unpacked_data, unsigned char *pack_ptr);
#pragma aux pack_bit = \
"shr dword ptr [eax],1" \
"rcl byte ptr [edx],1" \
parm [eax] [edx] \
modify exact [];
#else
// VC Intel version
#if defined(_MSC_VER) && defined(_M_IX86)
static __inline void pack_bit (int *unpacked_data, unsigned
char *pack_ptr)
{
__asm
{
mov eax, unpacked_data
shr dword ptr[eax],1
mov eax, pack_ptr
rcl byte ptr[eax],1
}
}
#else
// generic C version
void pack_bit (int *unpacked_data, unsigned char *pack_ptr)
{
int
unpacked_value;
unsigned char
packed_value;
packed_value = *pack_ptr;
packed_value <<= 1;
unpacked_value = *unpacked_data;
packed_value |= (unpacked_value & 1);
unpacked_value >>= 1;
*unpacked_data = unpacked_value;
*pack_ptr = packed_value;
}
#endif
#endif
step 3) At this point saved games loads but alas, we have an exception soon.
To prevent it we need to swap lines in APHAVOC\SOURCE\ENTITY\SYSTEM\EN_COMMS\EN_SESSN.C
in original source from RW swap lines 1394 with 1396 so they look like this:
entity_smoke_list_creation = entity_smoke_list_creation->next;
free_mem (this_smoke_list_creation);
and lines 1442 with 1444 to look like this:
entity_sound_effect_creation = entity_sound_effect_creation->next;
free_mem (this_sound_effect_creation);
Here is how to compile the source code with the free Open Watcom compiler.
The code can be compiled using the following adaptions (thanks to everybody at the Biohazcentral EECH developers forum!):
- makefile:
- make a directory linklib under /modules and copy all the libs in DXSDK\lib to that new dir
- then copy the watcom version of dsound.lib (from watcom\lib386\nt\) to the \modules\linklib and overwrite the version from dx9
- copy all the h-files in DXSDK/include to /watcom/h/nt
- in watcom/h float.h: decrease FLT_MAX: #define FLT_MAX 3.402823e+38f (line 86)
- in watcom/h/nt in strmif.h comment out all code between the #ifndef and #endif (line 6182):
/*
#ifndef _WINGDI_
[...]
#endif
*/
If you do not use the CVS version of the code:
- in modules\system.h: add
#define DIRECTINPUT_VERSION 0x0700
#include "vwf.h" changed to #include <vfwmsgs.h> (line 381)
- in aphavoc\source\entity\special\group\gp_ptr.c (line
170)
void overload_group_ptr_value_functions (entity_types type)
changed to
void overload_group_ptr_value_functions (void)
- in aphavoc\source\entity\special\guide\gd_ptr.c (line 197) change to void:
void overload_guide_ptr_value_functions (void) //(entity_types type)
- in dirsound.c add:
#include "d3d.h"- in vslider.h (modules\userint\ui_obj\slider and ..\userint2\.. changed:
extern void vslider_move_function (void *ev);
to:
extern void vslider_move_function (event *ev);
Compiliing with version 1.2 of Watcom
From Craigmire in the SimHQ forum:
If you want to use Watcom version 1.2 here's how I got it to work for me:
I dug out of the forum at the watcom site that some of the automatically included libraries that were defaults in earlier versions had been left out of version 1.2. You get about 20 undefined references that are defined in winmm.lib or ws2_32.lib. There is a settings file in watcom where these can be added back in but I took the simpler approach. I changed the link section of the ...\aphavoc\makefile file to look like this:
########################################
#
# HOW TO MAKE TARGET
#
########################################
!ifdef visualc
$(projectname).exe : $(c_object_files) $(c_module_object_files) $(projectname).lnk
link @$(projectname).lnk
!else
$(projectname).exe : $(c_object_files) $(c_module_object_files) $(projectname).lnk
wlink library winmm library ws2_32 @$(projectname).lnk
!endif
in other owrds add the "wlink library winmm library" to the last line
That should do it. Good luck!
*** This info is probably outdated ***
Here are the workspace files for VC6, thanks to "Xhit"
The directories for include and lib files have to be set to point to the apropiate directx library and include, and also have to point to the /modules and /aphavoc/source dirs.
The following lines have to be added to system.h
#define DIRECTINPUT_VERSION 0x0700
#define ENV_NAME """COMANCHE_HOKUM"""
#define MAJOR_VERSION 1
#define DATA_VERSION 4
#define MINOR_VERSION 7
#define BUILD_TYPE """X"""
#define APP_NAME """Enemy Engaged RAH66 Comanche Vs KA52 Hokum v1.4.7X"""
You may have to include some of the changes mentioned above in the watcom compilation
VC6 release workspace files: here
VC6 debug workspace files: here
![]()