Aggror
Topic Author
Posts: 4
Joined: 07 Apr 2014, 14:52

[1.2] Scanning for resources

28 Jul 2014, 18:41

I am having some trouble scanning for the resources in the data folder. Using the Leadwerks version.
I have the default SDK. I am running the command tool. I tried several commands but nothing seems to be picked up by the tool.
Odd thing is it worked a month ago. Now, resources are no longer detected.

Any clues?
cmd.JPG
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Scanning for resources

28 Jul 2014, 19:19

Hi,

You are using the latest beta where the new architecture for resources has been incorporated. The wrapper for LeadWerks is yet not updated, sorry for that. I am in contact with the developer that helped us in the past with that part and we expect to have it updated very soon.

Meanwhile, the new process is relatively easy. If you execute the command without parameters you will get the help:
> Resource.BuildTool.exe

------------------------------------------------------------------------------
 Build Tool - noesisGUI Importer v0.90
------------------------------------------------------------------------------

 Usage:

     BuildTool filename  [options]
     BuildTool directory [options]

 Options:

     -platform platform
         Target platform used to build input resources

     -outdir directory
         Output folder where imported resources will be copied

     -tempdir directory
         Temporary folder for intermediate files

     -modstamp
         Do not run if target file is older than source

     -header
         Generates a c-header file instead of a binary one

     -deps
         In this mode only XAML files and their dependencies,
         like images and fonts, are processed

     -verbose
         Increases verbosity


 Registered platforms:

     DX9
     DX11
     GL
     GLES
     iOS
     Android
At execution time noesisGUI needs to know where the preprocessed resources are located. This can be configured by using the helper class LocalResourceProvider.
// Look for resources in "MyData" folder located in the current working directory
Ptr<ResourceProvider> provider = *new LocalResourceProvider("MyData");
NsGetSystem<IResourceSystem>()->AddProvider(provider.GetPtr());
LocalResourceProvider inherits from ResourceProvider, a base class with several virtual functions that can be reimplemented to customize how resources are loaded. For example, if you used the -header switch with the BuildTool, you must provide a memory stream this way:
namespace
{
#include "Button.xaml.h"
}

class MyProvider: public ResourceProvider
{
private:
    Ptr<Core::IStream> RequestFile(const NsChar* name)
    {
        if (String::Compare(name, "Button.xaml", IgnoreCase_True) == 0)
        {
            return *new MemoryStreamR(Button_xaml, sizeof(Button_xaml));
        }
    }
};
 
Aggror
Topic Author
Posts: 4
Joined: 07 Apr 2014, 14:52

Re: Scanning for resources

01 Aug 2014, 00:45

Specifying your own location is a nice improvement.

Are all the options obligated? because I am having some trouble getting the resources build.
Knipsel.JPG
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Scanning for resources

01 Aug 2014, 01:12

Everything is optional. For example, to import a xaml:
Resource.Importer Button.xaml
should work using the default platform and generating the output in the out directory.

What problems are you getting? Being a beta, is time to improve all the usability problems.
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Scanning for resources

01 Aug 2014, 01:14

Ups... You posted already your scenario.

The problem is that you are using --platform instead of -platform.

I had that error so many times that I wonder if we should support both formats....
 
Aggror
Topic Author
Posts: 4
Joined: 07 Apr 2014, 14:52

Re: [1.2] Scanning for resources

01 Aug 2014, 18:00

Thanks,

I think I used 2 stripes because it says so in the docs:
http://www.noesisengine.com/docs/Gui.Core.SDKGuide.html
You know how to build .xaml files and generate a cache that can be used at runtime. If not, read the BuildTool document. For these samples we will be using data from the Gui/Tutorials package. It is mandatory that you build those resources for the desired platforms.
> Resource.BuildTool.exe scan Gui/Tutorials --platform DX9
> Resource.BuildTool.exe build Gui/Tutorials --platform DX9

> Resource.BuildTool.exe scan Gui/Tutorials --platform GL
> Resource.BuildTool.exe scan Gui/Tutorials --platform GL

http://www.noesisengine.com/docs/Resour ... dTool.html
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: [1.2] Scanning for resources

03 Aug 2014, 23:11

The online documentation is in sync with the latest stable release. You need to use the documentation contained inside the zip for the v1.2 version. There are many things yet not updated there, although the BuildTool document was already reviewed.

Anyway, I think that BuildTool should continue using -- for its switches. Will be changed for the next release.

Thanks!

Who is online

Users browsing this forum: No registered users and 0 guests