Mac Stuff that should fix things

This commit is contained in:
Mark Watkins 2011-06-14 15:56:56 +10:00
parent 28c96e45df
commit 1cee803476
7 changed files with 63 additions and 58 deletions

View File

@ -8306,7 +8306,23 @@
<sleeplib/machine.h> <sleeplib/machine.h>
<list> <list>
1308026543 /home/mark/projects/git/sleepyhead/src/version.h 1308026543 D
1308030963 /home/mark/projects/git/sleepyhead/src/version.h
1308003040 ent of cb2ab33... Linux wx2.8 & wx2.9 builds fixed
<wx/dcbuffer.h>
<wx/glcanvas.h>
<wx/settings.h>
<wx/graphics.h>
<wx/image.h>
<wx/log.h>
<math.h>
"sleeplib/profiles.h"
"freesans.c"
"graph.h"
"freetype-gl/font-manager.h"
"freetype-gl/texture-font.h"
1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h 1307627540 /home/mark/projects/git/sleepyhead/src/libs/sleeplib/prs1_loader.h
"machine.h" "machine.h"
@ -8344,7 +8360,7 @@
"sleeplib/profiles.h" "sleeplib/profiles.h"
"sleeplib/machine_loader.h" "sleeplib/machine_loader.h"
1308010945 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp 1308030539 source:/home/mark/projects/git/sleepyhead/src/graphs/graph.cpp
<OpenGL/gl.h> <OpenGL/gl.h>
<AGL/agl.h> <AGL/agl.h>
<GL/glew.h> <GL/glew.h>
@ -8361,6 +8377,8 @@
"freetype-gl/font-manager.h" "freetype-gl/font-manager.h"
"freetype-gl/texture-font.h" "freetype-gl/texture-font.h"
1308010945 >
1307623396 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/binary_file.cpp 1307623396 source:/home/mark/projects/git/sleepyhead/src/libs/sleeplib/binary_file.cpp
<wx/filename.h> <wx/filename.h>
"binary_file.h" "binary_file.h"
@ -11019,7 +11037,7 @@
<GL/glew.h> <GL/glew.h>
"texture-atlas.h" "texture-atlas.h"
1308025957 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/texture-font.cpp 1308030624 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/texture-font.cpp
<ft2build.h> <ft2build.h>
<wx/log.h> <wx/log.h>
<math.h> <math.h>
@ -11031,14 +11049,14 @@
<GL/gl.h> <GL/gl.h>
"texture-glyph.h" "texture-glyph.h"
1308011216 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vertex-buffer.cpp 1308030709 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vertex-buffer.cpp
<assert.h> <assert.h>
<string.h> <string.h>
<stdlib.h> <stdlib.h>
<stdio.h> <stdio.h>
"vertex-buffer.h" "vertex-buffer.h"
1308000005 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vector.cpp 1308030960 source:/home/mark/projects/git/sleepyhead/src/libs/freetype-gl/vector.cpp
<assert.h> <assert.h>
<stdlib.h> <stdlib.h>
<string.h> <string.h>

View File

