mirror of https://github.com/axmolengine/axmol.git
Fixing compilation errors for linux port.
This commit is contained in:
parent
f0b792eb2d
commit
8c779ff98f
|
@ -58,7 +58,7 @@ Skeleton* Skeleton_create (SkeletonData* data) {
|
||||||
SlotData *slotData = data->slots[i];
|
SlotData *slotData = data->slots[i];
|
||||||
|
|
||||||
/* Find bone for the slotData's boneData. */
|
/* Find bone for the slotData's boneData. */
|
||||||
Bone *bone;
|
Bone *bone = NULL;
|
||||||
for (ii = 0; ii < self->boneCount; ++ii) {
|
for (ii = 0; ii < self->boneCount; ++ii) {
|
||||||
if (data->bones[ii] == slotData->boneData) {
|
if (data->bones[ii] == slotData->boneData) {
|
||||||
bone = self->bones[ii];
|
bone = self->bones[ii];
|
||||||
|
|
|
@ -59,8 +59,9 @@ char* _readFile (const char* path, int* length) {
|
||||||
fseek(file, 0, SEEK_SET);
|
fseek(file, 0, SEEK_SET);
|
||||||
|
|
||||||
char* data = MALLOC(char, *length);
|
char* data = MALLOC(char, *length);
|
||||||
fread(data, 1, *length, file);
|
int rtn = fread(data, 1, *length, file);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
if (rtn != *length) return 0;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ extern "C"
|
||||||
int cocos2dx_lua_loader(lua_State *L)
|
int cocos2dx_lua_loader(lua_State *L)
|
||||||
{
|
{
|
||||||
std::string filename(luaL_checkstring(L, 1));
|
std::string filename(luaL_checkstring(L, 1));
|
||||||
int pos = filename.rfind(".lua");
|
size_t pos = filename.rfind(".lua");
|
||||||
if (pos != std::string::npos)
|
if (pos != std::string::npos)
|
||||||
{
|
{
|
||||||
filename = filename.substr(0, pos);
|
filename = filename.substr(0, pos);
|
||||||
|
|
Loading…
Reference in New Issue