Fix for unpremultiply, osx compiling

- fixed compiling on osx mavericks
- fixed unpremultiply
This commit is contained in:
Mikko Mononen 2014-02-25 23:03:34 +02:00
parent 5f217448d9
commit e937a513c6
2 changed files with 5 additions and 5 deletions

View File

@ -21,7 +21,7 @@ solution "nanosvg"
configuration { "macosx" }
links { "glfw3" }
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit" }
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" }
configuration "Debug"
defines { "DEBUG" }
@ -46,7 +46,7 @@ solution "nanosvg"
configuration { "macosx" }
links { "glfw3" }
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit" }
linkoptions { "-framework OpenGL", "-framework Cocoa", "-framework IOKit", "-framework CoreVideo" }
configuration "Debug"
defines { "DEBUG" }

View File

@ -620,9 +620,9 @@ static void nsvg__unpremultiplyAlpha(unsigned char* image, int w, int h, int str
for (x = 0; x < w; x++) {
int r = row[0], g = row[1], b = row[2], a = row[3];
if (a != 0) {
r = (r*255/a);
g = (g*255/a);
b = (b*255/a);
row[0] = (int)(r*255/a);
row[1] = (int)(g*255/a);
row[2] = (int)(b*255/a);
}
row += 4;
}