Mogre 1.7.4 64bits

RMI

13-12-2013 13:38:53

Hi,

I compiled Mogre with MogreBuilder with the option -x64. But now, when i use ResourceGroupManager.Singleton.AddResourceLocation function, i've an AccesViolationException.
This code worked fine in x86.
Can you help me. Thanks

This is my log file
14:28:46: Creating resource group General
14:28:46: Creating resource group Internal
14:28:46: Creating resource group Autodetect
14:28:46: SceneManagerFactory for type 'DefaultSceneManager' registered.
14:28:46: Registering ResourceManager for type Material
14:28:46: Registering ResourceManager for type Mesh
14:28:46: Registering ResourceManager for type Skeleton
14:28:46: MovableObjectFactory for type 'ParticleSystem' registered.
14:28:46: OverlayElementFactory for type Panel registered.
14:28:46: OverlayElementFactory for type BorderPanel registered.
14:28:46: OverlayElementFactory for type TextArea registered.
14:28:46: Registering ResourceManager for type Font
14:28:46: ArchiveFactory for archive type FileSystem registered.
14:28:46: ArchiveFactory for archive type Zip registered.
14:28:46: DDS codec registering
14:28:46: FreeImage version: 3.15.3
14:28:46: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
14:28:46: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
14:28:46: PVRTC codec registering
14:28:46: Registering ResourceManager for type HighLevelGpuProgram
14:28:46: Registering ResourceManager for type Compositor
14:28:46: MovableObjectFactory for type 'Entity' registered.
14:28:46: MovableObjectFactory for type 'Light' registered.
14:28:46: MovableObjectFactory for type 'BillboardSet' registered.
14:28:46: MovableObjectFactory for type 'ManualObject' registered.
14:28:46: MovableObjectFactory for type 'BillboardChain' registered.
14:28:46: MovableObjectFactory for type 'RibbonTrail' registered.
14:28:46: *-*-* OGRE Initialising
14:28:46: *-*-* Version 1.7.4 (Cthugha)
14:28:46: Loading library C:\VS\Projects\Tools\RMOgreX64\RMOgreTest\bin\x64\Debug\RenderSystem_Direct3D9
14:28:46: Installing plugin: D3D9 RenderSystem
14:28:46: D3D9 : Direct3D9 Rendering Subsystem created.
14:28:46: D3D9: Driver Detection Starts
14:28:46: D3D9: Driver Detection Ends
14:28:46: Plugin successfully installed
14:28:46: Loading library C:\VS\Projects\Tools\RMOgreX64\RMOgreTest\bin\x64\Debug\RenderSystem_GL
14:28:46: Installing plugin: GL RenderSystem
14:28:46: OpenGL Rendering Subsystem created.
14:28:46: Plugin successfully installed
14:28:46: Loading library C:\VS\Projects\Tools\RMOgreX64\RMOgreTest\bin\x64\Debug\Plugin_OctreeSceneManager
14:28:46: Installing plugin: Octree & Terrain Scene Manager
14:28:46: Plugin successfully installed
14:28:46: Loading library C:\VS\Projects\Tools\RMOgreX64\RMOgreTest\bin\x64\Debug\Plugin_ParticleFX
14:28:46: Installing plugin: ParticleFX
14:28:46: Particle Emitter Type 'Point' registered
14:28:46: Particle Emitter Type 'Box' registered
14:28:46: Particle Emitter Type 'Ellipsoid' registered
14:28:46: Particle Emitter Type 'Cylinder' registered
14:28:46: Particle Emitter Type 'Ring' registered
14:28:46: Particle Emitter Type 'HollowEllipsoid' registered
14:28:46: Particle Affector Type 'LinearForce' registered
14:28:46: Particle Affector Type 'ColourFader' registered
14:28:46: Particle Affector Type 'ColourFader2' registered
14:28:46: Particle Affector Type 'ColourImage' registered
14:28:46: Particle Affector Type 'ColourInterpolator' registered
14:28:46: Particle Affector Type 'Scaler' registered
14:28:46: Particle Affector Type 'Rotator' registered
14:28:46: Particle Affector Type 'DirectionRandomiser' registered
14:28:46: Particle Affector Type 'DeflectorPlane' registered
14:28:46: Plugin successfully installed

RMI

16-12-2013 09:07:04

Hi,

I try to found this exception. I debugged OgreMain.dll code, and the error is when
res = _findnext( lHandle, &tagData );
is called in
void FileSystemArchive::findFiles(const String& pattern, bool recursive, bool dirs, StringVector* simpleList, FileInfoList* detailList) function.
_findnext definition
#define _findnext _findnext64i32.

Can somebody help me please?

Thanks

RMI

16-12-2013 16:35:17

I found some solutions
You can't add path like c:\windows\fonts, but you can add c:\windows\fonts\*.*
You can't add path like ., but you can add *.*
but you can add path like ..\..\media.
Strange !

But now i've another problem with the function getRenderSystemByName with Direct3D9 Rendering Subsystem.
It's seem to be good in C++ function but the pointer returned by C# call is null.

Is there someone with an idea?
Thanks

RMI

24-12-2013 15:24:49

I've the solution

Replace FileSystemArchive::findFiles in OgreFileSystem.cpp by

