Any way to delete or move this topic since it is in wrong thread??
The page states the code is incompatible with 1.9; I had been using 1.8 but recently switched over to 1.9
The first issue was with pUseCount in TextFilePtr in the linked page, here is the code for my class which is essentially a copy and paste:
Code: Select all
class Cube27ResFilePtr : public Ogre::SharedPtr< Cube27ResFile > {
public:
Cube27ResFilePtr() : Ogre::SharedPtr< Cube27ResFile >() {}
explicit Cube27ResFilePtr( Cube27ResFile *rep ) : Ogre::SharedPtr< Cube27ResFile >( rep ) {}
Cube27ResFilePtr( const Cube27ResFilePtr &r ) : Ogre::SharedPtr< Cube27ResFile >( r ) {}
Cube27ResFilePtr( const Ogre::ResourcePtr &r ) : Ogre::SharedPtr< Cube27ResFile >() {
if ( r.isNull() )
return;
// lock and copy other mutex pointer
OGRE_LOCK_MUTEX( *r.OGRE_AUTO_MUTEX_NAME )
OGRE_COPY_AUTO_SHARED_MUTEX( r.OGRE_AUTO_MUTEX_NAME )
pRep = static_cast< Cube27ResFile* >( r.getPointer() );
pUseCount = r.useCountPointer();
useFreeMethod = r.freeMethod();
if ( pUseCount ) {
++( *pUseCount );
}
}
// Operator used to convert a ResourcePtr to Cube27ResFilePtr
Cube27ResFilePtr &operator = ( const Ogre::ResourcePtr &r ) {
if ( pRep == static_cast< Cube27ResFile* >( r.getPointer() ) )
return *this;
release();
if( r.isNull() )
return *this;
// resource ptr is null, so the call to release above has done all we need to do.
// lock & copy other mutex pointer
OGRE_LOCK_MUTEX( *r.OGRE_AUTO_MUTEX_NAME );
OGRE_COPY_AUTO_SHARED_MUTEX( r.OGRE_AUTO_MUTEX_NAME );
pRep = static_cast< Cube27ResFile* >( r.getPointer() );
pUseCount = r.useCountPointer();
useFreeMethod = r.freeMethod();
if ( pUseCount ) {
++( *pUseCount );
}
return *this;
}
};
Code: Select all
error: 'pUseCount' was not declared in this scope
This results in:
Code: Select all
error: 'const ResourcePtr' has no member named 'useCountPointer'
error: 'useFreeMethod' was not declared in this scope
error: 'const ResourcePtr' has no member named 'freeMethod'
I would happily update the wiki page to reflect these changes for 1.9 if anyone would mind explaining how I might fix the issue, or at least give direction on what to look for.
Thanks.
SOLUTION posted at http://www.ogre3d.org/forums/viewtopic.php?f=2&t=81235