Skip to content

Commit

Permalink
fixed huge rendering bug with some implementation of OpenGL & CPU speeds
Browse files Browse the repository at this point in the history
fixed MANY compilation warnings
fixed some errors found by Xcode's code analysis
  • Loading branch information
meeloo committed Apr 25, 2014
1 parent 35711e4 commit 5dc2742
Show file tree
Hide file tree
Showing 64 changed files with 482 additions and 407 deletions.
10 changes: 8 additions & 2 deletions deps/clipper/clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2880,11 +2880,17 @@ void Clipper::PrepareHorzJoins(TEdge* horzEdge, bool isTopOfScanbeam)
//the AEL before we process the horizontal edges at the bottom of the next,
//we need to create 'ghost' Join records of 'contrubuting' horizontals that
//we can compare with horizontals at the bottom of the next SB.
if (isTopOfScanbeam)
if (isTopOfScanbeam)
{
if (outPt->Pt == horzEdge->Top)
AddGhostJoin(outPt, horzEdge->Bot);
{
AddGhostJoin(outPt, horzEdge->Bot);
}
else
{
AddGhostJoin(outPt, horzEdge->Top);
}
}
}
//------------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions deps/harfbuzz/hb-private.hh
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ _hb_bit_storage (unsigned int number)
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
return likely (number) ? (sizeof (unsigned int) * 8 - __builtin_clz (number)) : 0;
#else
register unsigned int n_bits = 0;
unsigned int n_bits = 0;
while (number) {
n_bits++;
number >>= 1;
Expand All @@ -206,7 +206,7 @@ _hb_ctz (unsigned int number)
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)
return likely (number) ? __builtin_ctz (number) : 0;
#else
register unsigned int n_bits = 0;
unsigned int n_bits = 0;
if (unlikely (!number)) return 0;
while (!(number & 1)) {
n_bits++;
Expand Down
2 changes: 1 addition & 1 deletion include/nglEndian.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ enum nglEndian
#ifdef __NEED_BYTESWAP_CODE
static inline uint16 bswap_16(uint16 x)
{
return (((x & 0x00ff) << 8) |
return (uint16)(((x & 0x00ff) << 8) |
((x & 0xff00) >> 8));
}

Expand Down
16 changes: 8 additions & 8 deletions include/nglTime.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ in calendar units.
class nglTimeInfo
{
public:
int Seconds; ///< 0..59
int Minutes; ///< 0..59
int Hours; ///< 0..23
int Day; ///< 1..31
int Month; ///< 1..12 (unlike system's gmtime, 0..11)
int Year; ///< number of years since 1900
int WeekDay; ///< 0..6 (0 is Sunday)
int DST; ///< Un drapeau indiquant si le décalage d'heure hiver/éte est en cours au moment de l'appel. La valeur retournée est positive si le décalage est en fonction, nulle s'il ne l'est pas, et négative si l'information n'est pas disponible.
int Seconds = 0; ///< 0..59
int Minutes = 0; ///< 0..59
int Hours = 0; ///< 0..23
int Day = 0; ///< 1..31
int Month = 0; ///< 1..12 (unlike system's gmtime, 0..11)
int Year = 0; ///< number of years since 1900
int WeekDay = 0; ///< 0..6 (0 is Sunday)
int DST = 0; ///< Un drapeau indiquant si le décalage d'heure hiver/éte est en cours au moment de l'appel. La valeur retournée est positive si le décalage est en fonction, nulle s'il ne l'est pas, et négative si l'information n'est pas disponible.

private:
void CopyToSys (struct tm* pTM) const;
Expand Down
4 changes: 2 additions & 2 deletions include/nuiAttribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ class nuiAttribute : public nuiAttributeBase
}
}

NGL_ASSERT(NULL);
NGL_ASSERT(0);
return *pContents;
}

Expand Down Expand Up @@ -944,7 +944,7 @@ class nuiAttribute<const Contents&> : public nuiAttributeBase
}
}

NGL_ASSERT(NULL);
NGL_ASSERT(0);
return *pContents;
}

