1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     gfx_ResFog.cpp
4 
5   Copyright (C)2009-2010 Nintendo Co., Ltd./HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Revision: 14509 $
14  *---------------------------------------------------------------------------*/
15 
16 #include "../precompiled.h"
17 
18 #include <nw/gfx/res/gfx_ResUtil.h>
19 #include <nw/gfx/res/gfx_ResLight.h>
20 #include <nw/gfx/res/gfx_ResGraphicsFile.h>
21 
22 namespace nw {
23 namespace gfx {
24 namespace res {
25 
26 //----------------------------------------
27 Result
Setup(os::IAllocator * allocator,ResGraphicsFile graphicsFile)28 ResFog::Setup(os::IAllocator* allocator, ResGraphicsFile graphicsFile)
29 {
30     NW_UNUSED_VARIABLE(allocator);
31 
32     Result result = RESOURCE_RESULT_OK;
33 
34     ResReferenceLookupTable refLut =
35         ResDynamicCast<ResReferenceLookupTable>(this->GetFogSampler());
36 
37     Result referenceResult = SetupReferenceLut(refLut, graphicsFile);
38 
39     if (referenceResult.IsSuccess())
40     {
41         result |= this->GetFogSampler().Setup();
42     }
43 
44     result |= referenceResult;
45 
46     return result;
47 }
48 
49 //----------------------------------------
50 void
Cleanup()51 ResFog::Cleanup()
52 {
53     ut::SafeCleanup(this->GetFogSampler());
54 }
55 
56 } /* namespace res */
57 } /* namespace gfx */
58 } /* namespace nw */
59 
60