Skip to content

Commit

Permalink
Client|FX|LensFlares: Updated to use lensflares.pack
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 1, 2014
1 parent 0e8d008 commit a510f8c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
6 changes: 6 additions & 0 deletions doomsday/build/scripts/packres.py
Expand Up @@ -84,6 +84,12 @@ def process_dir(path, dest_path):
[ ('client/data/renderer.pack', '') ] )
p.create('renderer.pack')

# lensflares.pack
p = Pack()
p.add_files(
[ ('client/data/lensflares.pack', '') ] )
p.create('lensflares.pack')

# libdoom.pk3
p = Pack()
p.add_files(
Expand Down
10 changes: 7 additions & 3 deletions doomsday/client/src/render/fx/lensflares.cpp
Expand Up @@ -45,6 +45,7 @@ namespace fx {
*/
struct FlareData
{
ImageBank images;
AtlasTexture atlas;
enum FlareId {
Burst,
Expand All @@ -69,6 +70,9 @@ struct FlareData
DENG_ASSERT_IN_MAIN_THREAD();
DENG_ASSERT_GL_CONTEXT_ACTIVE();

Folder const &pack = App::fileSystem().find<Folder>("lensflares.pack");
images.addFromInfo(pack.locate<File>("images.dei"));

atlas.setAllocator(new KdTreeAtlasAllocator);

flare[Exponent] = atlas.alloc(flareImage("exponent"));
Expand All @@ -87,9 +91,9 @@ struct FlareData
LOGDEV_GL_XVERBOSE("Releasing shared data");
}

static Image const &flareImage(String const &name)
Image const &flareImage(String const &name)
{
return ClientApp::renderSystem().images().image("fx.lensflares." + name);
return images.image("fx.lensflares." + name);
}

Rectanglef uvRect(FlareId id) const
Expand Down Expand Up @@ -119,7 +123,7 @@ struct FlareData
};

#ifdef FX_TEST_LIGHT
struct TestLight : public ILightSource
struct TestLight : public IPointLightSource
{
public:
float radius;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/client/src/render/rendersystem.cpp
Expand Up @@ -228,8 +228,8 @@ DENG2_PIMPL(RenderSystem)
*/
void loadImages()
{
Folder const &renderPack = App::fileSystem().find<Folder>("renderer.pack");
images.addFromInfo(renderPack.locate<File>("images.dei"));
//Folder const &renderPack = App::fileSystem().find<Folder>("renderer.pack");
//images.addFromInfo(renderPack.locate<File>("images.dei"));
}
};

Expand Down

0 comments on commit a510f8c

Please sign in to comment.