About Store Forum Documentation Contact



Post Reply 
[SOLVED] compilation error with Memb<Motion>
Author Message
eric99 Offline
Member

Post: #1
[SOLVED] compilation error with Memb<Motion>
Hi,
I get a compilation error since I made an autoupdate (excuse me, It's a french version of VC2008 express, but I think there's no need to translate).

Quote:i:\esenthelenginesdk\planet01\esenthelengine\misc\templates.h(16) : error C2660: 'EE::Motion::load' : la fonction ne prend pas 1 arguments
1> i:\esenthelenginesdk\planet01\esenthelengine\misc\templates.h(16) : lors de la compilation de la fonction membre '<Inconnu>' de la classe <Inconnu>
1> i:\esenthelenginesdk\planet01\source\ai.h(19) : voir la référence à l'instanciation de la classe modèle 'EE::Memb<TYPE>' en cours de compilation

Here is the code (from ai.h):
Code:
struct AI : Chr
{
   Byte           type; // AI_TYPE
   Flt            time_to_random_animation,
                  time_to_random_move,
                  time_to_sense,
                  time_to_update_action,
                  time_to_attack;
   Str             obj_file_path;
   Memb<Motion>     idle_motions;
   Memb<Motion>     attack_motions; // container for attack motion animations
   Reference<Chr> target;         // target enemy
.
.
.
   // io
   virtual void save(File &f);
   virtual Bool load(File &f);
   virtual void linkReferences();

I've taken a look in Misc\templates.h and the load function has really 1 argument :
Code:
// Memb
TEMPLATE void Memb<TYPE>::save(File &f)C {             f.putInt(elms()); FREPA(T)T[i].save(f);}
TEMPLATE Bool Memb<TYPE>::load(File &f)  {clear(); REP(f.getInt(      ))    if(!New().load(f))return false; return true;}

but in Animation\Motion.h, there is 2 arguments
Code:
// io
   void save(File &f                  ); // save to   file
   Bool load(File &f, CSkeleton &cskel); // load from file, false on fail

Is it normal ?
(This post was last modified: 10-23-2010 07:05 PM by eric99.)
10-23-2010 05:30 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: compilation error with Memb<Motion>
I'm using VS 2008 Professional english, and Bloody Massacre compiles fine.

Code:
Bool AI::load(File &f)
{
   if(__super::load(f))
   {
      f>>type>>time_to_random_animation>>time_to_random_move>>time_to_sense>>time_to_update_action>>time_to_attack;
      obj_file_path=f.getStr();
              target.load(f);
      REP(f.getInt())  idle_motions.New().load(f,cskel);
      REP(f.getInt())attack_motions.New().load(f,cskel);

      setNonSavedParams();
      return true;
   }
   return false;
}
here you can see that there's no "idle_motions.load"
but you have "idle_motions.New().load"

so "TEMPLATE Bool Memb<TYPE>::load(File &f) " is not called
but instead "Bool Motion::load(File &f, CSkeleton &cskel);" is called
10-23-2010 06:48 PM
Find all posts by this user Quote this message in a reply
eric99 Offline
Member

Post: #3
RE: [SOLVED] compilation error with Memb<Motion>
I've tried it and it's working fine.

Thanks for your quick answer.
10-23-2010 07:07 PM
Find all posts by this user Quote this message in a reply
Post Reply