Renamed palette_colorIdx -> palette_colorToIdx
This commit is contained in:
@@ -39,7 +39,7 @@ static int getColorFromArgs(lua_State *L, int *rgb, const int *def) {
|
||||
g = luaL_checkint(L, 2);
|
||||
b = luaL_checkint(L, 3);
|
||||
}
|
||||
int idx = palette_colorIdx(r, g, b);
|
||||
int idx = palette_colorToIdx(r, g, b);
|
||||
if (idx < 0) {
|
||||
luaL_error(L, "color palette exhausted: use fewer unique colors");
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ const char *image_init(image_t *self, const char *filename) {
|
||||
int g = p[1];
|
||||
int b = p[2];
|
||||
int a = p[3];
|
||||
int idx = palette_colorIdx(r, g, b);
|
||||
int idx = palette_colorToIdx(r, g, b);
|
||||
if (idx < 0) {
|
||||
errmsg = "color palette exhausted: use fewer unique colors";
|
||||
goto fail;
|
||||
|
||||
@@ -40,7 +40,7 @@ static unsigned hash(const void *data, int size) {
|
||||
}
|
||||
|
||||
|
||||
int palette_colorIdx(int r, int g, int b) {
|
||||
int palette_colorToIdx(int r, int g, int b) {
|
||||
palette_init();
|
||||
|
||||
/* Make 18bit rgb color (6bits per-channel) from 8bit channels */
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
|
||||
void palette_init(void);
|
||||
void palette_reset(void);
|
||||
int palette_colorIdx(int r, int g, int b);
|
||||
int palette_colorToIdx(int r, int g, int b);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user