@ -19,7 +19,7 @@
<File name="../../src/graphs/freesans.c" open="0" top="0" tabpos="10"> <File name="../../src/graphs/freesans.c" open="0" top="0" tabpos="10">
<Cursor position="0" topLine="0" /> <Cursor position="0" topLine="0" />
</File> </File>
<File name="../../src/graphs/graph.cpp" open="1" top="1" tabpos="7"> <File name="../../src/graphs/graph.cpp" open="1" top="0" tabpos="7">
<Cursor position="0" topLine="0" /> <Cursor position="0" topLine="0" />
</File> </File>
<File name="../../src/graphs/graph.h" open="1" top="0" tabpos="8"> <File name="../../src/graphs/graph.h" open="1" top="0" tabpos="8">
@ -29,25 +29,25 @@
<Cursor position="0" topLine="30" /> <Cursor position="0" topLine="30" />
</File> </File>
<File name="../../src/libs/freetype-gl/font-manager.h" open="1" top="0" tabpos="14"> <File name="../../src/libs/freetype-gl/font-manager.h" open="1" top="0" tabpos="14">
<Cursor position="1954" topLine="13" /> <Cursor position="1954" topLine="5" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-atlas.cpp" open="1" top="0" tabpos="10"> <File name="../../src/libs/freetype-gl/texture-atlas.cpp" open="1" top="0" tabpos="10">
<Cursor position="3243" topLine="80" /> <Cursor position="3243" topLine="80" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-atlas.h" open="1" top="0" tabpos="13"> <File name="../../src/libs/freetype-gl/texture-atlas.h" open="1" top="0" tabpos="13">
<Cursor position="1629" topLine="29" /> <Cursor position="1629" topLine="21" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-font.cpp" open="1" top="0" tabpos="11"> <File name="../../src/libs/freetype-gl/texture-font.cpp" open="1" top="0" tabpos="11">
<Cursor position="3837" topLine="106" /> <Cursor position="3837" topLine="106" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-font.h" open="1" top="0" tabpos="12"> <File name="../../src/libs/freetype-gl/texture-font.h" open="1" top="0" tabpos="12">
<Cursor position="0" topLine="17" /> <Cursor position="0" topLine="9" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-glyph.cpp" open="1" top="0" tabpos="15"> <File name="../../src/libs/freetype-gl/texture-glyph.cpp" open="1" top="0" tabpos="15">
<Cursor position="0" topLine="69" /> <Cursor position="0" topLine="69" />
</File> </File>
<File name="../../src/libs/freetype-gl/texture-glyph.h" open="1" top="0" tabpos="16"> <File name="../../src/libs/freetype-gl/texture-glyph.h" open="1" top="0" tabpos="16">
<Cursor position="0" topLine="24" /> <Cursor position="0" topLine="19" />
</File> </File>
<File name="../../src/libs/freetype-gl/vector.cpp" open="0" top="0" tabpos="13"> <File name="../../src/libs/freetype-gl/vector.cpp" open="0" top="0" tabpos="13">
<Cursor position="1187" topLine="18" /> <Cursor position="1187" topLine="18" />
@ -94,4 +94,7 @@
<File name="../../src/libs/sleeplib/prs1_loader.h" open="0" top="0" tabpos="11"> <File name="../../src/libs/sleeplib/prs1_loader.h" open="0" top="0" tabpos="11">
<Cursor position="622" topLine="0" /> <Cursor position="622" topLine="0" />
</File> </File>
<File name="../../src/version.h" open="1" top="1" tabpos="19">
<Cursor position="586" topLine="0" />
</File>
</CodeBlocks_layout_file> </CodeBlocks_layout_file>

View File

