MantisBT - VCMI
View Issue Details
0000903VCMIOtherpublic2012-03-05 10:182014-05-30 17:40
q4a 
Warmonger 
normalfeaturehave not tried
closedfixed 
x86WindowsXP SP3
0.88 
0.89 
0000903: Provide source code and vc project file of fuzzylite lib for Windows
Fuzzylite lib's last commit was more than 1 year ago:
http://code.google.com/p/fuzzy-lite/source/list [^]
Fuzzylite lib has bugs, does not support Windows and there is many ways to fix building it on Windows.

1.Will vcmi provide all source code of fuzzylite lib, modified headers or/and vc project file for it?
2.Can somebody add fuzzylite lib as dependency to vcproj AVAI ?
3.Which definition of INFINITY, NAN, isnan() and isinf() should we use?

a) https://groups.google.com/forum/?fromgroups#!topic/fuzzylite/6yNvUv7u9qk [^]
+INFINITY replace with FLT_MAX
-INFINITY replace with FLT_MIN
NAN replace with _Nan._Float

b) http://code.google.com/p/fuzzy-lite/issues/detail?id=2 [^]
#ifndef NAN
        static const unsigned long __nan[2] = {0xffffffff, 0x7fffffff};
        #define NAN (*(const float *) __nan)
#endif

#ifdef _MSC_VER
#ifndef INFINITY
union MSVC_FL
{
   unsigned __int8 Bytes[4];
   float Value;
};
static union MSVC_FL INFINITY_HACK = {{0x00, 0x00, 0x80, 0x7F}};
#define INFINITY (INFINITY_HACK.Value)
#endif
#endif

c) http://vcmi.svn.sourceforge.net/viewvc/vcmi/trunk/AI/VCAI/Fuzzy.h?revision=2574&view=markup [^]
#define INFINITY 1000000000 //definition required by FuzzyLite (?)
#define NAN 1000000001
No tags attached.
Issue History
2012-03-05 10:18q4aNew Issue
2012-03-05 10:48WarmongerNote Added: 0002281
2012-03-05 10:57q4aNote Added: 0002282
2012-03-05 10:57q4aNote Edited: 0002282bug_revision_view_page.php?bugnote_id=2282#r1527
2012-03-05 11:24IvanNote Added: 0002283
2012-03-05 11:27IvanNote Edited: 0002283bug_revision_view_page.php?bugnote_id=2283#r1529
2012-03-05 12:05WarmongerNote Added: 0002284
2012-03-05 12:05WarmongerStatusnew => resolved
2012-03-05 12:05WarmongerFixed in Version => 0.dev
2012-03-05 12:05WarmongerResolutionopen => fixed
2012-03-05 12:05WarmongerAssigned To => Warmonger
2012-03-06 09:39q4aNote Added: 0002286
2012-03-11 08:06ZamolxisNote Added: 0002298
2012-03-11 08:06ZamolxisFixed in Version0.dev => 0.89
2012-03-11 08:08ZamolxisNote Edited: 0002298bug_revision_view_page.php?bugnote_id=2298#r1533
2014-05-30 17:40beegeeStatusresolved => closed

Notes
(0002281)
Warmonger   
2012-03-05 10:48   
For some reason I thought you were working on Linux.

Inifinity / NaN is windows-sepcific issue. Proposed solution seems better.
(0002282)
q4a   
2012-03-05 10:57   
I use Linux at home and Windows at work =)
Anyway, I love vсmi for its cross-platform and would like to test(read: play) it on many platforms, including ARM =)

(0002283)
Ivan   
2012-03-05 11:24   
(edited on: 2012-03-05 11:27)
1.Will vcmi provide all source code of fuzzylite lib, modified headers or/and vc project file for it?
I vote for "yes" - easier to distribute and to fix bugs.
And then use it as dynamic library. Any objections?
One note about licensing - Apache 2 libraries can be used in GPL applications so all we have to do is to keep fuzzylite code under Apache license.

3.Which definition of INFINITY, NAN, isnan() and isinf() should we use?
Another solution: http://www.cplusplus.com/reference/std/limits/numeric_limits/ [^]
Should be identical to FLT_MIN - FLT_MAX defines

(0002284)
Warmonger   
2012-03-05 12:05   
Added full sources in r2576. Can you live with it?
(0002286)
q4a   
2012-03-06 09:39   
Can you review and/or commit this?
http://forum.vcmi.eu/viewtopic.php?p=6592#6592 [^]
(0002298)
Zamolxis   
2012-03-11 08:06   
(edited on: 2012-03-11 08:08)
Further changes from Tow in r2580:
* FuzzyLite is a static library (.lib) instead of (.dll).
* VCAI links against FuzzyLite.lib instead of including its sources.
(see link above for details)