Updated build number

--Editor fixes from Kriplo
Implementation for mouse wheel support
Implementation for mouse middle button support
Fix for adding on roof tiles
Fix assertion when leave editor mode
On saving map check of entry points are add
Fix for to many ToolTip messages in place walls
Fix assertion on loading map without entry points
Fix assertion in Sector Summary if DevInfo directory not exist
Fix for problem of losing map edgepoints
Fix problem with losing stuff from LBE
Fix crash in meanwhile
--Fixes from Headrock
Fixed a typo in the Health experience calcuation for strategic movement
Added "Draw" cost to weapons help data


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2375 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-10-13 21:05:28 +00:00
parent fa21f87a59
commit 26201b3816
16 changed files with 117 additions and 26 deletions
+1 -7
View File
@@ -462,13 +462,7 @@ void InitEditorBuildingsToolbar()
//Selection method buttons
iEditorButton[BUILDING_PLACE_WALLS] =
CreateEasyToggleButton( iScreenWidthOffset + 180,2 * iScreenHeightOffset + 370,"EDITOR//wall.sti", BuildingWallCallback);
//SetButtonFastHelpText(iEditorButton[BUILDING_PLACE_WALLS],L"Place walls using selection method");
SetButtonFastHelpText(iEditorButton[BUILDING_PLACE_WALLS],
L"Place walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\nPlace walls using selection method\n");
SetButtonFastHelpText(iEditorButton[BUILDING_PLACE_WALLS],L"Place walls using selection method");//dnl fix for to many tooltip message in place walls
iEditorButton[BUILDING_PLACE_DOORS] =
CreateEasyToggleButton( iScreenWidthOffset + 210,2 * iScreenHeightOffset + 370,"EDITOR//door.sti", BuildingDoorCallback);
SetButtonFastHelpText(iEditorButton[BUILDING_PLACE_DOORS],L"Place doors using selection method");
+8 -2
View File
@@ -2480,8 +2480,14 @@ void WriteSectorSummaryUpdate( STR8 puiFilename, UINT8 ubLevel, SUMMARYFILE *pSu
GetExecutableDirectory( ExecDir );
sprintf( Dir, "%s\\DevInfo", ExecDir );
if( !SetFileManCurrentDirectory( Dir ) )
AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");
//AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");//dnl lead to assertion if you don't have Dir and never create summary info
{//dnl
//Directory doesn't exist, so create it, and continue.
if( !MakeFileManDirectory( Dir ) )
AssertMsg( 0, "Can't create new directory, JA2\\DevInfo for summary information update." );
if( !SetFileManCurrentDirectory( Dir ) )
AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");
}
ptr = strstr( (CHAR8 *)puiFilename, ".dat" );
if( !ptr )
AssertMsg( 0, "Illegal sector summary filename.");
+4 -1
View File
@@ -361,6 +361,9 @@ void PasteSingleWallCommon( UINT32 iMapIndex )
// TEMP STUFF FOR ONROOF THINGS!
if ( (usUseObjIndex >= FIRSTONROOF) && (usUseObjIndex <= SECONDONROOF ) )
{
//dnl Remove all onroof things before placing new one to avoid stacking problems of same element
RemoveAllOnRoofsOfTypeRange( iMapIndex, FIRSTONROOF, SECONDONROOF );
// Add to onroof section!
AddOnRoofToTail( iMapIndex, (UINT16)(gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) );
@@ -577,7 +580,7 @@ void PasteStructureCommon( UINT32 iMapIndex )
fOkayToAdd = OkayToAddStructureToWorld( (INT16)iMapIndex, 0, gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef, INVALID_STRUCTURE_ID );
if ( fOkayToAdd || (gTileDatabase[ (gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) ].pDBStructureRef == NULL) )
{
//dnl Remove existing structure before adding the same, seems to solve problem with stacking but possibly dangerous and completly untested
//dnl Remove existing structure before adding the same, seems to solve problem with stacking but still need test to be sure that is not removed something what should stay
RemoveStruct( iMapIndex, (UINT16)(gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) );//dnl
// Actual structure info is added by the functions below
AddStructToHead( iMapIndex, (UINT16)(gTileTypeStartIndex[ usUseObjIndex ] + usUseIndex) );
+4
View File
@@ -73,6 +73,7 @@
#include "Soldier Profile.h"
#include "GameSettings.h"
#include "Summary Info.h"
#include "connect.h"//dnl
#endif
//forward declarations of common classes to eliminate includes
@@ -286,6 +287,9 @@ BOOLEAN EditModeInit( void )
OutputDebugString( "Entering editor mode...\n" );
//dnl after multiplayer stuff was implemeted, editor goes to assertion when you leave editor mode, because InitGameOption() is not called anymore from InitializeGame()
is_networked = FALSE;
InitGameOptions();
gfRealGunNut = gGameOptions.fGunNut;
gGameOptions.fGunNut = TRUE;
+4 -4
View File
@@ -13,12 +13,12 @@
#ifdef JA2EDITOR
//MAP EDITOR BUILD VERSION
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2350" };
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.2375" };
#elif defined JA2BETAVERSION
//BETA/TEST BUILD VERSION
CHAR16 zVersionLabel[256] = { L"Debug v1.13.2350" };
CHAR16 zVersionLabel[256] = { L"Debug v1.13.2375" };
#elif defined CRIPPLED_VERSION
@@ -28,11 +28,11 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else
//RELEASE BUILD VERSION
CHAR16 zVersionLabel[256] = { L"Release v1.13.2350" };
CHAR16 zVersionLabel[256] = { L"Release v1.13.2375" };
#endif
CHAR8 czVersionNumber[16] = { "Build 08.09.15" }; //YY.MM.DD
CHAR8 czVersionNumber[16] = { "Build 08.10.13" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
+58
View File
@@ -1,3 +1,4 @@
#define _WIN32_WINNT WINVER//dnl this should be defined globaly on project
#ifdef JA2_PRECOMPILED_HEADERS
#include "JA2 SGP ALL.H"
#elif defined( WIZ8_PRECOMPILED_HEADERS )
@@ -5,6 +6,7 @@
#else
#include "types.h"
#include <windows.h>
#include <winuser.h>//dnl
#include <stdio.h>
#include <memory.h>
#include "debug.h"
@@ -67,6 +69,8 @@ UINT32 guiRightButtonRepeatTimer;
BOOLEAN gfTrackMousePos; // TRUE = queue mouse movement events, FALSE = don't
BOOLEAN gfLeftButtonState; // TRUE = Pressed, FALSE = Not Pressed
BOOLEAN gfRightButtonState; // TRUE = Pressed, FALSE = Not Pressed
BOOLEAN gfMiddleButtonState;//dnl TRUE = Pressed, FALSE = Not Pressed
INT16 gsMouseWheelDeltaValue;//dnl positive value indicates that the wheel was rotated forward, negative value indicates that the wheel was rotated backward, and user handler procedure for mouse wheel should restore after usege this value to zero!
INT16 gusMouseXPos; // X position of the mouse on screen
INT16 gusMouseYPos; // y position of the mouse on screen
@@ -208,6 +212,60 @@ LRESULT CALLBACK MouseHandler(int Code, WPARAM wParam, LPARAM lParam)
// Trigger an input event
QueueEvent(RIGHT_BUTTON_UP, 0, uiParam);
break;
//dnl begin part for additional mouse events
case WM_MBUTTONDOWN:
// Update the current mouse position
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
ScreenToClient(ghWindow, &mpos);
gusMouseXPos = (INT16)mpos.x;
gusMouseYPos = (INT16)mpos.y;
uiParam = gusMouseYPos;
uiParam = uiParam << 16;
uiParam = uiParam | gusMouseXPos;
// Update the button state
gfMiddleButtonState = TRUE;
//Set that we have input
gfSGPInputReceived = TRUE;
// Trigger an input event
QueueEvent(MIDDLE_BUTTON_DOWN, 0, uiParam);
break;
case WM_MBUTTONUP:
// Update the current mouse position
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
ScreenToClient(ghWindow, &mpos);
gusMouseXPos = (INT16)mpos.x;
gusMouseYPos = (INT16)mpos.y;
uiParam = gusMouseYPos;
uiParam = uiParam << 16;
uiParam = uiParam | gusMouseXPos;
// Update the button state
gfMiddleButtonState = FALSE;
//Set that we have input
gfSGPInputReceived = TRUE;
// Trigger an input event
QueueEvent(MIDDLE_BUTTON_UP, 0, uiParam);
break;
//case WM_MBUTTONDBLCLK:
// break;
case WM_MOUSEWHEEL:
// Update the current mouse position
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
ScreenToClient(ghWindow, &mpos);
gusMouseXPos = (INT16)mpos.x;
gusMouseYPos = (INT16)mpos.y;
uiParam = gusMouseYPos;
uiParam = uiParam << 16;
uiParam = uiParam | gusMouseXPos;
// Update mouse wheel delta value
gsMouseWheelDeltaValue = GetMouseWheelDeltaValue(((MOUSEHOOKSTRUCTEX *)lParam)->mouseData);
//Set that we have input
gfSGPInputReceived = TRUE;
// Trigger an input event
QueueEvent(MOUSE_WHEEL, 0, uiParam);
break;
//dnl end part for additional mouse events
case WM_MOUSEMOVE
: // Update the current mouse position
mpos = ((MOUSEHOOKSTRUCT *)lParam)->pt;
+6
View File
@@ -19,6 +19,8 @@
#define RIGHT_BUTTON_REPEAT 0x0200
#define MOUSE_POS 0x0400
#define MOUSE_WHEEL 0x0800
#define MIDDLE_BUTTON_UP 0x1000//dnl
#define MIDDLE_BUTTON_DOWN 0x2000//dnl
#define SHIFT_DOWN 0x01
#define CTRL_DOWN 0x02
@@ -109,8 +111,10 @@ extern BOOLEAN gfKeyState[256]; // TRUE = Pressed, FALSE = Not Pressed
extern INT16 gusMouseXPos; // X position of the mouse on screen
extern INT16 gusMouseYPos; // y position of the mouse on screen
extern INT16 gsMouseWheelDeltaValue;//dnl
extern BOOLEAN gfLeftButtonState; // TRUE = Pressed, FALSE = Not Pressed
extern BOOLEAN gfRightButtonState; // TRUE = Pressed, FALSE = Not Pressed
extern BOOLEAN gfMiddleButtonState;//dnl TRUE = Pressed, FALSE = Not Pressed
extern BOOLEAN gfSGPInputReceived;
@@ -118,6 +122,8 @@ extern BOOLEAN gfSGPInputReceived;
#define _KeyDown(a) gfKeyState[(a)]
#define _LeftButtonDown gfLeftButtonState
#define _RightButtonDown gfRightButtonState
#define _MiddleButtonDown gfMiddleButtonState//dnl
#define _WheelValue gsMouseWheelDeltaValue//dnl
#define _MouseXPos gusMouseXPos
#define _MouseYPos gusMouseYPos
+2 -2
View File
@@ -150,13 +150,13 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
case WM_CLOSE:
PostQuitMessage(0);
break;
/*dnl kick this out, because in input.sgp MouseHandler() hook has priority so it will process same event twice, someone force MouseHandler() hook to always return unhandled events status so what ever mouse event you process in WindowProcedure() be aware that this event is already occur in MouseHandler() (mouse clicks, move etc.) Probably this is done because when you lost focus even if you click back on window region this will not restore them, so need condition in MouseHandler to restore window focus
case WM_MOUSEWHEEL:
{
QueueEvent(MOUSE_WHEEL, wParam, lParam);
break;
}
*/
#ifdef JA2
case WM_MOVE:
// if( 1==iScreenMode )
+1 -1
View File
@@ -1510,7 +1510,7 @@ void AwardExperienceForTravelling( GROUP * pGroup )
// award exp...
// amount was originally based on getting 100-bLifeMax points for 12 hours of travel (720)
// but changed to flat rate since StatChange makes roll vs 100-lifemax as well!
uiPoints = pGroup->uiTraverseTime / (450 / 100 - pSoldier->stats.bLifeMax );
uiPoints = pGroup->uiTraverseTime / (450 / (100 - pSoldier->stats.bLifeMax ) );
if ( uiPoints > 0 )
{
StatChange( pSoldier, HEALTHAMT, (UINT8) uiPoints, FALSE );
+3 -1
View File
@@ -8699,7 +8699,8 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
}
//Info for weapons
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
//swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s %s\n%s %1.1f %s",
swprintf( pStr, L"%s (%s) [%d%%]\n%s %d\n%s %d\n%s %d (%d)\n%s (%d) %s\n%s %1.1f %s",
ItemNames[ usItem ],
AmmoCaliber[ Weapon[ usItem ].ubCalibre ],
sValue,
@@ -8711,6 +8712,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? GunRange( pObject )/10 : GunRange( pObject ), //Modified Range
gGameSettings.fOptions[ TOPTION_SHOW_WEAPON_RANGE_IN_TILES ] ? Weapon[ usItem ].usRange/10 : Weapon[ usItem ].usRange, //Gun Range
gWeaponStatsDesc[ 5 ], //AP String
(Weapon[ usItem ].ubReadyTime * (100 - GetPercentReadyTimeAPReduction( pObject )) / 100), // Ready AP's
apStr, //AP's
gWeaponStatsDesc[ 12 ], //Weight String
fWeight, //Weight
+3 -1
View File
@@ -142,6 +142,9 @@ void MoveItemsInSlotsToLBE( SOLDIERTYPE *pSoldier, std::vector<INT8>& LBESlots,
// No item in this LBENODE pocket, is pocket active?
if(LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketIndex[j] == NONE) // Pocket is inactive
continue;
//dnl Pocket is active, so check if there is restriction of type for default item
if(LBEPocketType[LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketIndex[j]].pRestriction != 0 && LBEPocketType[LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketIndex[j]].pRestriction != Item[pSoldier->inv[LBESlots[i]].usItem].ubClassIndex)
continue;
// Pocket is active, can default item fit in this pocket?
if(LBEPocketType[LoadBearingEquipment[Item[pObj->usItem].ubClassIndex].lbePocketIndex[j]].ItemCapacityPerSize[dSize] == NONE) // Pocket can't hold this item size
continue;
@@ -218,7 +221,6 @@ BOOLEAN MoveItemsToActivePockets( SOLDIERTYPE *pSoldier, std::vector<INT8>& LBES
}
}
// now drop everything that wouldn't fit anywhere else
for(unsigned int i=0; i<LBESlots.size() ;i++)
{
+3
View File
@@ -7602,6 +7602,9 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
pSoldier = MercPtrs[ gusSelectedSoldier ];
}
if(!pSoldier && AreInMeanwhile())//dnl fix for preventing game crash in meanwhile after Queen slap Elliot
return(NULL);
ubID = pSoldier->ubID;
DebugAttackBusy( String( "Ending action for %d\n", ubID ) );
+1
View File
@@ -3936,6 +3936,7 @@ void GlobalReachableTest( INT16 sStartGridNo )
}
ReconfigurePathAI( ABSMAX_SKIPLIST_LEVEL, ABSMAX_TRAIL_TREE, ABSMAX_PATHQ );
gubNPCDistLimit = 0;//dnl without this ASTAR will not calculate map edgepoints
FindBestPath( &s, NOWHERE, 0, WALKING, COPYREACHABLE, PATH_THROUGH_PEOPLE );
RestorePathAIToDefaults();
}
+10 -1
View File
@@ -2100,6 +2100,14 @@ BOOLEAN SaveWorld( const STR8 puiFilename )
SaveMapLights( hfile );
}
if(gMapInformation.sCenterGridNo == -1 || (gMapInformation.sNorthGridNo == -1 && gMapInformation.sEastGridNo == -1 && gMapInformation.sSouthGridNo == -1 && gMapInformation.sWestGridNo == -1))//dnl
{
swprintf(gzErrorCatchString, L"SAVE ABORTED! Center entry point and at least one entry point (N,S,E,W) should be set.");
gfErrorCatch = TRUE;
FileClose(hfile);
return(FALSE);
}
SaveMapInformation( hfile );
if( uiFlags & MAP_FULLSOLDIER_SAVED )
@@ -3164,7 +3172,8 @@ BOOLEAN LoadWorld( const STR8 puiFilename, float* pMajorMapVersion, UINT8* pMino
{
SetRelativeStartAndEndPercentage( 0, 93, 94, L"Init Loaded World..." );
RenderProgressBar( 0, 0 );
InitLoadedWorld( );
if(!(gMapInformation.sNorthGridNo == -1 && gMapInformation.sEastGridNo == -1 && gMapInformation.sSouthGridNo == -1 && gMapInformation.sWestGridNo == -1))//dnl just rough solution for skiping InitLoadedWorld if loaded map doesn't contain any entry point which lead into assertion
InitLoadedWorld();
}
if( fGenerateEdgePoints )
+5 -2
View File
@@ -272,7 +272,7 @@ void AddTextInputField( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight, IN
if( szInitText )
{
pNode->ubStrLen = (UINT8)wcslen( szInitText );
Assert( pNode->ubStrLen <= ubMaxChars );
Assert( pNode->ubStrLen <= ubMaxChars );//dnl Warning if filename is longer this will throw assertion, need to be consider in future!!!
swprintf( pNode->szString, szInitText );
}
else
@@ -1043,9 +1043,11 @@ void AddChar( UINT32 uiKey )
PlayJA2Sample( ENTERING_TEXT, RATE_11025, BTNVOLUME, 1, MIDDLEPAN );
if( gpActive->ubStrLen >= gpActive->ubMaxChars )
{ //max length reached. Just replace the last character with new one.
/*dnl this part has no sense and is wrong escpecially when you insert characters then last was always replace
gpActive->ubStrLen = gpActive->ubMaxChars;
gpActive->szString[ gpActive->ubStrLen-1 ] = (UINT16)uiKey;
gpActive->szString[ gpActive->ubStrLen ] = '\0';
*/
return;
}
else if( gubCursorPos == gpActive->ubStrLen )
@@ -1058,7 +1060,7 @@ void AddChar( UINT32 uiKey )
else
{ //insert character after cursor
INT16 sChar;
sChar = (INT16)gpActive->ubStrLen;
sChar = (INT16)gpActive->ubStrLen;//dnl sChar = (INT16)(gpActive->ubStrLen + 1); disbanded because was lead into heap breach detected by debugger because gpActive->szString[ sChar + 1 ] was always overlap 2 bytes out of allocation region
while( sChar >= gubCursorPos )
{
gpActive->szString[ sChar + 1 ] = gpActive->szString[ sChar ];
@@ -1066,6 +1068,7 @@ void AddChar( UINT32 uiKey )
}
gpActive->szString[ gubCursorPos ] = (UINT16)uiKey;
gpActive->ubStrLen++;
gpActive->szString[ gpActive->ubStrLen ] = '\0';//dnl
gubCursorPos++;
}
}
+4 -4
View File
@@ -66,7 +66,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib .\Multiplayer\raknet\RakNetLibStaticDebug.lib ws2_32.lib"
OutputFile="$(OutDir)\ja2_debug_2350_en.exe"
OutputFile="$(OutDir)\ja2_debug_2375_en.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"
@@ -145,7 +145,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib .\Multiplayer\raknet\RakNetLibStatic.lib ws2_32.lib"
OutputFile="$(OutDir)\ja2_release_2350_en.exe"
OutputFile="$(OutDir)\ja2_release_2375_en.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
GenerateMapFile="true"
@@ -229,7 +229,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib .\Multiplayer\raknet\RakNetLibStatic.lib ws2_32.lib"
OutputFile="$(OutDir)\Map Editor_2350_en.exe"
OutputFile="$(OutDir)\Map Editor_2375_en.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
GenerateMapFile="true"
@@ -316,7 +316,7 @@
<Tool
Name="VCLinkerTool"
AdditionalDependencies="Winmm.lib .\Multiplayer\raknet\RakNetLibStaticDebug.lib ws2_32.lib"
OutputFile="$(OutDir)\Map EditorD_2350_en.exe"
OutputFile="$(OutDir)\Map EditorD_2375_en.exe"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="2"