# HG changeset patch # User kaito@dolphins # Date 1297789697 -32400 # Node ID bb17a03bab6046863d9f3275b975d1ca55c72ed4 # Parent 4f16fad0dd09ea00b4223cf1c79c39e4a4eef716 fix. diff -r 4f16fad0dd09 -r bb17a03bab60 Renderer/Engine/Makefile.cell --- a/Renderer/Engine/Makefile.cell Tue Feb 15 19:21:03 2011 +0900 +++ b/Renderer/Engine/Makefile.cell Wed Feb 16 02:08:17 2011 +0900 @@ -14,7 +14,7 @@ LIBS += -lCellManager -lspe2 -lpthread -CFLAGS += -D__CERIUM_CELL__ -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags` +CFLAGS += -D__CERIUM_CELL__ -DHAS_POSIX_MEMALIGN -Drestrict=__restrict__ `sdl-config --cflags` `xml2-config --cflags` LIBS += `sdl-config --libs` -lSDL_image -lGL `xml2-config --libs` .SUFFIXES: .cc .o diff -r 4f16fad0dd09 -r bb17a03bab60 Renderer/Engine/TextureHash.cc --- a/Renderer/Engine/TextureHash.cc Tue Feb 15 19:21:03 2011 +0900 +++ b/Renderer/Engine/TextureHash.cc Wed Feb 16 02:08:17 2011 +0900 @@ -11,8 +11,9 @@ #if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN) table = (hashtable*)malloc(size); #else - posix_memalign((void**)&table, alignment, size); + posix_memalign((void**)&table, 16, size); #endif + for (int i = 0; i < TABLE_SIZE; i++) { table[i].tx_id = -1; table[i].key = NULL; diff -r 4f16fad0dd09 -r bb17a03bab60 Renderer/Engine/polygon.h --- a/Renderer/Engine/polygon.h Tue Feb 15 19:21:03 2011 +0900 +++ b/Renderer/Engine/polygon.h Wed Feb 16 02:08:17 2011 +0900 @@ -44,8 +44,13 @@ { void *buff = 0; if (size==0) return 0; - posix_memalign(&buff, 16, size); +#if defined(__SPU__) || ! defined(HAS_POSIX_MEMALIGN) + buff = malloc(size); +#else + posix_memalign(&buff, DEFAULT_ALIGNMENT, size); +#endif return buff; + } void position_init(void);