@ -912,28 +912,15 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
#if wxCHECK_VERSION(2,9,0) #if wxCHECK_VERSION(2,9,0)
display=wxGetX11Display(); display=wxGetX11Display();
fbc = GetGLXFBConfig(); fbc = GetGLXFBConfig();
fbc=&fbc[0];
#else #else
display=(Display *)wxGetDisplay(); display=(Display *)wxGetDisplay();
int FBAttribs[] = {
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DOUBLEBUFFER, True,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
None
};
fbc = glXChooseFBConfig(display, DefaultScreen(display), FBAttribs, &ret);
// TODO: // TODO:
// have to setup a GLXFBConfig structure for wx2.8 because wx2.8 is crap. // have to setup a GLXFBConfig structure for wx2.8 because wx2.8 is crap.
// already done this crap but deleted it.. arggghh..... // already done this crap but deleted it.. arggghh.....
//return &wxNullBitmap; return &wxNullBitmap;
#endif #endif
GLXPbuffer pBuffer=glXCreatePbuffer(display, *fbc, attrib );
GLXPbuffer pBuffer=glXCreatePbuffer(display, fbc[0], attrib );
if (pBuffer == 0) { if (pBuffer == 0) {
wxLogError(wxT("pBuffer not availble")); wxLogError(wxT("pBuffer not availble"));
} }
@ -946,7 +933,7 @@ wxBitmap * gGraphWindow::RenderBitmap(int width,int height)
if (!cx && real_shared_context) cx=real_shared_context; // Only available after redraw.. :( if (!cx && real_shared_context) cx=real_shared_context; // Only available after redraw.. :(
else { else {
// First render screws up unless we do this.. // First render screws up unless we do this..
gx=cx = glXCreateNewContext(display,*fbc,GLX_RGBA_TYPE, NULL, True); gx=cx = glXCreateNewContext(display,fbc[0],GLX_RGBA_TYPE, NULL, True);
} }
//real_shared_context = //real_shared_context =
@ -1716,7 +1703,7 @@ void gCandleStick::Plot(gGraphWindow & w,float scrx,float scry)
if (m_direction==wxVERTICAL) { if (m_direction==wxVERTICAL) {
DrawText(str,start_px+barwidth+2+y,j,270.0,*wxBLACK); DrawText(str,start_px+barwidth+2+y,j,270.0,*wxBLACK);
} else { } else {
DrawText(str,j,start_py+(barwidth/2)-(y/2)+4); //0,*wxBLACK,texfont); DrawText(str,j,start_py+(barwidth/2)-(y/2)+1);
} }
} }

View File

@ -145,7 +145,7 @@ int TextureFont::CacheGlyphs(wchar_t * charcodes)
for( x=0; x<slot->bitmap.width; ++x ) { for( x=0; x<slot->bitmap.width; ++x ) {
for( y=0; y<slot->bitmap.rows; ++y ){ for( y=0; y<slot->bitmap.rows; ++y ){
c = *(unsigned char *)(slot->bitmap.buffer + y*slot->bitmap.pitch + x ); c = *(unsigned char *)(slot->bitmap.buffer + y*slot->bitmap.pitch + x );
c = (unsigned char) ( pow((float)c/255.0, (float)m_gamma) * 255); c = (unsigned char) ( pow(float(c)/255.0, (float)m_gamma) * 255);
*(unsigned char *)(slot->bitmap.buffer + y*slot->bitmap.pitch + x ) = c; *(unsigned char *)(slot->bitmap.buffer + y*slot->bitmap.pitch + x ) = c;
} }
} }

View File

@ -61,7 +61,8 @@ vector_get( const Vector *self,
assert( self ); assert( self );
assert( self->size ); assert( self->size );
assert( index < self->size ); assert( index < self->size );
return self->items + index * self->item_size; //unsigned char *p=;
return (unsigned char *)self->items + index * self->item_size;
} }
@ -175,8 +176,7 @@ vector_set( Vector *self,
assert( self ); assert( self );
assert( self->size ); assert( self->size );
assert( index < self->size ); assert( index < self->size );
memcpy( self->items + index * self->item_size, memcpy( (unsigned char *)self->items + index * self->item_size, item, self->item_size );
item, self->item_size );
} }
@ -195,8 +195,8 @@ vector_insert( Vector *self,
} }
if( index < self->size ) if( index < self->size )
{ {
memmove( self->items + (index + 1) * self->item_size, memmove( (unsigned char *)self->items + (index + 1) * self->item_size,
self->items + (index + 0) * self->item_size, (unsigned char *)self->items + (index + 0) * self->item_size,
(self->size - index) * self->item_size); (self->size - index) * self->item_size);
} }
self->size++; self->size++;
@ -214,8 +214,8 @@ vector_erase_range( Vector *self,
assert( first < self->size ); assert( first < self->size );
assert( last < self->size+1 ); assert( last < self->size+1 );
assert( first < last ); assert( first < last );
memmove( self->items + first * self->item_size, memmove( (unsigned char *)self->items + first * self->item_size,
self->items + last * self->item_size, (unsigned char *)self->items + last * self->item_size,
(self->size - last) * self->item_size); (self->size - last) * self->item_size);
self->size -= (last-first); self->size -= (last-first);
} }
@ -284,8 +284,7 @@ vector_push_back_data( Vector *self,
{ {
vector_reserve(self, self->size+count); vector_reserve(self, self->size+count);
} }
memmove( self->items + self->size * self->item_size, data, memmove( (unsigned char *)self->items + self->size * self->item_size, data, count*self->item_size );
count*self->item_size );
self->size += count; self->size += count;
} }
@ -306,11 +305,9 @@ vector_insert_data( Vector *self,
{ {
vector_reserve(self, self->size+count); vector_reserve(self, self->size+count);
} }
memmove( self->items + (index + count ) * self->item_size, memmove( (unsigned char *)self->items + (index + count ) * self->item_size,
self->items + (index ) * self->item_size, (unsigned char *)self->items + (index ) * self->item_size, count*self->item_size );
count*self->item_size ); memmove( (unsigned char *)self->items + index * self->item_size, data, count*self->item_size );
memmove( self->items + index * self->item_size, data,
count*self->item_size );
self->size += count; self->size += count;
} }

