#include "CCGShader.h" #include "../conffile.h" CCGShader::CCGShader(void) { } CCGShader::~CCGShader(void) { } cgScaleType CCGShader::scaleStringToEnum(const char *scale) { if(!strcasecmp(scale,"source")) { return CG_SCALE_SOURCE; } else if(!strcasecmp(scale,"viewport")) { return CG_SCALE_VIEWPORT; } else if(!strcasecmp(scale,"absolute")) { return CG_SCALE_ABSOLUTE; } else { return CG_SCALE_NONE; } } bool CCGShader::LoadShader(const char *path) { ConfigFile conf; int shaderCount; char keyName[100]; shaderPasses.clear(); lookupTextures.clear(); if(strlen(path)<4 || strcasecmp(&path[strlen(path)-4],".cgp")) { shaderPass pass; pass.scaleParams.scaleTypeX = CG_SCALE_NONE; pass.scaleParams.scaleTypeY = CG_SCALE_NONE; pass.linearFilter = false; pass.filterSet = false; strcpy(pass.cgShaderFile,path); shaderPasses.push_back(pass); return true; } else { conf.LoadFile(path); } shaderCount = conf.GetInt("::shaders",0); if(shaderCount<1) return false; for(int i=0;i