Home » MODDING HQ 1.13 » v1.13 General Development Talk » SVN 1.13 Compile with VS 2005, 2008 & 2015
SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357416] Sat, 25 May 2019 18:36 Go to next message
Marty2Life

 
Messages:7
Registered:May 2019
Hello @all,

I'm new here in the Forum.

Story:
I have Backup and Scanned my JA2 Original German Retail Versions and i compiled the v1.12 Gold
with Visual Studio 6 to/as German exe and i translated the v1.01 UB and B2B exe to German via Hex Editor.

....
Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357417 is a reply to message #357416] Sat, 25 May 2019 23:31 Go to previous messageGo to next message
Marty2Life

 
Messages:7
Registered:May 2019
.. continue

All JA2 games run's very fine and Smooth in my DOSBox Fork with Win98. I looked in the Code for v1.13. Great. This can run in my Win98 DOSbox VM and i see a Option with Win98 in the ja2 settings. For JA2, I dont like it. If the Screen Resolution is bigger as 800x600. That is more Micro Mangement Gaming. Play Baldurs Gate in 4K. You know?
Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357418 is a reply to message #357417] Sat, 25 May 2019 23:33 Go to previous messageGo to next message
Marty2Life

 
Messages:7
Registered:May 2019
.. continue

There a exists Solutions for VS 2005, 2008, 2010, 2013 and 2017. I changed the Langauge define to German.

Picked up Visual Studio 2015 with Windows 7 SP1 and it compiled. OK with over 1000 warnings, mismatches and conversions loss of data.
Compare to the Source Code to v1.12 is really clean.
Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357419 is a reply to message #357418] Sat, 25 May 2019 23:34 Go to previous messageGo to next message
Marty2Life

 
Messages:7
Registered:May 2019
Game v1.13 started.. ok it runs.

Now i would like to run as Windows 98 exe.
i picked up the VS2005 and the Solution file sln with Windows 2000 and SP4 and it doesnt compile.
- It miss the #include <unordered_map> include file. not sure
- The "for (auto ....)" loops for VS2005 are default "ints" and 1000 warnings and other sign mismatches (w/lvl3).

Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357420 is a reply to message #357419] Sat, 25 May 2019 23:36 Go to previous messageGo to next message
Marty2Life

 
Messages:7
Registered:May 2019
I tryed with Visual Studio 2008 C++ Express

- I Picked up VS2008 Solution file sln with Windows XP SP2. The Same.
- The "for (auto ....)" loops for VS2008 are default ints and 1000 warnings and other sign mismatches (lvl3) but the
unordered_map is there.

I manually changes the typedefs "auto" for loops to std::vector<xy>::iterator. Added the missing math.h includes.
Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357421 is a reply to message #357420] Sat, 25 May 2019 23:39 Go to previous messageGo to next message
Marty2Life

 
Messages:7
Registered:May 2019
It compile and i try it out. It runs in my DOSBox Fork with Win98 but it crash at the drugs.xml? on the host too, with VS2015 not. not sure
https://aeronextedit.files.wordpress.com/2019/05/aufnhame00486.jpg

How did you Compile the Visual Studio Solutions for 2005 and 2008? not sure
why are over 1000 Warnings, sign Mismatch Conversions and loss of data? not sure


V1.12 and VS6 aww
And thanks to guy that has made a nice replacement for Ira. happy

https://aeronextedit.files.wordpress.com/2019/05/aufnhame00487.jpg


PS: Wenn hier einer Deutsch spricht wäre das hammer happy
PPS: I need "5" to post a linked screenshot. ;)

[Updated on: Sun, 26 May 2019 00:29]

