The latest SVN bugs thread

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

CMountPointReader is broken in trunk (r3382). The addition of "Auto incrementing SFileListEntry.ID" (r3336) in CFileList::addItem() appears to be the problem.

CMountPointReader expects ID to be a unique index into "CMountPointReader::RealFileNames". The first entry added to RealFilesNames (index 0) is added with an ID of 1. The second entry (index 1) is also added with an ID of 1.

Then, when you open a file via CMountPointReader::createAndOpenFile(first entry filename), it opens the file with an ID of 1 which actually opens the second file.

Test Case:

Code: Select all

void test4()
{
    IrrlichtDevice* nd;
    IFileSystem* fs;
    IReadFile* rf;
    IFileArchive* fa;
    const IFileList* fl;
    bool rc;

    // CMountPointReader test
    nd = createDevice(EDT_NULL);

    fs = nd->getFileSystem();

    rc = fs->addFileArchive("c:/scenes/", false, false, EFAT_FOLDER);

    fa = fs->getFileArchive(0);

    fl = fa->getFileList();

    u32 count = fl->getFileCount();
    for(u32 i=0; i<count; i++)
    {
        printf("       fileName: %s\n", fl->getFileName(i).c_str());
        printf("          isDir: %d\n", fl->isDirectory(i));
        printf("   FullFileName: %s\n", fl->getFullFileName(i).c_str());
        printf("           Path: %s\n", fl->getPath().c_str());
        printf("             ID: %d\n", fl->getID(i));
        printf("\n");
    }

    rf = fs->createAndOpenFile("mdl/Cube.irrmesh");

    if(rf)
    {
        printf("open mdl/Cube.irrmesh success.\n");
        printf("rf->getFileName(): %s\n", rf->getFileName().c_str());
    }
    else
    {
        printf("open mdl/Cube.irrmesh failed.\n");
    }
    if(rf)
        rf->drop();

    nd->drop();
}
Directory structure for test case "c:/scenes/":

Code: Select all

c:/scenes/
          irrb.log
          mdl/
          mdl/Cube.irrmesh
          Scene.irr
          tex/
Test Case Output (Irrlicht 1.7):

Code: Select all

Irrlicht Engine version 1.7.1-beta
Microsoft Windows 7 Ultimate Edition  (Build 7
       fileName: mdl
          isDir: 1
   FullFileName: mdl
           Path: c:/scenes/
             ID: 0

       fileName: tex
          isDir: 1
   FullFileName: tex
           Path: c:/scenes/
             ID: 0

       fileName: irrb.log
          isDir: 0
   FullFileName: irrb.log
           Path: c:/scenes/
             ID: 1

       fileName: cube.irrmesh
          isDir: 0
   FullFileName: mdl/cube.irrmesh
           Path: c:/scenes/
             ID: 0

       fileName: scene.irr
          isDir: 0
   FullFileName: scene.irr
           Path: c:/scenes/
             ID: 2

open mdl/Cube.irrmesh success.
rf->getFileName(): c:/scenes/mdl/cube.irrmesh
Test Case Output (Irrlicht trunk r3382):

Code: Select all

Irrlicht Engine version 1.7.1-beta
Microsoft Windows 7 Ultimate Edition  (Build 7600)
       fileName: mdl
          isDir: 1
   FullFileName: mdl
           Path: c:/scenes/
             ID: 0

       fileName: tex
          isDir: 1
   FullFileName: tex
           Path: c:/scenes/
             ID: 2

       fileName: irrb.log
          isDir: 0
   FullFileName: irrb.log
           Path: c:/scenes/
             ID: 1

       fileName: cube.irrmesh
          isDir: 0
   FullFileName: mdl/cube.irrmesh
           Path: c:/scenes/
             ID: 1

       fileName: scene.irr
          isDir: 0
   FullFileName: scene.irr
           Path: c:/scenes/
             ID: 2

open mdl/Cube.irrmesh success.
rf->getFileName(): c:/scenes/irrb.log      <------ problem
Possible Solution:

Code: Select all

Index: source/Irrlicht/CMountPointReader.cpp
===================================================================
--- source/Irrlicht/CMountPointReader.cpp	(revision 3382)
+++ source/Irrlicht/CMountPointReader.cpp	(working copy)
@@ -118,7 +118,7 @@
 
 		if (!list->isDirectory(i))
 		{
-			addItem(full, list->getFileOffset(i), list->getFileSize(i), false, RealFileNames.size());
+			addItem(full, list->getFileOffset(i), list->getFileSize(i), false, RealFileNames.size()+1);
 			RealFileNames.push_back(list->getFullFileName(i));
 		}
 		else
@@ -148,7 +148,7 @@
 	if (index >= Files.size())
 		return 0;
 
-	return createReadFile(RealFileNames[Files[index].ID]);
+	return createReadFile(RealFileNames[Files[index].ID-1]);
 }
 
 //! opens a file by file name
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I didn't find a way to reproduce this with arbitrary directories. What's the point to look for here?
pc0de
Posts: 300
Joined: Wed Dec 05, 2007 4:41 pm

