/* orxonox - the future of 3D-vertical scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: David Gruetter co-programmer: ... Created by Dave, in this file shadow will be implemented in a quite sexy and fast way, with a lot of opengl-code, to keep it fast! The origin of the code comes form an example at www.frustum.org, slitly different although, so that it works with Orxonox:) */ #include "importer/material.h" #include "stdincl.h" #include #include #include #include #include "shadow.h" #define SIZE 128 #define GL_CLAMP_TO_EDGE_EXT 0x812F using namespace std; /** \brief default Constructor */ Shadow::Shadow() { } /** \brief default destructor */ Shadow::~Shadow() { } /** \don't ask me how this works, but it adds a blur effect to the shadow \for it doesn't look that edgy */ void Shadow::blur(unsigned char *in,int size) { int x,y,sum,size3=size*3; unsigned char *out,*inp,*outp; out = (unsigned char *)malloc(size * size * 3); memset(out,255,size *size *3); inp=in+size3; outp=out+size3; for(y=1;y