Feature TDF addition - Page 2

Feature TDF addition

Requests for features in the spring code.

Moderator: Moderators

User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I got it working by compiling under Borland2006 instead of Borland6. Althought I WTF'ed at 'call to undefined function memcpy', by adding #include <string.h> before, and not after, every other include, I got it to eventually compile to the end. Now it requires devil.dll, probably because my dll->lib doesn't really convert the whole dll but just its index, but I gave that mapconv some bmp and it produced smf + smt.

So now I can start (trying to) make the actual changes.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

I'd create an std::map<int,float> to hold the rotations where the integer is the ID used in the red channel, and the float is the rotation.

Then in the small loop that loads the fs.txt contents it will instead read the line in and seperate it into 2 values, the featurename and a rotation defaulting to zero, seperated by a space or soemthing else.

Then when feature objects are being created the value 0 will be replaced with a call to the map<> container to retrieve the angle of rotation.

A further improvement would be the ability to define a TDF file OTA style referencing feature positions, to allow map makers to remove the 256 feature types limit.

As a bonus, the featurename of geothermal vents is 'GeoVent' thus you can now compile maps with geothermals anywhere by placing a GeoVent feature.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

AF wrote:You have an issue with borland not the c++. Ditch borland, uninstall it, consign it to the trash can, you wont get any use out of it.

btw devc++ == outdated mingw32

Your better getting codeblocks then copying over the uptodate mingw32 as devc++ wont compile AIs or spring correctly.

However netbeans 5.5 is better for a lot as it doesnt have hacky UI glitches and issues, such as not being able to copy paste with rightclick on codeblocks, and a much nicer interface.

My DevCPP MingW compiles Spring and all SVN AIs just fine, thanks.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Ah so youve downloaded and replaced the outdated build of mingw32 that comes with devc++?

Eitherway you cant release an AI with a devc++ compiler unless you replace the mingw32 devc++ uses with a modern version.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

You can download gcc/mingw updates with the webupdate package manager. I don't remember doing that, mind.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Last time I tried to update mingw stuff through devcpp's packet manager it kept crashing. I think some server was down. In the end I ended up grabbing the files manually from the mingw site.

If I remember correctly then the "updates" in the packet list were outdated as well.
Post Reply

Return to “Feature Requests”