Re: SVN 1.13 Compile with VS 2005, 2008 & 2015[message #357423 is a reply to message #357421] Sun, 26 May 2019 17:23 Go to previous message
Marty2Life

 
Messages:7
Registered:May 2019
I give up. I stay with the v1.12 and the old mods.

My Source Changes:

For Visual Studio 2005 and 2008

GameSource\ja2_v1.13\Build\TileEngine\Explosion Control.cpp #Line 11

#include <string.h>

#if _MSC_VER <= 1500
	#include <math.h>
#endif

#include "stdlib.h"
Why: it can't compile this line because it can't find sqrt
DrawTraitRadius( pSoldier->sFocusGridNo, pSoldier->pathing.bLevel, sqrt( 0.5 ) * (20 + 40 * radius), 8, 0 );



GameSource\ja2_v1.13\Build\Tactical\Turn Based Input.cpp #Line 6730

#if _MSC_VER <= 1500
    for (std::vector<OBJECTTYPE>::iterator lbeInvIter = lbePtr->inv.begin(); lbeInvIter != lbePtr->inv.end(); lbeInvIter++) {
#else
    for (auto lbeInvIter = lbePtr->inv.begin(); lbeInvIter != lbePtr->inv.end(); lbeInvIter++) {
#endif	

#if _MSC_VER <= 1500
     OBJECTTYPE * LBEStack = lbeInvIter._Myptr;
#else
     OBJECTTYPE * LBEStack = lbeInvIter._Ptr;
#endif
Why: VS2005/2008 interpret "auto" as default int. Give an Error and can't compile. _Ptr doesn't exists in the include vector file but instead _Myptr.



GameSource\ja2_v1.13\Build\Tactical\Interface Items.cpp #Line 5726

#if _MSC_VER <= 1500
    for (std::vector<PopupAttachmentInfo *>::iterator iter = gPopupAttachmentInfos.begin(); iter != gPopupAttachmentInfos.end(); iter++) {	
#else
    for (auto iter = gPopupAttachmentInfos.begin(); iter != gPopupAttachmentInfos.end(); iter++) {
#endif

Why: VS2005/2008 interpret "auto" as default int. Give an Error and can't compile


GameSource\ja2_v1.13\Build\Strategic\Town Militia.cpp #Line 7

#ifdef PRECOMPILEDHEADERS
	#include "Strategic All.h"
	#include "GameSettings.h"
#else
	#if _MSC_VER <= 1500
		#include <math.h>	
	#endif	

	#include "Town Militia.h"

#include "stdlib.h"
Why: it can't compile this line because it can't find log
FLOAT hourlygain = log( 1.0 + loyalpopulation * populationmodifier * gGameExternalOptions.dMilitiaVolunteerGainFactorHourly);



GameSource\ja2_v1.13\Build\Strategic\mapscreen.cpp #Line 5164

#if _MSC_VER <= 1500
    for (std::vector<WORLDITEM>::iterator itemIterator  = pInventoryPoolList.begin(); itemIterator != pInventoryPoolList.end(); itemIterator++) {
#else
    for (auto itemIterator = pInventoryPoolList.begin(); itemIterator != pInventoryPoolList.end(); itemIterator++) {
#endif	
Why: VS2005/2008 interpret "auto" as default int. Give an Error and can't compile



GameSource\ja2_v1.13\Build\Strategic\Map Screen Interface.cpp #Line 17004

#if _MSC_VER <= 1500
    for (std::vector<OBJECTTYPE>::iterator lbeInvIter = lbePtr->inv.begin(); lbeInvIter != lbePtr->inv.end(); lbeInvIter++) {
#else
    for (auto lbeInvIter = lbePtr->inv.begin(); lbeInvIter != lbePtr->inv.end(); lbeInvIter++) {
#endif					

	#if _MSC_VER <= 1500
		OBJECTTYPE * LBEStack = lbeInvIter._Myptr;
	#else
		OBJECTTYPE * LBEStack = lbeInvIter._Ptr;
	#endif
	dropCnt += LBEStack->ubNumberOfObjects;
	AutoPlaceObjectToWorld(pSoldier, LBEStack, true);
	if (LBEStack != NULL)
	{
	        #if _MSC_VER <= 1500
		    DeleteObj(lbeInvIter._Myptr);
		#else
                    DeleteObj(lbeInvIter._Ptr);
		#endif
	}
						}
Why: VS2005/2008 interpret "auto" as default int. Give an Error and can't compile. _Ptr doesn't exists in the include vector file but instead _Myptr.



GameSource\ja2_v1.13\Build\Standard Gaming Platform\vobject.cpp #Line #21
#if _MSC_VER <= 1400
	#include <hash_map>
#else
	#include <unordered_map>
#endif

 ........

#if _MSC_VER <= 1400
	typedef stdext::hash_map<UINT32, VOBJECT_NODE_PTR> VOBJECT_MAP;
#else
	typedef std::tr1::unordered_map<UINT32, VOBJECT_NODE_PTR> VOBJECT_MAP;
#endif

In Visual Studio 2005. unordered_map doesn'nt exists. It came with VS 2008. Use Instead hash_map. In Visula Studio 2008 it cant find in namesapce unordered_map. Need to use tr1


After all the Research and final compiles in VS2005/ VS2008 and VS 2015 it doenst work.

My Problems with a VS2005 compiled Exe.
It can't load the External Game XML files On Windows 7 and Windows 98 and show a Runtime Error. "eq: items\Armours.xml" I think the Xml load file parser is not compatible.

My Problems with a VS2008 compiled Exe.
Show no Error but after popup with the Version number it crashed to desktop. On Windows 7 and Win98

My Problems with a VS2015 compiled Exe.
It Crashed Randmly at the click on the "Laptop close button" or "View Emails" oder give a runtime Error Message. Sad, runs only on Windows 7


I have no idea how you compiled this under vs2005 or vs2008?
- Is Vs2005, vs2008 supportet?
- Is Windows 98 really still Supportet?

I have the suspicion that the code is a total 9x / Nt mix?

In Fullscreen is needed a 32Bit and in window mode is needed 16Bit? Really? This is crazy.
Actually, the whole dx render code would need a total revision.


I would like to play a highly accurate version 1.13 under Windows 98, but that's not all that useful. angry



[Updated on: Sun, 26 May 2019 17:32]

Previous Topic: Extracting merc portraits
Next Topic: Q: Item 1 + Item 2 = Item 3 graphics
Goto Forum:
  


Current Time: Tue Sep 17 01:35:27 EEST 2019

Total time taken to generate the page: 0.00707 seconds