View File

@ -399,15 +399,15 @@ char * GL_TYPE_STRING(GLenum gtype)
{ {
switch(gtype) switch(gtype)
{ {
case GL_BOOL: return "GL_BOOL"; case GL_BOOL: return (char *)"GL_BOOL";
case GL_BYTE: return "GL_BYTE"; case GL_BYTE: return (char *)"GL_BYTE";
case GL_UNSIGNED_BYTE: return "GL_UNSIGNED_BYTE"; case GL_UNSIGNED_BYTE: return (char *)"GL_UNSIGNED_BYTE";
case GL_SHORT: return "GL_SHORT"; case GL_SHORT: return (char *)"GL_SHORT";
case GL_UNSIGNED_SHORT: return "GL_UNSIGNED_SHORT"; case GL_UNSIGNED_SHORT: return (char *)"GL_UNSIGNED_SHORT";
case GL_INT: return "GL_INT"; case GL_INT: return (char *)"GL_INT";
case GL_UNSIGNED_INT: return "GL_UNSIGNED_INT"; case GL_UNSIGNED_INT: return (char *)"GL_UNSIGNED_INT";
case GL_FLOAT: return "GL_FLOAT"; case GL_FLOAT: return (char *)"GL_FLOAT";
case GL_DOUBLE: return "GL_DOUBLE"; case GL_DOUBLE: return (char *)"GL_DOUBLE";
default: return "GL_VOID"; default: return (char *)"GL_VOID";
} }
} }

View File

@ -16,14 +16,14 @@ namespace AutoVersion{
//Standard Version Type //Standard Version Type
static const long MAJOR = 0; static const long MAJOR = 0;
static const long MINOR = 7; static const long MINOR = 7;
static const long BUILD = 5641; static const long BUILD = 5653;
static const long REVISION = 14124; static const long REVISION = 14197;
//Miscellaneous Version Types //Miscellaneous Version Types
static const long BUILDS_COUNT = 5845; static const long BUILDS_COUNT = 5867;
#define RC_FILEVERSION 0,7,5641,14124 #define RC_FILEVERSION 0,7,5653,14197
#define RC_FILEVERSION_STRING "0, 7, 5641, 14124\0" #define RC_FILEVERSION_STRING "0, 7, 5653, 14197\0"
static const char FULLVERSION_STRING[] = "0.7.5641.14124"; static const char FULLVERSION_STRING[] = "0.7.5653.14197";
//These values are to keep track of your versioning state, don't modify them. //These values are to keep track of your versioning state, don't modify them.
static const long BUILD_HISTORY = 0; static const long BUILD_HISTORY = 0;