From ab41583bc2be591c0af921b243158e43a94505d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 29 Mar 2013 06:21:28 +0000 Subject: style cleanup --- source/gameengine/Expressions/Value.h | 2 +- source/gameengine/Expressions/VoidValue.h | 2 +- source/gameengine/Ketsji/KX_MeshProxy.h | 6 +-- source/gameengine/Ketsji/KX_PythonSeq.cpp | 2 +- source/gameengine/Rasterizer/RAS_BucketManager.cpp | 2 +- source/gameengine/Rasterizer/RAS_BucketManager.h | 8 ++-- source/gameengine/VideoTexture/Exception.h | 2 +- source/gameengine/VideoTexture/FilterBase.cpp | 2 +- source/gameengine/VideoTexture/FilterBase.h | 16 +++---- source/gameengine/VideoTexture/FilterBlueScreen.h | 8 ++-- source/gameengine/VideoTexture/FilterNormal.h | 4 +- source/gameengine/VideoTexture/FilterSource.h | 55 +++++++++++----------- source/gameengine/VideoTexture/ImageBase.cpp | 20 ++++---- source/gameengine/VideoTexture/ImageBase.h | 22 ++++----- source/gameengine/VideoTexture/ImageBuff.cpp | 28 +++++------ source/gameengine/VideoTexture/ImageMix.cpp | 52 ++++++++++---------- source/gameengine/VideoTexture/ImageMix.h | 8 ++-- source/gameengine/VideoTexture/ImageRender.cpp | 4 +- source/gameengine/VideoTexture/ImageRender.h | 4 +- source/gameengine/VideoTexture/PyTypeList.cpp | 2 +- source/gameengine/VideoTexture/VideoBase.cpp | 4 +- source/gameengine/VideoTexture/VideoBase.h | 6 +-- source/gameengine/VideoTexture/VideoFFmpeg.h | 4 +- 23 files changed, 129 insertions(+), 134 deletions(-) diff --git a/source/gameengine/Expressions/Value.h b/source/gameengine/Expressions/Value.h index 580691d88c4..e9bb6b1ba3c 100644 --- a/source/gameengine/Expressions/Value.h +++ b/source/gameengine/Expressions/Value.h @@ -222,7 +222,7 @@ public: virtual CValue *ConvertPythonToValue(PyObject *pyobj, const char *error_prefix); - static PyObject *pyattr_get_name(void * self, const KX_PYATTRIBUTE_DEF * attrdef); + static PyObject *pyattr_get_name(void *self, const KX_PYATTRIBUTE_DEF *attrdef); virtual PyObject *ConvertKeysToPython( void ); #endif /* WITH_PYTHON */ diff --git a/source/gameengine/Expressions/VoidValue.h b/source/gameengine/Expressions/VoidValue.h index e97278b3142..832f75c9c9f 100644 --- a/source/gameengine/Expressions/VoidValue.h +++ b/source/gameengine/Expressions/VoidValue.h @@ -46,7 +46,7 @@ class CVoidValue : public CPropValue public: /// Construction/destruction CVoidValue() : m_bDeleteOnDestruct(false), m_pAnything(NULL) { } - CVoidValue(void * voidptr, bool bDeleteOnDestruct, AllocationTYPE alloctype) : + CVoidValue(void *voidptr, bool bDeleteOnDestruct, AllocationTYPE alloctype) : m_bDeleteOnDestruct(bDeleteOnDestruct), m_pAnything(voidptr) { diff --git a/source/gameengine/Ketsji/KX_MeshProxy.h b/source/gameengine/Ketsji/KX_MeshProxy.h index 5366634ef98..4a4358bff3a 100644 --- a/source/gameengine/Ketsji/KX_MeshProxy.h +++ b/source/gameengine/Ketsji/KX_MeshProxy.h @@ -74,9 +74,9 @@ public: KX_PYMETHOD(KX_MeshProxy,Transform); KX_PYMETHOD(KX_MeshProxy,TransformUV); - static PyObject *pyattr_get_materials(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef); - static PyObject *pyattr_get_numMaterials(void * self, const KX_PYATTRIBUTE_DEF * attrdef); - static PyObject *pyattr_get_numPolygons(void * self, const KX_PYATTRIBUTE_DEF * attrdef); + static PyObject *pyattr_get_materials(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef); + static PyObject *pyattr_get_numMaterials(void *self, const KX_PYATTRIBUTE_DEF * attrdef); + static PyObject *pyattr_get_numPolygons(void *self, const KX_PYATTRIBUTE_DEF * attrdef); }; #endif /* WITH_PYTHON */ diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp index 4c491654d1f..edbb0537559 100644 --- a/source/gameengine/Ketsji/KX_PythonSeq.cpp +++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp @@ -189,7 +189,7 @@ static PyObject *KX_PythonSeq_getIndex(PyObject *self, Py_ssize_t index) return NULL; } -static PyObjectPlus * KX_PythonSeq_subscript__internal(PyObject *self, const char *key) +static PyObjectPlus *KX_PythonSeq_subscript__internal(PyObject *self, const char *key) { PyObjectPlus *self_plus= BGE_PROXY_REF(((KX_PythonSeq *)self)->base); diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index b2b766b65e8..af8c855f3b0 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -254,7 +254,7 @@ void RAS_BucketManager::Renderbuckets( rendertools->SetClientObject(rasty, NULL); } -RAS_MaterialBucket* RAS_BucketManager::FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated) +RAS_MaterialBucket *RAS_BucketManager::FindBucket(RAS_IPolyMaterial *material, bool &bucketCreated) { BucketList::iterator it; diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.h b/source/gameengine/Rasterizer/RAS_BucketManager.h index 78125a7bbb3..bf88da6f1ba 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.h +++ b/source/gameengine/Rasterizer/RAS_BucketManager.h @@ -54,13 +54,13 @@ public: void Renderbuckets(const MT_Transform & cameratrans, RAS_IRasterizer* rasty, RAS_IRenderTools* rendertools); - RAS_MaterialBucket* FindBucket(RAS_IPolyMaterial * material, bool &bucketCreated); + RAS_MaterialBucket* FindBucket(RAS_IPolyMaterial *material, bool &bucketCreated); void OptimizeBuckets(MT_Scalar distance); - void ReleaseDisplayLists(RAS_IPolyMaterial * material = NULL); - void ReleaseMaterials(RAS_IPolyMaterial * material = NULL); + void ReleaseDisplayLists(RAS_IPolyMaterial *material = NULL); + void ReleaseMaterials(RAS_IPolyMaterial *material = NULL); - void RemoveMaterial(RAS_IPolyMaterial * mat); // freeing scenes only + void RemoveMaterial(RAS_IPolyMaterial *mat); // freeing scenes only /* for merging */ void MergeBucketManager(RAS_BucketManager *other, SCA_IScene *scene); diff --git a/source/gameengine/VideoTexture/Exception.h b/source/gameengine/VideoTexture/Exception.h index e0c1fdd568d..4410ec1aa8b 100644 --- a/source/gameengine/VideoTexture/Exception.h +++ b/source/gameengine/VideoTexture/Exception.h @@ -105,7 +105,7 @@ public: // returns 0, if exception identification don't match at all // returns 1, if only exception identification is matching // returns 2, if both exception identification and result are matching - int isExp (ExceptionID * exp, RESULT hres = S_OK) throw() + int isExp (ExceptionID *exp, RESULT hres = S_OK) throw() { // check exception identification if (&m_expID == exp) diff --git a/source/gameengine/VideoTexture/FilterBase.cpp b/source/gameengine/VideoTexture/FilterBase.cpp index 77d12ddc9e6..97abe36bb81 100644 --- a/source/gameengine/VideoTexture/FilterBase.cpp +++ b/source/gameengine/VideoTexture/FilterBase.cpp @@ -58,7 +58,7 @@ void FilterBase::release (void) // set new previous filter -void FilterBase::setPrevious (PyFilter * filt, bool useRefCnt) +void FilterBase::setPrevious(PyFilter *filt, bool useRefCnt) { // if reference counting has to be used if (useRefCnt) diff --git a/source/gameengine/VideoTexture/FilterBase.h b/source/gameengine/VideoTexture/FilterBase.h index f8fe2c772f0..a1d199b1851 100644 --- a/source/gameengine/VideoTexture/FilterBase.h +++ b/source/gameengine/VideoTexture/FilterBase.h @@ -79,7 +79,7 @@ public: /// get previous filter PyFilter * getPrevious (void) { return m_previous; } /// set previous filter - void setPrevious (PyFilter * filt, bool useRefCnt = true); + void setPrevious (PyFilter *filt, bool useRefCnt = true); /// find first filter in chain FilterBase * findFirst (void); @@ -92,20 +92,20 @@ protected: PyFilter * m_previous; /// filter pixel, source byte buffer - virtual unsigned int filter (unsigned char * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + virtual unsigned int filter(unsigned char *src, short x, short y, + short *size, unsigned int pixSize, unsigned int val = 0) { return val; } /// filter pixel, source int buffer - virtual unsigned int filter (unsigned int * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + virtual unsigned int filter(unsigned int *src, short x, short y, + short *size, unsigned int pixSize, unsigned int val = 0) { return val; } /// filter pixel, source float buffer - virtual unsigned int filter (float * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + virtual unsigned int filter(float *src, short x, short y, + short *size, unsigned int pixSize, unsigned int val = 0) { return val; } /// get source pixel size - virtual unsigned int getPixelSize (void) { return 1; } + virtual unsigned int getPixelSize(void) { return 1; } /// get converted pixel from previous filters template unsigned int convertPrevious (SRC src, short x, short y, diff --git a/source/gameengine/VideoTexture/FilterBlueScreen.h b/source/gameengine/VideoTexture/FilterBlueScreen.h index 5a90590a39d..cf74a6705b7 100644 --- a/source/gameengine/VideoTexture/FilterBlueScreen.h +++ b/source/gameengine/VideoTexture/FilterBlueScreen.h @@ -92,12 +92,12 @@ protected: } /// virtual filtering function for byte source - virtual unsigned int filter (unsigned char * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + virtual unsigned int filter (unsigned char *src, short x, short y, + short * size, unsigned int pixSize, unsigned int val = 0) { return tFilter(src, x, y, size, pixSize, val); } /// virtual filtering function for unsigned int source - virtual unsigned int filter (unsigned int * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + virtual unsigned int filter (unsigned int *src, short x, short y, + short * size, unsigned int pixSize, unsigned int val = 0) { return tFilter(src, x, y, size, pixSize, val); } }; diff --git a/source/gameengine/VideoTexture/FilterNormal.h b/source/gameengine/VideoTexture/FilterNormal.h index b21afb3ec26..951ecb84d9d 100644 --- a/source/gameengine/VideoTexture/FilterNormal.h +++ b/source/gameengine/VideoTexture/FilterNormal.h @@ -70,8 +70,8 @@ protected: unsigned short m_colIdx; /// filter pixel, source int buffer - template unsigned int tFilter (SRC * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val = 0) + template unsigned int tFilter (SRC *src, short x, short y, + short * size, unsigned int pixSize, unsigned int val = 0) { // get value of required color int actPix = int(VT_C(val,m_colIdx)); diff --git a/source/gameengine/VideoTexture/FilterSource.h b/source/gameengine/VideoTexture/FilterSource.h index f1d2615ee32..0289c88f056 100644 --- a/source/gameengine/VideoTexture/FilterSource.h +++ b/source/gameengine/VideoTexture/FilterSource.h @@ -49,7 +49,7 @@ public: protected: /// filter pixel, source byte buffer - virtual unsigned int filter (unsigned char * src, short x, short y, + virtual unsigned int filter (unsigned char *src, short x, short y, short * size, unsigned int pixSize, unsigned int val) { VT_RGBA(val,src[0],src[1],src[2],0xFF); return val; } }; @@ -68,7 +68,7 @@ public: protected: /// filter pixel, source byte buffer - virtual unsigned int filter (unsigned char * src, short x, short y, + virtual unsigned int filter (unsigned char *src, short x, short y, short * size, unsigned int pixSize, unsigned int val) { if ((intptr_t(src)&0x3) == 0) @@ -95,8 +95,8 @@ public: protected: /// filter pixel, source byte buffer - virtual unsigned int filter (unsigned char * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val) + virtual unsigned int filter (unsigned char *src, short x, short y, + short * size, unsigned int pixSize, unsigned int val) { VT_RGBA(val,src[2],src[1],src[0],0xFF); return val; } }; @@ -114,11 +114,11 @@ public: protected: /// filter pixel, source float buffer - virtual unsigned int filter (float * src, short x, short y, + virtual unsigned int filter (float *src, short x, short y, short * size, unsigned int pixSize, unsigned int val) { // calculate gray value - // convert float to unsigned char + // convert float to unsigned char unsigned int depth = int(src[0] * 255); // return depth scale value VT_R(val) = depth; @@ -145,8 +145,8 @@ public: protected: /// filter pixel, source float buffer - virtual unsigned int filter (float * src, short x, short y, - short * size, unsigned int pixSize, unsigned int val) + virtual unsigned int filter (float *src, short x, short y, + short *size, unsigned int pixSize, unsigned int val) { /* Copy the float value straight away * The user can retrieve the original float value by using @@ -193,59 +193,59 @@ protected: { return (9 * (b + c) - a - d + 8) >> 4; } /// common horizontal interpolation - int interpolH (unsigned char * src) + int interpolH (unsigned char *src) { return interpol(*(src-1), *src, *(src+1), *(src+2)); } /// common vertical interpolation - int interpolV (unsigned char * src) + int interpolV (unsigned char *src) { return interpol(*(src-m_pitchUV), *src, *(src+m_pitchUV), *(src+2*m_pitchUV)); } /// common joined vertical and horizontal interpolation - int interpolVH (unsigned char * src) + int interpolVH (unsigned char *src) { return interpol(interpolV(src-1), interpolV(src), interpolV(src+1), - interpolV(src+2)); + interpolV(src+2)); } /// is pixel on edge - bool isEdge (short x, short y, short * size) + bool isEdge (short x, short y, const short size[2]) { return x <= 1 || x >= size[0] - 4 || y <= 1 || y >= size[1] - 4; } /// get the first parameter on the low edge - unsigned char * interParA (unsigned char * src, short x, short size, short shift) + unsigned char * interParA (unsigned char *src, short x, short size, short shift) { return x > 1 ? src - shift : src; } /// get the third parameter on the high edge - unsigned char * interParC (unsigned char * src, short x, short size, short shift) + unsigned char * interParC (unsigned char *src, short x, short size, short shift) { return x < size - 2 ? src + shift : src; } /// get the fourth parameter on the high edge - unsigned char * interParD (unsigned char * src, short x, short size, short shift) + unsigned char * interParD (unsigned char *src, short x, short size, short shift) { return x < size - 4 ? src + 2 * shift : x < size - 2 ? src + shift : src; } /// horizontal interpolation on edges - int interpolEH (unsigned char * src, short x, short size) - { + int interpolEH (unsigned char *src, short x, short size) + { return interpol(*interParA(src, x, size, 1), *src, - *interParC(src, x, size, 1), *interParD(src, x, size, 1)); + *interParC(src, x, size, 1), *interParD(src, x, size, 1)); } /// vertical interpolation on edges - int interpolEV (unsigned char * src, short y, short size) - { + int interpolEV (unsigned char *src, short y, short size) + { return interpol(*interParA(src, y, size, m_pitchUV), *src, - *interParC(src, y, size, m_pitchUV), *interParD(src, y, size, m_pitchUV)); + *interParC(src, y, size, m_pitchUV), *interParD(src, y, size, m_pitchUV)); } /// joined vertical and horizontal interpolation on edges - int interpolEVH (unsigned char * src, short x, short y, short * size) + int interpolEVH (unsigned char *src, short x, short y, short * size) { return interpol(interpolEV(interParA(src, x, size[0], 1), y, size[1]), - interpolEV(src, y, size[1]), interpolEV(interParC(src, x, size[0], 1), y, size[1]), - interpolEV(interParD(src, x, size[0], 1), y, size[1])); + interpolEV(src, y, size[1]), interpolEV(interParC(src, x, size[0], 1), y, size[1]), + interpolEV(interParD(src, x, size[0], 1), y, size[1])); } /// filter pixel, source byte buffer - virtual unsigned int filter (unsigned char * src, short x, short y, + virtual unsigned int filter (unsigned char *src, short x, short y, short * size, unsigned int pixSize, unsigned int val) { // V & U offset @@ -325,5 +325,4 @@ protected: } }; - -#endif +#endif /* __FILTERSOURCE_H__ */ diff --git a/source/gameengine/VideoTexture/ImageBase.cpp b/source/gameengine/VideoTexture/ImageBase.cpp index 5a11cd24bcf..4109981a98c 100644 --- a/source/gameengine/VideoTexture/ImageBase.cpp +++ b/source/gameengine/VideoTexture/ImageBase.cpp @@ -124,7 +124,7 @@ void ImageBase::refresh (void) // get source object -PyImage * ImageBase::getSource (const char * id) +PyImage * ImageBase::getSource (const char *id) { // find source ImageSourceList::iterator src = findSource(id); @@ -134,7 +134,7 @@ PyImage * ImageBase::getSource (const char * id) // set source object -bool ImageBase::setSource (const char * id, PyImage *source) +bool ImageBase::setSource (const char *id, PyImage *source) { // find source ImageSourceList::iterator src = findSource(id); @@ -223,7 +223,7 @@ void ImageBase::init (short width, short height) // find source -ImageSourceList::iterator ImageBase::findSource (const char * id) +ImageSourceList::iterator ImageBase::findSource (const char *id) { // iterate sources ImageSourceList::iterator it; @@ -294,7 +294,7 @@ bool ImageBase::loopDetect (ImageBase * img) // ImageSource class implementation // constructor -ImageSource::ImageSource (const char * id) : m_source(NULL), m_image(NULL) +ImageSource::ImageSource (const char *id) : m_source(NULL), m_image(NULL) { // copy id int idx; @@ -312,9 +312,9 @@ ImageSource::~ImageSource (void) // compare id -bool ImageSource::is (const char * id) +bool ImageSource::is (const char *id) { - for (char * myId = m_id; *myId != '\0'; ++myId, ++id) + for (char *myId = m_id; *myId != '\0'; ++myId, ++id) if (*myId != *id) return false; return *id == '\0'; } @@ -551,7 +551,7 @@ int Image_setFlip(PyImage *self, PyObject *value, void *closure) } // get zbuff -PyObject *Image_getZbuff(PyImage * self, void *closure) +PyObject *Image_getZbuff(PyImage *self, void *closure) { if (self->m_image != NULL && self->m_image->getZbuff()) Py_RETURN_TRUE; else Py_RETURN_FALSE; @@ -573,7 +573,7 @@ int Image_setZbuff(PyImage *self, PyObject *value, void *closure) } // get depth -PyObject *Image_getDepth(PyImage * self, void *closure) +PyObject *Image_getDepth(PyImage *self, void *closure) { if (self->m_image != NULL && self->m_image->getDepth()) Py_RETURN_TRUE; else Py_RETURN_FALSE; @@ -601,7 +601,7 @@ int Image_setDepth(PyImage *self, PyObject *value, void *closure) PyObject *Image_getSource(PyImage *self, PyObject *args) { // get arguments - char * id; + char *id; if (!PyArg_ParseTuple(args, "s:getSource", &id)) return NULL; if (self->m_image != NULL) @@ -625,7 +625,7 @@ PyObject *Image_getSource(PyImage *self, PyObject *args) PyObject *Image_setSource(PyImage *self, PyObject *args) { // get arguments - char * id; + char *id; PyObject *obj; if (!PyArg_ParseTuple(args, "sO:setSource", &id, &obj)) return NULL; diff --git a/source/gameengine/VideoTexture/ImageBase.h b/source/gameengine/VideoTexture/ImageBase.h index 718191fd049..50dc8c10ec6 100644 --- a/source/gameengine/VideoTexture/ImageBase.h +++ b/source/gameengine/VideoTexture/ImageBase.h @@ -92,9 +92,9 @@ public: void setDepth(bool depth) { m_depth = depth; } /// get source object - PyImage * getSource(const char * id); + PyImage * getSource(const char *id); /// set source object, return true, if source was set - bool setSource(const char * id, PyImage *source); + bool setSource(const char *id, PyImage *source); /// get pixel filter PyFilter * getFilter(void) { return m_pyfilter; } @@ -236,7 +236,7 @@ protected: } // template for specific filter preprocessing - template void filterImage (F & filt, SRC srcBuff, short * srcSize) + template void filterImage (F & filt, SRC srcBuff, short *srcSize) { // find first filter in chain FilterBase * firstFilter = NULL; @@ -280,14 +280,14 @@ class ImageSource { public: /// constructor - ImageSource (const char * id); + ImageSource (const char *id); /// destructor virtual ~ImageSource (void); /// get id const char * getId (void) { return m_id; } /// compare id to argument - bool is (const char * id); + bool is (const char *id); /// get source object PyImage * getSource (void) { return m_source; } @@ -330,7 +330,7 @@ extern PyTypeList pyImageTypes; // object initialization template static int Image_init(PyObject *pySelf, PyObject *args, PyObject *kwds) { - PyImage *self = reinterpret_cast(pySelf); + PyImage *self = reinterpret_cast(pySelf); // create source object if (self->m_image != NULL) delete self->m_image; self->m_image = new T(); @@ -344,7 +344,7 @@ PyObject *Image_allocNew(PyTypeObject *type, PyObject *args, PyObject *kwds); void Image_dealloc(PyImage *self); // get image data -PyObject *Image_getImage(PyImage *self, char * mode); +PyObject *Image_getImage(PyImage *self, char *mode); // get image size PyObject *Image_getSize(PyImage *self, void *closure); // refresh image - invalidate current content @@ -364,13 +364,13 @@ PyObject *Image_getSource(PyImage *self, PyObject *args); // set filter source object PyObject *Image_setSource(PyImage *self, PyObject *args); // get Z buffer -PyObject *Image_getZbuff(PyImage * self, void *closure); +PyObject *Image_getZbuff(PyImage *self, void *closure); // set Z buffer -int Image_setZbuff(PyImage * self, PyObject *value, void *closure); +int Image_setZbuff(PyImage *self, PyObject *value, void *closure); // get depth -PyObject *Image_getDepth(PyImage * self, void *closure); +PyObject *Image_getDepth(PyImage *self, void *closure); // set depth -int Image_setDepth(PyImage * self, PyObject *value, void *closure); +int Image_setDepth(PyImage *self, PyObject *value, void *closure); // get pixel filter object PyObject *Image_getFilter(PyImage *self, void *closure); diff --git a/source/gameengine/VideoTexture/ImageBuff.cpp b/source/gameengine/VideoTexture/ImageBuff.cpp index 80ad9b40c24..8f547aa8b57 100644 --- a/source/gameengine/VideoTexture/ImageBuff.cpp +++ b/source/gameengine/VideoTexture/ImageBuff.cpp @@ -94,7 +94,7 @@ ImageBuff::~ImageBuff (void) // load image from buffer -void ImageBuff::load (unsigned char * img, short width, short height) +void ImageBuff::load(unsigned char *img, short width, short height) { // loading a new buffer implies to reset the imbuf if any, because the size may change if (m_imbuf) @@ -117,7 +117,7 @@ void ImageBuff::load (unsigned char * img, short width, short height) m_avail = true; } -void ImageBuff::clear (short width, short height, unsigned char color) +void ImageBuff::clear(short width, short height, unsigned char color) { unsigned char *p; int size; @@ -146,7 +146,7 @@ void ImageBuff::clear (short width, short height, unsigned char color) } // img must point to a array of RGBA data of size width*height -void ImageBuff::plot (unsigned char * img, short width, short height, short x, short y, short mode) +void ImageBuff::plot(unsigned char *img, short width, short height, short x, short y, short mode) { struct ImBuf *tmpbuf; @@ -170,7 +170,7 @@ void ImageBuff::plot (unsigned char * img, short width, short height, short x, s IMB_freeImBuf(tmpbuf); } -void ImageBuff::plot (ImageBuff* img, short x, short y, short mode) +void ImageBuff::plot(ImageBuff *img, short x, short y, short mode) { if (m_size[0] == 0 || m_size[1] == 0 || img->m_size[0] == 0 || img->m_size[1] == 0) return; @@ -194,13 +194,13 @@ void ImageBuff::plot (ImageBuff* img, short x, short y, short mode) // cast Image pointer to ImageBuff -inline ImageBuff * getImageBuff (PyImage *self) -{ return static_cast(self->m_image); } +inline ImageBuff *getImageBuff(PyImage *self) +{ return static_cast(self->m_image); } // python methods -static bool testPyBuffer(Py_buffer* buffer, int width, int height, unsigned int pixsize) +static bool testPyBuffer(Py_buffer *buffer, int width, int height, unsigned int pixsize) { if (buffer->itemsize != 1) { @@ -232,7 +232,7 @@ static bool testPyBuffer(Py_buffer* buffer, int width, int height, unsigned int return true; } -static bool testBGLBuffer(Buffer* buffer, int width, int height, unsigned int pixsize) +static bool testBGLBuffer(Buffer *buffer, int width, int height, unsigned int pixsize) { unsigned int size = BGL_typeSize(buffer->type); for (int i=0; indimensions; i++) @@ -313,7 +313,7 @@ static PyObject *load(PyImage *self, PyObject *args) Py_RETURN_NONE; } -static PyObject *plot (PyImage *self, PyObject *args) +static PyObject *plot(PyImage *self, PyObject *args) { PyImage * other; Buffer* bglBuffer; @@ -362,15 +362,14 @@ static PyObject *plot (PyImage *self, PyObject *args) } // methods structure -static PyMethodDef imageBuffMethods[] = -{ +static PyMethodDef imageBuffMethods[] = { {"load", (PyCFunction)load, METH_VARARGS, "Load image from buffer"}, {"plot", (PyCFunction)plot, METH_VARARGS, "update image buffer"}, {NULL} }; // attributes structure -static PyGetSetDef imageBuffGetSets[] = -{ // attributes from ImageBase class +static PyGetSetDef imageBuffGetSets[] = { + // attributes from ImageBase class {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, @@ -382,8 +381,7 @@ static PyGetSetDef imageBuffGetSets[] = // define python type -PyTypeObject ImageBuffType = -{ +PyTypeObject ImageBuffType = { PyVarObject_HEAD_INIT(NULL, 0) "VideoTexture.ImageBuff", /*tp_name*/ sizeof(PyImage), /*tp_basicsize*/ diff --git a/source/gameengine/VideoTexture/ImageMix.cpp b/source/gameengine/VideoTexture/ImageMix.cpp index ee6e16d0a86..dc93bf03423 100644 --- a/source/gameengine/VideoTexture/ImageMix.cpp +++ b/source/gameengine/VideoTexture/ImageMix.cpp @@ -42,12 +42,12 @@ // cast ImageSource pointer to ImageSourceMix -inline ImageSourceMix * getImageSourceMix (ImageSource * src) +inline ImageSourceMix *getImageSourceMix(ImageSource *src) { return static_cast(src); } // get weight -short ImageMix::getWeight (const char * id) +short ImageMix::getWeight(const char *id) { // find source ImageSourceList::iterator src = findSource(id); @@ -56,7 +56,7 @@ short ImageMix::getWeight (const char * id) } // set weight -bool ImageMix::setWeight (const char * id, short weight) +bool ImageMix::setWeight(const char *id, short weight) { // find source ImageSourceList::iterator src = findSource(id); @@ -72,7 +72,7 @@ ExceptionID ImageSizesNotMatch; ExpDesc ImageSizesNotMatchDesc(ImageSizesNotMatch, "Image sizes of sources are different"); // calculate image from sources and set its availability -void ImageMix::calcImage (unsigned int texId, double ts) +void ImageMix::calcImage(unsigned int texId, double ts) { // check source sizes if (!checkSourceSizes()) THRWEXCP(ImageSizesNotMatch, S_OK); @@ -105,19 +105,19 @@ void ImageMix::calcImage (unsigned int texId, double ts) // cast Image pointer to ImageMix -inline ImageMix * getImageMix (PyImage *self) +inline ImageMix * getImageMix(PyImage *self) { return static_cast(self->m_image); } // python methods // get source weight -static PyObject *getWeight (PyImage *self, PyObject *args) +static PyObject *getWeight(PyImage *self, PyObject *args) { // weight short weight = 0; // get arguments - char * id; + char *id; if (!PyArg_ParseTuple(args, "s:getWeight", &id)) return NULL; if (self->m_image != NULL) @@ -129,10 +129,10 @@ static PyObject *getWeight (PyImage *self, PyObject *args) // set source weight -static PyObject *setWeight (PyImage *self, PyObject *args) +static PyObject *setWeight(PyImage *self, PyObject *args) { // get arguments - char * id; + char *id; short weight = 0; if (!PyArg_ParseTuple(args, "sh:setWeight", &id, &weight)) return NULL; @@ -150,8 +150,7 @@ static PyObject *setWeight (PyImage *self, PyObject *args) // methods structure -static PyMethodDef imageMixMethods[] = -{ +static PyMethodDef imageMixMethods[] = { {"getSource", (PyCFunction)Image_getSource, METH_VARARGS, "get image source"}, {"setSource", (PyCFunction)Image_setSource, METH_VARARGS, "set image source"}, {"getWeight", (PyCFunction)getWeight, METH_VARARGS, "get image source weight"}, @@ -161,8 +160,8 @@ static PyMethodDef imageMixMethods[] = {NULL} }; // attributes structure -static PyGetSetDef imageMixGetSets[] = -{ // attributes from ImageBase class +static PyGetSetDef imageMixGetSets[] = { + // attributes from ImageBase class {(char*)"valid", (getter)Image_valid, NULL, (char*)"bool to tell if an image is available", NULL}, {(char*)"image", (getter)Image_getImage, NULL, (char*)"image data", NULL}, {(char*)"size", (getter)Image_getSize, NULL, (char*)"image size", NULL}, @@ -174,11 +173,10 @@ static PyGetSetDef imageMixGetSets[] = // define python type -PyTypeObject ImageMixType = -{ +PyTypeObject ImageMixType = { PyVarObject_HEAD_INIT(NULL, 0) "VideoTexture.ImageMix", /*tp_name*/ - sizeof(PyImage), /*tp_basicsize*/ + sizeof(PyImage), /*tp_basicsize*/ 0, /*tp_itemsize*/ (destructor)Image_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ @@ -196,16 +194,16 @@ PyTypeObject ImageMixType = 0, /*tp_setattro*/ &imageBufferProcs, /*tp_as_buffer*/ Py_TPFLAGS_DEFAULT, /*tp_flags*/ - "Image mixer", /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ - imageMixMethods, /* tp_methods */ - 0, /* tp_members */ - imageMixGetSets, /* tp_getset */ + "Image mixer", /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + imageMixMethods, /* tp_methods */ + 0, /* tp_members */ + imageMixGetSets, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ @@ -213,6 +211,6 @@ PyTypeObject ImageMixType = 0, /* tp_dictoffset */ (initproc)Image_init, /* tp_init */ 0, /* tp_alloc */ - Image_allocNew, /* tp_new */ + Image_allocNew, /* tp_new */ }; diff --git a/source/gameengine/VideoTexture/ImageMix.h b/source/gameengine/VideoTexture/ImageMix.h index 712efde7dd4..e55b95834fa 100644 --- a/source/gameengine/VideoTexture/ImageMix.h +++ b/source/gameengine/VideoTexture/ImageMix.h @@ -43,7 +43,7 @@ class ImageSourceMix : public ImageSource { public: /// constructor - ImageSourceMix (const char * id) : ImageSource(id), m_weight(0x100) {} + ImageSourceMix (const char *id) : ImageSource(id), m_weight(0x100) {} /// destructor virtual ~ImageSourceMix (void) {} @@ -76,14 +76,14 @@ public: virtual ~ImageMix (void) {} /// get weight - short getWeight (const char * id); + short getWeight(const char *id); /// set weight - bool setWeight (const char * id, short weight); + bool setWeight(const char *id, short weight); protected: /// create new source - virtual ImageSource * newSource (const char * id) { return new ImageSourceMix(id); } + virtual ImageSource *newSource(const char *id) { return new ImageSourceMix(id); } /// calculate image from sources and set its availability virtual void calcImage (unsigned int texId, double ts); diff --git a/source/gameengine/VideoTexture/ImageRender.cpp b/source/gameengine/VideoTexture/ImageRender.cpp index 11ddec681c5..016020048e9 100644 --- a/source/gameengine/VideoTexture/ImageRender.cpp +++ b/source/gameengine/VideoTexture/ImageRender.cpp @@ -62,7 +62,7 @@ ExpDesc MirrorHorizontalDesc(MirrorHorizontal, "Mirror is horizontal in local sp ExpDesc MirrorTooSmallDesc(MirrorTooSmall, "Mirror is too small"); // constructor -ImageRender::ImageRender (KX_Scene * scene, KX_Camera * camera) : +ImageRender::ImageRender (KX_Scene *scene, KX_Camera * camera) : ImageViewport(), m_render(true), m_scene(scene), @@ -562,7 +562,7 @@ static PyGetSetDef imageMirrorGetSets[] = // constructor -ImageRender::ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObject * mirror, RAS_IPolyMaterial * mat) : +ImageRender::ImageRender (KX_Scene *scene, KX_GameObject *observer, KX_GameObject *mirror, RAS_IPolyMaterial *mat) : ImageViewport(), m_render(false), m_scene(scene), diff --git a/source/gameengine/VideoTexture/ImageRender.h b/source/gameengine/VideoTexture/ImageRender.h index 27882a9d117..680e1cc1d89 100644 --- a/source/gameengine/VideoTexture/ImageRender.h +++ b/source/gameengine/VideoTexture/ImageRender.h @@ -49,8 +49,8 @@ class ImageRender : public ImageViewport { public: /// constructor - ImageRender (KX_Scene * scene, KX_Camera * camera); - ImageRender (KX_Scene * scene, KX_GameObject * observer, KX_GameObject * mirror, RAS_IPolyMaterial * mat); + ImageRender(KX_Scene *scene, KX_Camera *camera); + ImageRender(KX_Scene *scene, KX_GameObject *observer, KX_GameObject *mirror, RAS_IPolyMaterial * mat); /// destructor virtual ~ImageRender (void); diff --git a/source/gameengine/VideoTexture/PyTypeList.cpp b/source/gameengine/VideoTexture/PyTypeList.cpp index 99e9ae13e64..588a1257d6a 100644 --- a/source/gameengine/VideoTexture/PyTypeList.cpp +++ b/source/gameengine/VideoTexture/PyTypeList.cpp @@ -58,7 +58,7 @@ bool PyTypeList::in (PyTypeObject *type) } /// add type to list -void PyTypeList::add (PyTypeObject *type, const char * name) +void PyTypeList::add (PyTypeObject *type, const char *name) { // if list doesn't exist, create it if (m_list.get() == NULL) diff --git a/source/gameengine/VideoTexture/VideoBase.cpp b/source/gameengine/VideoTexture/VideoBase.cpp index edf03dea484..9c8df0ca8c4 100644 --- a/source/gameengine/VideoTexture/VideoBase.cpp +++ b/source/gameengine/VideoTexture/VideoBase.cpp @@ -52,7 +52,7 @@ void VideoBase::init(short width, short height) // process video frame -void VideoBase::process (BYTE * sample) +void VideoBase::process (BYTE *sample) { // if scale was changed if (m_scaleChange) @@ -106,7 +106,7 @@ ExpDesc SourceVideoEmptyDesc(SourceVideoEmpty, "Source Video is empty"); ExpDesc SourceVideoCreationDesc(SourceVideoCreation, "SourceVideo object was not created"); // open video source -void Video_open(VideoBase * self, char * file, short captureID) +void Video_open(VideoBase *self, char *file, short captureID) { // if file is empty, throw exception if (file == NULL) THRWEXCP(SourceVideoEmpty, S_OK); diff --git a/source/gameengine/VideoTexture/VideoBase.h b/source/gameengine/VideoTexture/VideoBase.h index 9880165c198..8d64980c9c2 100644 --- a/source/gameengine/VideoTexture/VideoBase.h +++ b/source/gameengine/VideoTexture/VideoBase.h @@ -66,13 +66,13 @@ public: virtual ~VideoBase (void) {} /// open video file - virtual void openFile (char * file) + virtual void openFile(char *file) { m_isFile = true; m_status = SourceReady; } /// open video capture device - virtual void openCam (char * file, short camIdx) + virtual void openCam(char *file, short camIdx) { m_isFile = false; m_status = SourceReady; @@ -186,7 +186,7 @@ template void Video_init(PyImage *self) // video functions -void Video_open(VideoBase * self, char * file, short captureID); +void Video_open(VideoBase *self, char *file, short captureID); PyObject *Video_play(PyImage *self); PyObject *Video_pause(PyImage *self); PyObject *Video_stop(PyImage *self); diff --git a/source/gameengine/VideoTexture/VideoFFmpeg.h b/source/gameengine/VideoTexture/VideoFFmpeg.h index 2f466eb5eeb..4a948fe61de 100644 --- a/source/gameengine/VideoTexture/VideoFFmpeg.h +++ b/source/gameengine/VideoTexture/VideoFFmpeg.h @@ -79,9 +79,9 @@ public: /// set initial parameters void initParams (short width, short height, float rate, bool image=false); /// open video/image file - virtual void openFile (char * file); + virtual void openFile(char *file); /// open video capture device - virtual void openCam (char * driver, short camIdx); + virtual void openCam(char *driver, short camIdx); /// release video source virtual bool release (void); -- cgit v1.2.3