Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2939


Ignore:
Timestamp:
Apr 29, 2009, 4:38:35 PM (15 years ago)
Author:
stefalie
Message:

ugly hacks to get shaders up runnin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/toonshader/src/orxonox/objects/worldentities/Model.cc

    r2896 r2939  
    3030
    3131#include <OgreEntity.h>
     32#include <OgreMaterialManager.h>
    3233#include "Model.h"
    3334#include "core/GameMode.h"
     
    6162        XMLPortParam(Model, "mesh", setMeshSource, getMeshSource, xmlelement, mode);
    6263        XMLPortParam(Model, "shadow", setCastShadows, getCastShadows, xmlelement, mode).defaultValues(true);
     64
     65        //HACK
     66        if (true)//this->meshSrc_ == "assasdfff.mesh")
     67        {
     68            this->mesh_.getEntity()->setMaterialName("ToonShader");
     69            static bool load = true;
     70           
     71            if (load)
     72            {
     73                Ogre::MaterialPtr matPtr = Ogre::MaterialManager::getSingleton().getByName("ToonShader");
     74                if (!matPtr.isNull()) {
     75                // is this necessary to do here? Someday try it without
     76                    matPtr->compile();
     77                    matPtr->load();
     78                }
     79                else
     80                    COUT(0) << "frakking shader\n";
     81               
     82                COUT(0) << "shiiit\n";
     83
     84                //Ogre::MaterialManager& mm = Ogre::MaterialManager::getSingleton();
     85               //Ogre::Material* m = Ogre::Material*(Ogre::MaterialManager::getSingleton().getByName("ToonShader"));
     86                load = false;
     87            }
     88        }
    6389    }
    6490
     
    85111            }
    86112        }
     113        if (true)//this->meshSrc_ == "assasdfff.mesh")
     114        {
     115            this->mesh_.getEntity()->setMaterialName("ToonShader");
     116        }
    87117    }
    88118
Note: See TracChangeset for help on using the changeset viewer.