Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7193 in orxonox.OLD for trunk/src/lib/util


Ignore:
Timestamp:
Mar 7, 2006, 5:05:50 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: new style for resources (prework/movement)

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  
    77#define _DYNAMIC_LOADER_H
    88
    9 #include "factory.h"
     9#include "util/loading/factory.h"
    1010
    1111#include <string>
  • trunk/src/lib/util/loading/factory.cc

    r6341 r7193  
    1515#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING
    1616
    17 #include "factory.h"
     17#include "util/loading/factory.h"
    1818
    1919//#include "shell_command.h"
  • trunk/src/lib/util/loading/game_loader.cc

    r6862 r7193  
    1919
    2020#include "game_loader.h"
    21 #include "load_param.h"
     21#include "util/loading/load_param.h"
    2222
    2323#include "shell_command.h"
    2424#include "campaign.h"
    2525
    26 #include "resource_manager.h"
     26#include "util/loading/resource_manager.h"
    2727
    2828#include "event_handler.h"
  • trunk/src/lib/util/loading/load_param.cc

    r7130 r7193  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOADING
    1717
    18 #include "load_param.h"
     18#include "util/loading/load_param.h"
    1919#include "load_param_description.h"
    2020
  • trunk/src/lib/util/loading/resource.cc

    r7192 r7193  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "proto_class.h"
     18#include "resource.h"
    1919
    2020using namespace std;
     
    2525 * @todo this constructor is not jet implemented - do it
    2626*/
    27 ProtoClass::ProtoClass ()
     27Resource::Resource ()
    2828{
    29    this->setClassID(CL_PROTO_ID, "ProtoClass");
     29   this->setClassID(CL_RESOURCE, "Resource");
    3030
    3131   /* If you make a new class, what is most probably the case when you write this file
     
    4545 * standard deconstructor
    4646*/
    47 ProtoClass::~ProtoClass ()
     47Resource::~Resource ()
    4848{
    4949  // delete what has to be deleted here
  • trunk/src/lib/util/loading/resource.h

    r7192 r7193  
    11/*!
    2  * @file proto_class.h
     2 * @file resource.h
    33 * @brief Definition of ...
    44*/
    55
    6 #ifndef _PROTO_CLASS_H
    7 #define _PROTO_CLASS_H
     6#ifndef _RESOURCE_H
     7#define _RESOURCE_H
    88
    99#include "base_object.h"
     10#include "multi_type.h"
     11
    1012
    1113// FORWARD DECLARATION
     
    1416
    1517//! A class for ...
    16 class ProtoClass : public BaseObject {
     18class Resource : virtual public BaseObject {
    1719
    1820 public:
    19   ProtoClass();
    20   virtual ~ProtoClass();
     21  Resource();
     22  virtual ~Resource();
    2123
     24  virtual bool load(const char* fileName, const MultiType& param1, const MultiType& param2);
     25  virtual bool reload();
     26  virtual bool unload();
    2227
    2328 private:
     
    2530};
    2631
    27 #endif /* _PROTO_CLASS_H */
     32#endif /* _RESOURCE_H */
  • trunk/src/lib/util/loading/resource_manager.cc

    r7059 r7193  
    1616#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
    1717
    18 #include "resource_manager.h"
     18#include "util/loading/resource_manager.h"
    1919
    2020#include "substring.h"
     
    592592    if (resource->count == 0)
    593593    {
    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;
    634595      // deleting the List Entry:
    635596      PRINTF(4)("Resource %s safely removed.\n", resource->name);
  • trunk/src/lib/util/loading/resource_manager.h

    r6651 r7193  
    6565};
    6666
    67 //! A Struct that keeps track about A resource its name its Type, and so on
     67//! A Struct that keeps track about a resource its name its Type, and so on
    6868struct Resource
    6969{
Note: See TracChangeset for help on using the changeset viewer.