Expand Down
1 change: 1 addition & 0 deletions include/nuiBindingManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ class nuiCallContext
class nuiTypeContainer
{
public:
virtual ~nuiTypeContainer() {}
virtual void DumpArgs(std::vector<nglString>& rTypes) const = 0;
};

Expand Down
4 changes: 2 additions & 2 deletions include/nuiChunkSampleReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class nuiChunkSampleReader : public nuiSampleReader
virtual int32 ReadDE(std::vector<void*> buffers, int32 sampleframes, nuiSampleBitFormat format = eSampleFloat32);

protected:
bool GoToChunk(char* pId);
bool GoToChunk(const char* pId);
bool ScanAllChunks();
Chunk* GetChunk(char* Id);
Chunk* GetChunk(const char* Id);
void ClearChunks();

std::vector<Chunk*> mChunks;
Expand Down
3 changes: 3 additions & 0 deletions include/nuiDrawContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,15 @@ class nuiDrawContext

void SetSurface(nuiSurface* pSurface);
nuiSurface* GetSurface() const;

NUI_GETSET(bool, Debug);
protected:
// Render state stack:
std::stack<nuiRenderState*> mpRenderStateStack;
nuiRenderState mCurrentState;

nuiSize mWidth,mHeight;
bool mDebug : 1;

#ifndef CALLBACK
#define CALLBACK
Expand Down
1 change: 1 addition & 0 deletions include/nuiGLPainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class nuiGLPainter : public nuiPainter, public nuiCacheManager
};

std::map<nuiRenderArray*, VertexBufferInfo> mVertexBuffers;
std::vector<nuiRenderArray*> mFrameArrays;

bool CheckFramebufferStatus();
virtual void SetViewport();
Expand Down
3 changes: 2 additions & 1 deletion include/nuiMessageQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public :
Message* Get(uint32 time)
{
// wait for an incoming message
mSyncEvent.Wait(time);
if (time > 0)
mSyncEvent.Wait(time);

mQueueCS.Lock();
if (mQueue.empty())
Expand Down
1 change: 1 addition & 0 deletions include/nuiPainter.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class nuiPainter

protected:
nuiSurface* mpSurface;
std::stack<nuiSurface*> mpSurfaceStack;

nuiRenderState mState;
std::stack<nuiClipper> mpClippingStack;
Expand Down
4 changes: 3 additions & 1 deletion include/nuiRenderArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,15 @@ class nuiRenderArray : public nuiRefCount
void AddImageRect(nuiTexture* pTexture, const nuiRect& rDest, const nuiRect& rSource, const nuiColor& rColor = nuiColor(255, 255, 255));
void AddRect(const nuiRect& rDest, const nuiColor& rColor = nuiColor(255, 255, 255));


void SetDebug(bool set) { mDebug = set; }
bool GetDebug() const { return mDebug; }
private:
GLenum mMode;
bool mEnabled[4];
bool mStatic : 1;
bool m3DMesh : 1;
bool mShape : 1;
bool mDebug : 1;
mutable void* mpCacheHandle;
mutable nuiCacheManager* mpCacheManager;

Expand Down
2 changes: 1 addition & 1 deletion include/nuiTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class nuiTask1 : public nuiTask
public:
typedef nuiFastDelegate1<P0, Ret> Delegate;
nuiTask1(const Delegate& rDelegate, const P0& rP0)
: mDelegate(rDelegate), mP0(rP0)
: mP0(rP0), mDelegate(rDelegate)
{
}

Expand Down
2 changes: 1 addition & 1 deletion include/nuiTessellator.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class nuiTessellator
nuiRenderObject* GenerateFromPath(float Quality);
nuiRenderObject* GenerateFromShape(float Quality);

static struct GLUtesselator* mpTess;
static class GLUtesselator* mpTess;
static uint32 mRefs;

#ifndef CALLBACK
Expand Down
1 change: 1 addition & 0 deletions include/nuiUnicode.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ bool nuiIsUnicodeBlank(nglUChar ch);
class nuiUCharIterator
{
public:
virtual ~nuiUCharIterator() {}
virtual nglUChar GetNextUChar(int32& position) const = 0;
virtual int32 GetLength() const = 0;
};
Expand Down
Loading

0 comments on commit 5dc2742

Please sign in to comment.