All pastes #18224 Raw Edit

Untitled

public text v1 · immutable
#18224 ·published 2005-07-21 14:22 UTC
rendered paste body
In file included from KX_ConvertActuators.cpp:61:
../GameLogic/SCA_HelloActuator.h:1: error: syntax error before `.' token
../GameLogic/SCA_HelloActuator.h:10: error: storage size of `Methods' isn't
   known
../GameLogic/SCA_HelloActuator.h:10: error: storage size of `Methods' isn't
   known
../GameLogic/SCA_HelloActuator.h:10: error: storage size of `Parents' isn't
   known
../GameLogic/SCA_HelloActuator.h:10: error: storage size of `Parents' isn't
   known
../GameLogic/SCA_HelloActuator.h:10: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h: In function `PyTypeObject* GetType()':
../GameLogic/SCA_HelloActuator.h:10: error: `Type' undeclared (first use this
   function)
../GameLogic/SCA_HelloActuator.h:10: error: (Each undeclared identifier is
   reported only once for each function it appears in.)
../GameLogic/SCA_HelloActuator.h: At global scope:
../GameLogic/SCA_HelloActuator.h:10: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h:15: error: parse error before `public'
../GameLogic/SCA_HelloActuator.h:23: error: destructors must be member
   functions
../GameLogic/SCA_HelloActuator.h:23: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h:24: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h:26: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h:27: error: virtual outside class declaration
../GameLogic/SCA_HelloActuator.h:29: error: parse error before `}' token
In file included from ../Ketsji/KX_SCA_ReplaceMeshActuator.h:47,
                 from KX_ConvertActuators.cpp:64:
../Rasterizer/RAS_MeshObject.h:37: warning: ignoring #pragma warning
In file included from ../Rasterizer/RAS_MaterialBucket.h:41,
                 from ../Rasterizer/RAS_Polygon.h:36,
                 from ../Rasterizer/RAS_MeshObject.h:43,
                 from ../Ketsji/KX_SCA_ReplaceMeshActuator.h:47,
                 from KX_ConvertActuators.cpp:64:
../Rasterizer/RAS_Deformer.h:37: warning: ignoring #pragma warning
In file included from ../Ketsji/KX_Scene.h:48,
                 from KX_ConvertActuators.cpp:66:
/cygdrive/d/projects/lib/windows/SoundSystem/include/SND_Scene.h:38: warning: ig
noring
   #pragma warning
In file included from KX_ConvertActuators.cpp:70:
../Ketsji/KX_GameObject.h:39: warning: ignoring #pragma warning
In file included from KX_ConvertActuators.cpp:79:
../../blender/blenlib/BLI_winstuff.h:34: warning: ignoring #pragma warning
KX_ConvertActuators.cpp: In function `void BL_ConvertActuators(char*, Object*,
   KX_GameObject*, SCA_LogicManager*, KX_Scene*, KX_KetsjiEngine*, int&, int,
   bool, RAS_IRenderTools*, KX_BlenderSceneConverter*)':
KX_ConvertActuators.cpp:125: error: `tmp' undeclared (first use this function)
KX_ConvertActuators.cpp:128: error: parse error before `(' token
../SceneGraph/SG_Node.h: At top level:
../GameLogic/SCA_HelloActuator.h:10: warning: `<typeprefixerror> Methods'
   defined but not used
make[3]: *** [/cygdrive/d/projects/blender/obj/windows/gameengine/blconverter/KX
_ConvertActuators.o] Error 1
make[2]: *** [all] Error 1
make[1]: *** [all] Error 1
make: *** [all] Error 1


------------------------SCA_HelloActuator.h-------------------------------------------

#ifndef __SCA_HELLOACTUATOR_H__
#define __SCA_HELLOACTUATOR_H__

#include "SCA_IActuator.h"

class SCA_HelloActuator : public SCA_IActuator
{
    Py_Header;

    /* our message constructed with this class ('user imput')*/   
    STR_String m_msg;

public:
    SCA_HelloActuator(
        class SCA_IObject* gameobj,
        STR_String msg,
        PyTypeObject* T=&Type
        );


    virtual ~SCA_HelloActuator();
    virtual bool Update();

    virtual CValue* GetReplica();
    virtual PyObject* _getattr(const STR_String& attr);

};
#endif


----------------------------SCA_HelloActuator.cpp-------------------------------------------


#include "SCA_IActuator.h"
#include "SCA_HelloActuator.h"

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <iostream>



SCA_HelloActuator::SCA_HelloActuator(
        SCA_IObject *gameobj, 
        STR_String msg,
        PyTypeObject* T
    : SCA_IActuator(gameobj, T),
     /* initialize variable  */   
     m_msg(msg) )
{
}


SCA_HelloActuator::~SCA_HelloActuator()
{

}


CValue* SCA_HelloActuator::GetReplica()
{
    SCA_HelloActuator* replica = new SCA_HelloActuator(*this);
    replica->ProcessReplica();
    CValue::AddDataToReplica(replica);

    return replica;
}


bool SCA_HelloActuator::Update()
{
    /* now simply print out m_msg's contents */   
  
    std::cout << m_msg << std::endl;
    return true;
}


PyTypeObject SCA_HelloActuator::Type = {
        PyObject_HEAD_INIT(&PyType_Type)
        0,
        "SCA_HelloActuator",
        sizeof(SCA_HelloActuator),
        0,
        PyDestructor,
        0,
        __getattr,
        __setattr,
        0, 
         __repr,
        0,
        0,
        0,
        0,
        0
};


PyParentObject SCA_HelloActuator::Parents[] = {
        &SCA_HelloActuator::Type,
        &SCA_IActuator::Type,
        &SCA_ILogicBrick::Type,
        &CValue::Type,
        NULL
};


PyMethodDef SCA_HelloActuator::Methods[] = {
    /* add python functions to deal with m_msg... */
    {NULL,NULL}
};


PyObject* SCA_HelloActuator::_getattr(const STR_String& attr) {
    _getattr_up(SCA_IActuator);
}