Post by pc0de »

I guess the main point is that the ID's aren't unique for files that exist in sub-directories of the root directory that is passed to addFileArchive(). They are unique within the sub-directory but not across the entire "archive".

That's why in the example I gave above, opening "mdl/Cube.irrmesh" actually opens "irrb.log" - they both have the same ID's.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

I have found 1 bug.

-The demo is missing the white particles after you shot a fireball using the hardware based drivers (they are pressent when you enable the Burning Video driver, not obstant)

I donwloaded the SVN version, and compiled it with Code::Blocks 10.05 enabling this stuff:

-s -S -O2 -fomit-frame-pointer
I compiled it with the Nov2008 DXSDK, and DirectX enabled.

The version of the SVN is the current one: 3426.

Then, i compiled the demo with its own settings.

Code::Blocks changed the version of GCC included, but i am sure it is not a matter of the compiler because i compiled a prior version (1.7.1) and it compiled well. Even improving the size of the DLL.

EDIT: Forget the issue with the antialiasing always enabled in DX (if anyone noticed it anyway...) it was the video driver that was configured to enable it always.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
puh
Posts: 356
Joined: Tue Aug 26, 2003 3:53 pm

Post by puh »

Ok.
Btw, hybrid, for getting latest svn to compile with msvc toolkit 2003 i have to add additional option in compiler settings:

Code: Select all

/Zc:wchar_t
or else error C2535 appear:

Code: Select all

irrlichtSVN\include\irrXML.h(376) : error C2535: 'irr::io::xmlChar<T>::xmlChar(wchar_t)' : member function already defined or declared
anchor
Posts: 9
Joined: Thu Jun 25, 2009 2:57 pm
Location: Hungary

Post by anchor »

there is a bug in the trunk... the DDS loader always decompress the image to rgb color data :(
why don't you apply Nardo's DDS patch?
do you need help?
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

The mipmap lod bias doesn't seem to work properly on the texture layer 0 of a material.

The version i checked this is the SVN 3431.

Simply, try to change it on the texture layer 0 and the texture layer 1 in any Material, in the first texture it seems to change, making the textures more blurry, while in the texture 0 it always remains unchanged.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Post by Mel »

The Tangents and Binormals are never updated.

I have checked this in the code: when it comes to perform the skinning process, it can be told to the mesh to animate properly the normals, but the binormals and tangents are always ignored.

This leads to incorrect lighting, and should be corrected.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Nalin
Posts: 194
Joined: Thu Mar 30, 2006 12:34 am
Location: Lacey, WA, USA
Contact:

Post by Nalin »

The _IRR_WCHAR_FILESYSTEM define is broken again. It results in a failed compile. I started to try to fix it using fschar_t* instead of c8*, but I quickly ran into another issue: SAttributeReadWriteOptions::filename is a c8*. Will changing that to be an fschar_t break a bunch of stuff? It compiles fine. I just don't want to submit a patch that breaks things.

EDIT:
This is also broken:

Code: Select all

path CFileSystem::getRelativeFilename(const path& filename, const path& directory) const
{
	...
	path.split(list1, "/\\", 2);
	path2.split(list2, "/\\", 2);
Seems like Irrlicht needs something like what Windows uses:

Code: Select all

#ifdef  UNICODE                     // r_winnt
#define __TEXT(quote) L##quote      // r_winnt
#else
#define __TEXT(quote) quote         // r_winnt
Where would be the best place to put something like that? I put my own implementation in irrTypes.h. Is there a better place?

EDIT:
The Visual Studio 2010 project is broken. CSceneLoaderIrr.cpp is set as a header file, so it isn't compiled. Also, ISceneLoaderIrr.h, CSceneLoaderIrr.h, and CSceneLoaderIrr.cpp are not properly categorized.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Yeah, I also think that we won't succeed without such a define. I already inserted such code into the win32 device, but for now left the remaining places open and unfixed. But I guess there's no way without. irrTypes could be a place, or IrrCompileConfig
The vc10 project is fixed now.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Unable to compile head trunk (rev. 3598) in VS2008 :(
Getting next errors:

Code: Select all

Errors:
-----------
1) \source\Irrlicht\CFileSystem.cpp	706	error C2664: 'irr::u32 irr::core::string<T>::split<irr::core::list<irr::io::path>>(container &,const T *const ,irr::u32,bool,bool) const' : cannot convert parameter 2 from 'const char [3]' to 'const wchar_t *const '
2) \source\Irrlicht\CFileSystem.cpp	707	error C2664: 'irr::u32 irr::core::string<T>::split<irr::core::list<irr::io::path>>(container &,const T *const ,irr::u32,bool,bool) const' : cannot convert parameter 2 from 'const char [3]' to 'const wchar_t *const '
3) \source\Irrlicht\CD3D8Texture.cpp	254	error C2065: 'readOnly' : undeclared identifier
4) \source\Irrlicht\CSceneManager.cpp	2237	error C2440: '=' : cannot convert from 'const irr::fschar_t *' to 'const irr::c8 *'