void FileSystemArchive::findFiles(const String& pattern, bool recursive,
bool dirs, StringVector* simpleList, FileInfoList* detailList)
{

// pattern can contain a directory name, separate it from mask
size_t pos1 = pattern.rfind ('/');
size_t pos2 = pattern.rfind ('\\');
if (pos1 == pattern.npos || ((pos2 != pattern.npos) && (pos1 < pos2))) pos1 = pos2;
String directory;
if (pos1 != pattern.npos) directory = pattern.substr (0, pos1 + 1);

String full_pattern = concatenate_path(mName, pattern);
WIN32_FIND_DATA ffd;
HANDLE hFind = FindFirstFile(full_pattern.c_str(), &ffd);

if (INVALID_HANDLE_VALUE == hFind)
{
return ;
}

// List all the files in the directory with some info about them.

do
{
if ((dirs == ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)) &&
( !ms_IgnoreHidden || (ffd.dwFileAttributes & _A_HIDDEN) == 0 ) &&
(!dirs || !is_reserved_dir (ffd.cFileName)))
{

if (simpleList)
{
simpleList->push_back(directory + ffd.cFileName);
}
else if (detailList)
{
FileInfo fi;
fi.archive = this;
fi.filename = directory + ffd.cFileName;
fi.basename = ffd.cFileName;
fi.path = directory;
fi.compressedSize = (ffd.nFileSizeHigh * (MAXDWORD+1)) + ffd.nFileSizeLow;
fi.uncompressedSize = (ffd.nFileSizeHigh * (MAXDWORD+1)) + ffd.nFileSizeLow;
detailList->push_back(fi);
}
}
}
while (FindNextFile(hFind, &ffd) != 0);

FindClose(hFind);

// Now find directories
if (recursive)
{
String base_dir = mName;
if (!directory.empty ())
{
base_dir = concatenate_path(mName, directory);
// Remove the last '/'
base_dir.erase (base_dir.length () - 1);
}
base_dir.append ("/*");

// Remove directory name from pattern
String mask ("/");
if (pos1 != pattern.npos)
mask.append (pattern.substr (pos1 + 1));
else
mask.append (pattern);

hFind = FindFirstFile(full_pattern.c_str(), &ffd);
if (INVALID_HANDLE_VALUE == hFind)
{
return ;
}
do
{
if ((dirs == ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0)) &&
( !ms_IgnoreHidden || (ffd.dwFileAttributes & _A_HIDDEN) == 0 ) &&
(!dirs || !is_reserved_dir (ffd.cFileName)))
{
// recurse
base_dir = directory;
base_dir.append (ffd.cFileName).append (mask);
findFiles(base_dir, recursive, dirs, simpleList, detailList);
}
}
while (FindNextFile(hFind, &ffd) != 0);
FindClose(hFind);
}
}


Don't forget to compile Mois in .net 4.0 (by default with mogrebuilder is 4.5)

Beauty

04-01-2014 09:34:49

Thanks for sharing your results. :D

I found some solutions
You can't add path like c:\windows\fonts, but you can add c:\windows\fonts\*.*
You can't add path like ., but you can add *.*
but you can add path like ..\..\media.
Strange !


Yes, that's really strange. I suppose it's related to the Ogre C++ functionality (and not to the Mogre wrapper).
So I suggest to post this issue in the Ogre main forum and/or create an entry in the Ogre bug tracker.

It's seem to be good in C++ function but the pointer returned by C# call is null.
...
I've the solution

Good boy.

Best solution would be to have an update in the official Ogre repository.
If not possible, maybe we can add a modification step to the MogreBuilder (or somewhere the Mogre wrapper process).
E.g. after cloning the Ogre repository apply a modification procedure. This could be done by a patch, but this way works as long as the original file isn't modified. Even if the modification is on a different place of the file, we'll get trouble in the future. (Code modification fails and the user doesn't know that a bug is reopened.)

Unfortunately we don't see the related differences.
My suggestion:
* Create an account on BitBucket
* Add clones of the Ogre, Mogre and MogreBuilder repositories
* Apply your custom changes

Advantages:
* Good overview of changes
* It's easy to use for everybody
* MogreBuilder users just need to point to the modified repositories
* You can push (offer) changes to the official repositories
* For commits everybody can add comments to each line of code on the BitBucket website
* You have a backup of your data and can synchronise between PCs with ease

Don't forget to compile Mois in .net 4.0 (by default with mogrebuilder is 4.5)
Do you mean the .NET Version?
Is this problem only related to x64 builds?

If you add improvements to the MogreBuilder, we would be happy if you publish it.
Give me your email address or BitBucket user name and I'll give you write access.

RMI

06-01-2014 09:40:07

hi,

I never work with bitbucket and I'm afraid to do silly things.
For the MOIS problem, it's a x86 and a x64 problem.

Happy new year. :D

Beauty

06-01-2014 13:54:55


I never work with bitbucket and I'm afraid to do silly things.

No problem.
Just create an account and create clones of the wanted repository for experiments (easy to do on the bitbucket website, just by URL). You can't damage anything, when you use your own repository clone. By the way ... you can also make experiments on your hard drive with a local repository. Don't be afraid of Mercurial and bitbucket.

Beauty

09-01-2014 07:28:12


I compiled Mogre with MogreBuilder with the option -x64.


Did you need modifications for the MogreBuilder sources or worked it well?

Beauty

09-02-2014 20:14:27

RMI, user se5a has problems with MogreBuilder and MOIS.
It's about the .NET version.

Maybe you like to have a look to it?
His first post about his problem is here in the topic MogreBuilder has error:
viewtopic.php?p=102355#p102355