Changeset 7193 in orxonox.OLD for trunk/src/lib/util
- Timestamp:
- Mar 7, 2006, 5:05:50 PM (19 years ago)
- Location:
- trunk/src/lib/util/loading
- Files:
-
- 6 edited
- 2 copied
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/loading/dynamic_loader.h
r7167 r7193 7 7 #define _DYNAMIC_LOADER_H 8 8 9 #include " factory.h"9 #include "util/loading/factory.h" 10 10 11 11 #include <string> -
trunk/src/lib/util/loading/factory.cc
r6341 r7193 15 15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING 16 16 17 #include " factory.h"17 #include "util/loading/factory.h" 18 18 19 19 //#include "shell_command.h" -
trunk/src/lib/util/loading/game_loader.cc
r6862 r7193 19 19 20 20 #include "game_loader.h" 21 #include " load_param.h"21 #include "util/loading/load_param.h" 22 22 23 23 #include "shell_command.h" 24 24 #include "campaign.h" 25 25 26 #include " resource_manager.h"26 #include "util/loading/resource_manager.h" 27 27 28 28 #include "event_handler.h" -
trunk/src/lib/util/loading/load_param.cc
r7130 r7193 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING 17 17 18 #include " load_param.h"18 #include "util/loading/load_param.h" 19 19 #include "load_param_description.h" 20 20 -
trunk/src/lib/util/loading/resource.cc
r7192 r7193 16 16 //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ 17 17 18 #include " proto_class.h"18 #include "resource.h" 19 19 20 20 using namespace std; … … 25 25 * @todo this constructor is not jet implemented - do it 26 26 */ 27 ProtoClass::ProtoClass()27 Resource::Resource () 28 28 { 29 this->setClassID(CL_ PROTO_ID, "ProtoClass");29 this->setClassID(CL_RESOURCE, "Resource"); 30 30 31 31 /* If you make a new class, what is most probably the case when you write this file … … 45 45 * standard deconstructor 46 46 */ 47 ProtoClass::~ProtoClass()47 Resource::~Resource () 48 48 { 49 49 // delete what has to be deleted here -
trunk/src/lib/util/loading/resource.h
r7192 r7193 1 1 /*! 2 * @file proto_class.h2 * @file resource.h 3 3 * @brief Definition of ... 4 4 */ 5 5 6 #ifndef _ PROTO_CLASS_H7 #define _ PROTO_CLASS_H6 #ifndef _RESOURCE_H 7 #define _RESOURCE_H 8 8 9 9 #include "base_object.h" 10 #include "multi_type.h" 11 10 12 11 13 // FORWARD DECLARATION … … 14 16 15 17 //! A class for ... 16 class ProtoClass :public BaseObject {18 class Resource : virtual public BaseObject { 17 19 18 20 public: 19 ProtoClass();20 virtual ~ ProtoClass();21 Resource(); 22 virtual ~Resource(); 21 23 24 virtual bool load(const char* fileName, const MultiType& param1, const MultiType& param2); 25 virtual bool reload(); 26 virtual bool unload(); 22 27 23 28 private: … … 25 30 }; 26 31 27 #endif /* _ PROTO_CLASS_H */32 #endif /* _RESOURCE_H */ -
trunk/src/lib/util/loading/resource_manager.cc
r7059 r7193 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD 17 17 18 #include " resource_manager.h"18 #include "util/loading/resource_manager.h" 19 19 20 20 #include "substring.h" … … 592 592 if (resource->count == 0) 593 593 { 594 // deleting the Resource 595 switch(resource->type) 596 { 597 #ifndef NO_MODEL 598 case OBJ: 599 case PRIM: 600 delete (Model*)resource->pointer; 601 break; 602 case MD2: 603 delete (MD2Data*)resource->pointer; 604 break; 605 #endif /* NO_MODEL */ 606 #ifndef NO_AUDIO 607 case WAV: 608 delete (SoundBuffer*)resource->pointer; 609 break; 610 case OGG: 611 delete (OggPlayer*)resource->pointer; 612 break; 613 #endif /* NO_AUDIO */ 614 #ifndef NO_TEXT 615 case TTF: 616 delete (Font*)resource->pointer; 617 break; 618 #endif /* NO_TEXT */ 619 #ifndef NO_TEXTURES 620 case IMAGE: 621 delete (Texture*)resource->pointer; 622 break; 623 #endif /* NO_TEXTURES */ 624 #ifndef NO_SHADERS 625 case SHADER: 626 delete (Shader*)resource->pointer; 627 break; 628 #endif /* NO_SHADERS */ 629 default: 630 PRINTF(2)("NOT YET IMPLEMENTED !!FIX FIX!!\n"); 631 return false; 632 break; 633 } 594 delete resource->pointer; 634 595 // deleting the List Entry: 635 596 PRINTF(4)("Resource %s safely removed.\n", resource->name); -
trunk/src/lib/util/loading/resource_manager.h
r6651 r7193 65 65 }; 66 66 67 //! A Struct that keeps track about Aresource its name its Type, and so on67 //! A Struct that keeps track about a resource its name its Type, and so on 68 68 struct Resource 69 69 {
Note: See TracChangeset
for help on using the changeset viewer.