Warnings:
------------
1) \source\irrlicht\CNullDriver.h	835	warning C4996: 'irr::video::IVideoDriver::createImage': was declared deprecated
2) \source\irrlicht\CNullDriver.h	835	warning C4996: 'irr::video::IVideoDriver::createImage': was declared deprecated
P.S.: I believe this is because of enabled _IRR_WCHAR_FILESYSTEM.
Nalin
Posts: 194
Joined: Thu Mar 30, 2006 12:34 am
Location: Lacey, WA, USA
Contact:

Post by Nalin »

greenya wrote:P.S.: I believe this is because of enabled _IRR_WCHAR_FILESYSTEM.
You have to use the patch I supplied to the tracker.
http://sourceforge.net/tracker/?func=de ... tid=540676

Let me know if I need to updated it for the latest trunk.
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

Yes, Nalin, your patch helps with "wide-char" errors, but still I have next errors and warnings:

Code: Select all

Error: \source\Irrlicht\CD3D8Texture.cpp (254): 'readOnly' : undeclared identifier
Warning: \source\irrlicht\CNullDriver.h (835): 'irr::video::IVideoDriver::createImage': was declared deprecated
Warning: \source\Irrlicht\CSMFMeshFileLoader.cpp (162): '<' : signed/unsigned mismatch
P.S.: anyway, I also do not like the idea to have desynchronized Irrlicht source (mine local copy with this patch from server's copy without) :(
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Nalin's patch was already accepted, but needs some more testing for the IAttribute changes etc. So it shouldn't be too long until this will be applied to the main repository. The other problems should be fixed now, don't know if the deprecation warnings still work for user code, though...
greenya
Posts: 1012
Joined: Sun Jan 21, 2007 1:46 pm
Location: Ukraine
Contact:

Post by greenya »

hybrid wrote:Nalin's patch was already accepted, but needs some more testing for the IAttribute changes etc. So it shouldn't be too long until this will be applied to the main repository.
This is the shortest way to fix
\source\Irrlicht\CFileSystem.cpp at line 706:

Code: Select all

#ifdef _IRR_WCHAR_FILESYSTEM
	path.split(list1, L"/\", 2);
	path2.split(list2, L"/\", 2);
#else
	path.split(list1, "/\", 2);
	path2.split(list2, "/\", 2);
#endif
But, this is small point patch; Nalin's way is more better, since he adds new macro which can be used everywhere for string double quoted constans (just for the record, for this issues also exists Microsoft specific "_T" macro).

Also if Filename in io::SAttributeReadWriteOptions will stay char*, then next small patch also necessary (but I don't like it) in \source\Irrlicht\CSceneManager.cpp at line 2237:

Code: Select all

options.Filename=core::stringc(currentPath).c_str();
Also the warning in \source\Irrlicht\CSMFMeshFileLoader.cpp at line 162: '<' : signed/unsigned mismatch.
Fix:

Code: Select all

for (i=0; i < (u32)triangleCount*3; ++i)
Post Reply