njord Posted January 17, 2012 Share Posted January 17, 2012 (edited) Hello all, We have created a LE application that answers our needs, and exported (compiled) it as a "dll" rather than an "exe" executable. Our main simulation.exe loads "OurLeApp.dll" and uses it to visualize the simulation. Very rarely, on some computers and on some projects, LE "fails to load" the resources (mat,dds etc.) of some gmf's that are included in the sbx file (for example, City.sbx, inside of it there is a model referenced as abstract::hospital.gmf). Although it cannot open the gmf models on the sbx, it shows the vegetation layers and the terrain surface. Of course when I move the entire terrain which is the "sbx, dat, raw etc. files, and the models referenced" to "Maps folder" in LESDK everything works, no problems. Our folder system is like : (Bold font indicates files&folders copied from LESDK) out ..simulation.exe ..Scripts ..bin ....ig ......leadwerksrenderer ........OurLeApp.dll ........engine.dll ........other LE related dlls ........shaders.pak ..data ....ig ......leadwerksrenderer ........Materials ........Models ........Sound ........and other necessary folders from LESDK ....entities ......minibus ........minibus.gmf ........minibus.mat ........minibus.dds ........minibus.lua ......airplane ........airplane.gmf ........airplane.mat ........airplane.dds ........airplane.lua ....terrains ......city ........city.sbx ........citymodelfiles ..........hospital.gmf ..........hospital.mat ..........hospital.dds ..........hospital.lua ..........school.gmf ..........school.mat ..........school.dds ..........school.lua First of all my working directory is out. "simulation.exe" is inside the "out folder" and started from there. At the initialization step of "OurLeApp" I use RegisterAbstractPath("./data/ig/leadwerksrenderer"); //(relative folder paths to out folder) RegisterAbstractPath("./data/terrains"); to make sure engine.dll sees both default LE files (out/data/ig/leadwerksrenderer) and terrain models (out/data/terrains) files. I do not register ./data/entities because I add them with LoadModel() and use exact paths (not abstract path). Again, this system works perfectly, but 1 out of 50 times, on some computers models and related files referenced in sbx with abstract paths cannot be found by LE. You have any idea ? One more question : is using RegisterAbstractPath twice correct ? Edit: I have divided the 1800+ files (hospital & school gmf,dds,mat,etc.) of the terrain into 4 folders. And now sbx gets opened. PC is win32bit btw if it helps. Edit2: sbx only fails to load gmf's, since it cannot open gmf's, it never searches for related mats or dds' anyway. Edited January 18, 2012 by njord Quote Link to comment Share on other sites More sharing options...
Josh Posted January 17, 2012 Share Posted January 17, 2012 If you call registerabstractpath twice, the second file names will overwrite the first. It just stores the file name with no directory, and a link to the full path. You don't need to call it at all though, because it automatically gets called for the current directory when the DLL starts up. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Pixel Perfect Posted January 17, 2012 Share Posted January 17, 2012 I don't think that explains why the files are on occasions failing to load! Ken reported a similar issue to this here: http://www.leadwerks...__fromsearch__1 Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
njord Posted January 23, 2012 Author Share Posted January 23, 2012 OS is Win7 32 bit . There is an sbx file and a lot of gmf's referenced in it. Gmf's and other related .mat .dds etc. files (1800+files) are in a single folder, under LE app working directory. GMF's fail to load, but app does not crash. I do not see any gmf's except LE terrain surface, vegetation layer, atmosphere. For testing, I copy a single gmf to .ModelsEntitiesEnvironmentAtmosphere. Surprisingly LE finds its mat and dds inside the big folder and loads it. However rest of the gmf's, stil not loaded. I copy whole app to a Win7 64 bit pc. Everything opens. OR I divide big folder into 4 folders in 32 bit pc, Everything opens. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.