[solved] Atlas is an unknown resource type

[solved] Atlas is an unknown resource type

Postby PixelCuiCui » Wed Feb 24, 2016 1:42 am

Hi, :)

I followed this tutorial : https://www.youtube.com/watch?v=g-EegpfEEQU&list=PLGdWeqZXKLHBYOxKWlHtEXLOcRq7D2CRq&index=5 (and https://github.com/oxygine/oxygine-framework/wiki/resources2 to help) but at the end my project compile but when VS launch it, there is a bug with this error:
Code: Select all
error: unknown resource. type: 'atlas' id: ''
error: Assert! !"unknown resource type" in <my_path>\oxygine\oxygine-framework\oxygine\src\res\resources.cpp:270
Assertion failed!

My code :
<my_path>/tuto/data/res.xml
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<resources>

  <set path="images"/>
  <atlas>
    <image file="play.png"/>
  </atlas>

</resources>

<my_path>/tuto/src/PlayButton.cpp
Code: Select all
#include "PlayButton.h"

PlayButton::PlayButton()
{
   res.loadXML("res.xml");
   setResAnim(res.getResAnim("play"));
}

<my_path>/tuto/src/Main.cpp
Code: Select all
#include "Main.h"
#include "PlayButton.h"

void mainPreInit()
{
   spPlayButton playButton = new PlayButton;
   getStage()->addChild(playButton);
}

and my directory structure
Image

If I try to load a font, it also bug.
I don't understand because I do exactly the same than exemples project however it doesn't work but when I try to launch an existing exemple it's work fine. :?
I spend my all evening on this bug but without succes so I came to you for help. Thanks in advance :)
Last edited by PixelCuiCui on Wed Feb 24, 2016 10:56 am, edited 1 time in total.
PixelCuiCui
 
Posts: 2
Joined: Wed Feb 24, 2016 1:00 am

Re: Atlas is an unknown resource type

Postby BieJay » Wed Feb 24, 2016 2:24 am

Have you tried
Code: Select all
//...
res.loadXML("<your_path>/tuto/data/res.xml");
//...

instead of only "res.xml" ?

"res.xml" only works, if res.xml is in the same directory as your compiled application.
Last edited by BieJay on Wed Feb 24, 2016 10:03 am, edited 1 time in total.
BieJay
 
Posts: 4
Joined: Sat Feb 20, 2016 5:16 pm
Location: Germany

Re: Atlas is an unknown resource type

Postby admin » Wed Feb 24, 2016 9:36 am

you should load resources (and any other interactions with oxygine) only after core::init call
User avatar
admin
Site Admin
 
Posts: 714
Joined: Mon Oct 21, 2013 6:47 pm

Re: Atlas is an unknown resource type

Postby PixelCuiCui » Wed Feb 24, 2016 10:55 am

@BieJay I tried but it didn't worked, I think if your file is in the "data" directory you don't need to precise your path (according to examples).

@admin Effectively, if i move
Code: Select all
   spPlayButton playButton = new PlayButton;
   getStage()->addChild(playButton);

into my init function instead my preinit function and it works perfectly.

Thank a lot :D
PixelCuiCui
 
Posts: 2
Joined: Wed Feb 24, 2016 1:00 am

Re: [solved] Atlas is an unknown resource type

Postby jtpaquet » Sun Mar 12, 2017 3:24 am

I have this class Hero and the constructor is

Code: Select all
Hero::Hero()
{
   resHero.loadXML("lacasse.xml");
   setResAnim(resHero.getResAnim("stand_lacasse"));
   setPosition(lacasse_origine);
   nb_saut = 0;
}


In my attribute of the class Hero I had initialized the Resources object resHero. I create an object of Hero like this in my main in the Main_init() like this

Code: Select all
void Main_init()
{
   spSprite galaxy = new Sprite;
   
   resGame.loadXML("res.xml");

   spHero lacasse = new Hero;


   galaxy->setResAnim(resGame.getResAnim("galaxy"));
   galaxy->attachTo(getStage());

   lacasse->attachTo(getStage());

}


Note: Galaxy is the background. It has another resource and i am able print it. The Main_init() is after core::init and I still get the error
Code: Select all
Assertion failed!

Program: ...ntures\proj.win32\Debug_v140\LacasseAdventures.exe
File: c:\users\jtpaq\documents\oxygine\oxygine-...\oxygine.cpp
Line: 982

Expression: !"handleErrorPolicy error."

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts


