| 1 | /* | 
|---|
| 2 |    orxonox - the future of 3D-vertical-scrollers | 
|---|
| 3 |  | 
|---|
| 4 |    Copyright (C) 2006 orx | 
|---|
| 5 |  | 
|---|
| 6 |    This program is free software; you can redistribute it and/or modify | 
|---|
| 7 |    it under the terms of the GNU General Public License as published by | 
|---|
| 8 |    the Free Software Foundation; either version 2, or (at your option) | 
|---|
| 9 |    any later version. | 
|---|
| 10 |  | 
|---|
| 11 |    ### File Specific: | 
|---|
| 12 |    main-programmer: Benjamin Grauer | 
|---|
| 13 |    co-programmer: ... | 
|---|
| 14 | */ | 
|---|
| 15 |  | 
|---|
| 16 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING | 
|---|
| 17 |  | 
|---|
| 18 | #include "resource.h" | 
|---|
| 19 |  | 
|---|
| 20 |  | 
|---|
| 21 | namespace Loading | 
|---|
| 22 | { | 
|---|
| 23 |   /** | 
|---|
| 24 |    * @brief Initializes a shared Resource | 
|---|
| 25 |    */ | 
|---|
| 26 |   Resource::SharedResource::SharedResource() | 
|---|
| 27 |   { | 
|---|
| 28 |     this->referenceCount = 1; | 
|---|
| 29 |     this->type = CL_NULL; | 
|---|
| 30 |     this->prio = RP_NO; | 
|---|
| 31 |   } | 
|---|
| 32 |  | 
|---|
| 33 |  | 
|---|
| 34 |   /** | 
|---|
| 35 |    * @brief standard constructor | 
|---|
| 36 |   */ | 
|---|
| 37 |   Resource::Resource (const std::string& fileName, ResourcePriority prio) | 
|---|
| 38 |   { | 
|---|
| 39 |     this->setClassID(CL_RESOURCE, "Resource"); | 
|---|
| 40 |     this->resource = NULL; | 
|---|
| 41 |  | 
|---|
| 42 |   } | 
|---|
| 43 |  | 
|---|
| 44 |   /** | 
|---|
| 45 |    * @brief standard deconstructor | 
|---|
| 46 |    */ | 
|---|
| 47 |   Resource::~Resource () | 
|---|
| 48 |   {} | 
|---|
| 49 |  | 
|---|
| 50 |  | 
|---|
| 51 |   bool Resource::load(std::string& fileName, ResourcePriority prio, | 
|---|
| 52 |                       const MultiType& param0, const MultiType& param1, const MultiType& param2) | 
|---|
| 53 |   {} | 
|---|
| 54 |  | 
|---|
| 55 |  | 
|---|
| 56 |   bool Resource::cache(std::string& fileName, ResourcePriority prio, | 
|---|
| 57 |                        const MultiType& param0, const MultiType& param1,  const MultiType& param2) | 
|---|
| 58 |   {} | 
|---|
| 59 |  | 
|---|
| 60 |  | 
|---|
| 61 |   /** | 
|---|
| 62 |    * @brief reloads the resource. | 
|---|
| 63 |    */ | 
|---|
| 64 |   bool Resource::reload() | 
|---|
| 65 |   {} | 
|---|
| 66 |  | 
|---|
| 67 |   bool Resource::unload() | 
|---|
| 68 |   {} | 
|---|
| 69 |  | 
|---|
| 70 |   // checks if a resource was already loaded. | 
|---|
| 71 |   bool Resource::isLoaded(std::string& fileName, | 
|---|
| 72 |                           const MultiType& param0, const MultiType& param1, const MultiType& param2) | 
|---|
| 73 |   {} | 
|---|
| 74 |  | 
|---|
| 75 |   // raises the priority can only be raised | 
|---|
| 76 |   void Resource::raisePriority(ResourcePriority prio) | 
|---|
| 77 |   {} | 
|---|
| 78 |  | 
|---|
| 79 |  | 
|---|
| 80 |   bool Resource::reloadResourcesByType(ClassID ResourceType) | 
|---|
| 81 |   {} | 
|---|
| 82 |  | 
|---|
| 83 |   bool Resource::reloadAllResources() | 
|---|
| 84 |   {} | 
|---|
| 85 |  | 
|---|
| 86 |   bool Resource::unloadResourcesByType(ResourcePriority prio) | 
|---|
| 87 |   {} | 
|---|
| 88 |  | 
|---|
| 89 |  | 
|---|
| 90 |   bool Resource::unloadAllResources() | 
|---|
| 91 |   {} | 
|---|
| 92 |  | 
|---|
| 93 |   void Resource::debug() | 
|---|
| 94 |   {} | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 |  | 
|---|
| 98 |  | 
|---|
| 99 |   const Resource::SharedResource* Resource::findResource(std::string& fileName, | 
|---|
| 100 |       const MultiType& param0, const MultiType& param1, const MultiType& param2) | 
|---|
| 101 |   {} | 
|---|
| 102 |  | 
|---|
| 103 | } | 
|---|