Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9823 in orxonox.OLD for branches/new_class_id/src/world_entities


Ignore:
Timestamp:
Sep 25, 2006, 11:28:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: now it should also be possible, to cache the resources, by suppling a LoadString.
This is vital to loading Resources, when you only know the TypeName and a LoadString, but not the c++-type and the LoadParameters as is the case when loading over the internet.

Location:
branches/new_class_id/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/world_entities/environments/water.cc

    r9716 r9823  
    2323#include "material.h"
    2424
    25 #include "util/loading/resource_manager.h"
    26 #include "shader.h"
     25#include "resource_shader.h"
    2726
    2827#include "skybox.h"
     
    5655
    5756  this->rebuildGrid();
    58   this->waterShader = (Shader*)ResourceManager::getInstance()->load("shaders/water.vert", SHADER, RP_GAME, "shaders/water.frag");
     57  this->waterShader = ResourceShader("shaders/water.vert", "shaders/water.frag");
    5958
    6059  // To test the Wave equation
  • branches/new_class_id/src/world_entities/environments/water.h

    r9715 r9823  
    1313#include "world_entity.h"
    1414#include "material.h"
    15 
     15#include "shader.h"
    1616
    1717/* FORWARD DECLARATION */
    1818class Grid;
    19 class Shader;
    2019
    2120//! A Class to handle a WaterEffects
     
    5251
    5352    Material        waterMaterial;
    54     Shader*         waterShader;
     53    Shader          waterShader;
    5554
    5655    float           height;          //!< The hight of the Water
  • branches/new_class_id/src/world_entities/skybox.cc

    r9727 r9823  
    2727#include "network_game_manager.h"
    2828#include "converter.h"
    29 #include "util/loading/resource_manager.h"
     29#include "resource_texture.h"
    3030
    3131#include "debug.h"
     
    113113    if (this->material[i])
    114114      delete this->material[i];
    115     if (this->cubeTexture[i])
    116       ResourceManager::getInstance()->unload(this->cubeTexture[i]);
    117115  }
    118116}
     
    175173                                  const std::string& posZ, const std::string& posX, const std::string& negX)
    176174{
    177   this->cubeTexture[0] = (Texture*)ResourceManager::getInstance()->load(negX, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
    178   this->cubeTexture[1] = (Texture*)ResourceManager::getInstance()->load(posX, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
    179 
    180   this->cubeTexture[2] = (Texture*)ResourceManager::getInstance()->load(negY, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
    181   this->cubeTexture[3] = (Texture*)ResourceManager::getInstance()->load(posY, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
    182 
    183   this->cubeTexture[4] = (Texture*)ResourceManager::getInstance()->load(negZ, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
    184   this->cubeTexture[5] = (Texture*)ResourceManager::getInstance()->load(posZ, RP_LEVEL, IMAGE, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
     175  this->cubeTexture[0] = ResourceTexture(negX, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT);
     176  this->cubeTexture[1] = ResourceTexture(posX, GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT);
     177
     178  this->cubeTexture[2] = ResourceTexture(negY, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT);
     179  this->cubeTexture[3] = ResourceTexture(posY, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT);
     180
     181  this->cubeTexture[4] = ResourceTexture(negZ, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT);
     182  this->cubeTexture[5] = ResourceTexture(posZ, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT);
    185183}
    186184
  • branches/new_class_id/src/world_entities/skybox.h

    r9715 r9823  
    6565
    6666  Material*       material[6];     //!< Materials for the SkyBox. sorted by number (0-5) top, bottom, left, right, front, back
    67   Texture*        cubeTexture[6];  //!< Textures for the CubeMap.
     67  Texture         cubeTexture[6];  //!< Textures for the CubeMap.
    6868
    6969  float           size;            //!< Size of the SkyBox. This should match the frustum maximum range.
Note: See TracChangeset for help on using the changeset viewer.