The resource seems to load because I can see my sprites in the textures inspector window when I run the project.

Thanks!

Note: In my output I have this message

Code: Select all
'LacasseAdventures.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
jtpaquet
 
Posts: 6
Joined: Thu Mar 09, 2017 10:07 pm

Re: [solved] Atlas is an unknown resource type

Postby admin » Sun Mar 12, 2017 6:09 am

Expression: !"handleErrorPolicy error."

this error means oxygine can't find file
check log, it has exact error
User avatar
admin
Site Admin
 
Posts: 714
Joined: Mon Oct 21, 2013 6:47 pm

Re: [solved] Atlas is an unknown resource type

Postby jtpaquet » Mon Mar 13, 2017 4:02 pm

It says that it cannot find or open the PDB file, but I can see it in the Debugv_140 folder.
jtpaquet
 
Posts: 6
Joined: Thu Mar 09, 2017 10:07 pm

Re: [solved] Atlas is an unknown resource type

Postby admin » Mon Mar 13, 2017 4:48 pm

:) missing PDB is not error
show all log then
User avatar
admin
Site Admin
 
Posts: 714
Joined: Mon Oct 21, 2013 6:47 pm

Re: [solved] Atlas is an unknown resource type

Postby jtpaquet » Mon Mar 13, 2017 4:52 pm

Code: Select all
'LacasseAdventures.exe' (Win32): Loaded 'C:\Users\jtpaq\Documents\Visual Studio 2015\Projects\LacasseAdventures\proj.win32\Debug_v140\LacasseAdventures.exe'. Symbols loaded.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Unloaded 'C:\Windows\SysWOW64\kernel32.dll'
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\opengl32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Users\jtpaq\Documents\Visual Studio 2015\Projects\LacasseAdventures\data\zlib.dll'. Module was built without symbols.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp140d.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\vcruntime140d.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Users\jtpaq\Documents\Visual Studio 2015\Projects\LacasseAdventures\data\pthreadVCE2.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcryptprimitives.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr100.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32full.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Users\jtpaq\Documents\Visual Studio 2015\Projects\LacasseAdventures\data\SDL2.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\win32u.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shell32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cfgmgr32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmm.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\version.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\glu32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ddraw.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winmmbase.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dciman32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\windows.storage.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\combase.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbase.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\powrprof.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\shlwapi.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel.appcore.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\SHCore.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ucrtbased.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\profapi.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ole32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleaut32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp_win.dll'. Cannot find or open the PDB file.
000 build settings OX_DEBUG _DEBUG
000 initialize oxygine
001 SDL build
026 creating window 960 640
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\uxtheme.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Program Files (x86)\Common Files\Microsoft Shared\Ink\tiptsf.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dwmapi.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\igdlh64.inf_amd64_82119d956c80af5a\ig9icd32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\wtsapi32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\System32\DriverStore\FileRepository\igdlh64.inf_amd64_82119d956c80af5a\igc32.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\clbcatq.dll'. Cannot find or open the PDB file.
536 display size: 960 640
555 ZipFS, total files: 13
566 DebugActor::initialize
573 ZipFS, total files: 13
605 oxygine initialized
1273 error: can't find resource: 'stand_lacasse' in 'lacasse.xml'
Assertion failed!

Program: ...ntures\proj.win32\Debug_v140\LacasseAdventures.exe
File: c:\users\jtpaq\documents\oxygine\oxygine-...\oxygine.cpp
Line: 982

Expression: !"handleErrorPolicy error."

For information on how your program can cause an assertion
failure, see the Visual C++ documentation on asserts

(Press Retry to debug the application - JIT must be enabled)'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\UIAutomationCore.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\userenv.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sxs.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\oleacc.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinapi.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\twinapi.appcore.dll'. Cannot find or open the PDB file.
'LacasseAdventures.exe' (Win32): Loaded 'C:\Windows\SysWOW64\bcrypt.dll'. Cannot find or open the PDB file.
jtpaquet
 
Posts: 6
Joined: Thu Mar 09, 2017 10:07 pm

Re: [solved] Atlas is an unknown resource type

Postby admin » Mon Mar 13, 2017 8:26 pm

Code: Select all
1273 error: can't find resource: 'stand_lacasse' in 'lacasse.xml'
Assertion failed!
User avatar
admin
Site Admin
 
Posts: 714
Joined: Mon Oct 21, 2013 6:47 pm


Return to oxygine-framework

Who is online

Users browsing this forum: No registered users and 3 guests

cron