This commit is contained in:
Jonas Kulla 2014-01-01 12:56:45 +01:00
parent 7a1dd2588d
commit 1bacceddf0
11 changed files with 34 additions and 1 deletions

View File

@ -256,6 +256,7 @@ static void runRMXPScripts()
i, RSTRING_PTR(scriptName)); i, RSTRING_PTR(scriptName));
showMsg(buffer); showMsg(buffer);
break; break;
} }

View File

@ -118,6 +118,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
// FIXME print num of needed args vs provided // FIXME print num of needed args vs provided
if (argc <= argI && !opt) if (argc <= argI && !opt)
rb_raise(rb_eArgError, "wrong number of arguments"); rb_raise(rb_eArgError, "wrong number of arguments");
break; break;
} }
@ -135,6 +136,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
*obj = *arg++; *obj = *arg++;
++argI; ++argI;
break; break;
} }
@ -151,6 +153,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
*str = tmp; *str = tmp;
++argI; ++argI;
break; break;
} }
@ -170,6 +173,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
*s = RSTRING_PTR(tmp); *s = RSTRING_PTR(tmp);
*len = RSTRING_LEN(tmp); *len = RSTRING_LEN(tmp);
++argI; ++argI;
break; break;
} }
@ -187,6 +191,7 @@ rb_get_args(int argc, VALUE *argv, const char *format, ...)
*s = RSTRING_PTR(tmp); *s = RSTRING_PTR(tmp);
++argI; ++argI;
break; break;
} }

View File

@ -119,17 +119,20 @@ RB_METHOD(tableSetAt)
case 2 : case 2 :
x = rb_fix2int(argv[0]); x = rb_fix2int(argv[0]);
value = rb_fix2int(argv[1]); value = rb_fix2int(argv[1]);
break; break;
case 3 : case 3 :
x = rb_fix2int(argv[0]); x = rb_fix2int(argv[0]);
y = rb_fix2int(argv[1]); y = rb_fix2int(argv[1]);
value = rb_fix2int(argv[2]); value = rb_fix2int(argv[2]);
break; break;
case 4 : case 4 :
x = rb_fix2int(argv[0]); x = rb_fix2int(argv[0]);
y = rb_fix2int(argv[1]); y = rb_fix2int(argv[1]);
z = rb_fix2int(argv[2]); z = rb_fix2int(argv[2]);
value = rb_fix2int(argv[3]); value = rb_fix2int(argv[3]);
break; break;
} }

View File

@ -332,6 +332,7 @@ runRMXPScripts(mrb_state *mrb, mrbc_context *ctx)
i, RSTRING_PTR(scriptName)); i, RSTRING_PTR(scriptName));
showError(buffer); showError(buffer);
break; break;
} }

View File

@ -347,6 +347,7 @@ MRB_METHOD(fileEachLine)
while (feof(f) == 0) while (feof(f) == 0)
{ {
GUARD_ERRNO( readLine(f, buffer); ) GUARD_ERRNO( readLine(f, buffer); )
if (buffer.empty() && feof(f) != 0) if (buffer.empty() && feof(f) != 0)
break; break;
@ -373,6 +374,7 @@ MRB_METHOD(fileEachByte)
while (feof(f) == 0) while (feof(f) == 0)
{ {
mrb_int byte = fgetc(f); mrb_int byte = fgetc(f);
if (byte == -1) if (byte == -1)
break; break;
@ -473,6 +475,7 @@ MRB_METHOD(fileReadLines)
while (feof(f) == 0) while (feof(f) == 0)
{ {
GUARD_ERRNO( readLine(f, buffer); ) GUARD_ERRNO( readLine(f, buffer); )
if (buffer.empty() && feof(f) != 0) if (buffer.empty() && feof(f) != 0)
break; break;

View File

@ -793,23 +793,27 @@ write_value(MarshalContext *ctx, mrb_value value)
ctx->writeByte(TYPE_FALSE); ctx->writeByte(TYPE_FALSE);
else else
ctx->writeByte(TYPE_NIL); ctx->writeByte(TYPE_NIL);
break; break;
case MRB_TT_FIXNUM : case MRB_TT_FIXNUM :
ctx->writeByte(TYPE_FIXNUM); ctx->writeByte(TYPE_FIXNUM);
write_fixnum(ctx, mrb_fixnum(value)); write_fixnum(ctx, mrb_fixnum(value));
break; break;
case MRB_TT_FLOAT : case MRB_TT_FLOAT :
ctx->writeByte(TYPE_FLOAT); ctx->writeByte(TYPE_FLOAT);
write_float(ctx, mrb_float(value)); write_float(ctx, mrb_float(value));
ctx->objects.add(value); ctx->objects.add(value);
break; break;
case MRB_TT_STRING : case MRB_TT_STRING :
ctx->objects.add(value); ctx->objects.add(value);
ctx->writeByte(TYPE_STRING); ctx->writeByte(TYPE_STRING);
write_string_value(ctx, value); write_string_value(ctx, value);
break; break;
case MRB_TT_ARRAY : case MRB_TT_ARRAY :

View File

@ -118,17 +118,20 @@ MRB_METHOD(tableSetAt)
case 2 : case 2 :
x = fix(argv[0]); x = fix(argv[0]);
value = fix(argv[1]); value = fix(argv[1]);
break; break;
case 3 : case 3 :
x = fix(argv[0]); x = fix(argv[0]);
y = fix(argv[1]); y = fix(argv[1]);
value = fix(argv[2]); value = fix(argv[2]);
break; break;
case 4 : case 4 :
x = fix(argv[0]); x = fix(argv[0]);
y = fix(argv[1]); y = fix(argv[1]);
z = fix(argv[2]); z = fix(argv[2]);
value = fix(argv[3]); value = fix(argv[3]);
break; break;
} }

View File

@ -1287,6 +1287,7 @@ struct AudioStream
throw e; throw e;
} }
} }
break; break;
} }

View File

@ -113,26 +113,31 @@ void EventThread::process(RGSSThreadData &rtData)
case SDL_WINDOWEVENT_ENTER : case SDL_WINDOWEVENT_ENTER :
cursorInWindow = true; cursorInWindow = true;
updateCursorState(cursorInWindow && windowFocused); updateCursorState(cursorInWindow && windowFocused);
break; break;
case SDL_WINDOWEVENT_LEAVE : case SDL_WINDOWEVENT_LEAVE :
cursorInWindow = false; cursorInWindow = false;
updateCursorState(cursorInWindow && windowFocused); updateCursorState(cursorInWindow && windowFocused);
break; break;
case SDL_WINDOWEVENT_CLOSE : case SDL_WINDOWEVENT_CLOSE :
terminate = true; terminate = true;
break; break;
case SDL_WINDOWEVENT_FOCUS_GAINED : case SDL_WINDOWEVENT_FOCUS_GAINED :
windowFocused = true; windowFocused = true;
updateCursorState(cursorInWindow && windowFocused); updateCursorState(cursorInWindow && windowFocused);
break; break;
case SDL_WINDOWEVENT_FOCUS_LOST : case SDL_WINDOWEVENT_FOCUS_LOST :
windowFocused = false; windowFocused = false;
updateCursorState(cursorInWindow && windowFocused); updateCursorState(cursorInWindow && windowFocused);
resetInputStates(); resetInputStates();
break; break;
} }
break; break;
@ -141,6 +146,7 @@ void EventThread::process(RGSSThreadData &rtData)
case REQUEST_TERMINATION : case REQUEST_TERMINATION :
terminate = true; terminate = true;
Debug() << "EventThread termination requested"; Debug() << "EventThread termination requested";
break; break;
case SDL_KEYDOWN : case SDL_KEYDOWN :
@ -175,6 +181,7 @@ void EventThread::process(RGSSThreadData &rtData)
strncpy(pendingTitle, rtData.config.game.title.c_str(), strncpy(pendingTitle, rtData.config.game.title.c_str(),
sizeof(pendingTitle)); sizeof(pendingTitle));
havePendingTitle = true; havePendingTitle = true;
break; break;
} }
@ -204,11 +211,13 @@ void EventThread::process(RGSSThreadData &rtData)
(const char*) event.user.data1, win); (const char*) event.user.data1, win);
free(event.user.data1); free(event.user.data1);
msgBoxDone = true; msgBoxDone = true;
break; break;
case REQUEST_SETCURSORVISIBLE : case REQUEST_SETCURSORVISIBLE :
showCursor = event.user.code; showCursor = event.user.code;
updateCursorState(cursorInWindow); updateCursorState(cursorInWindow);
break; break;
case UPDATE_FPS : case UPDATE_FPS :
@ -224,6 +233,7 @@ void EventThread::process(RGSSThreadData &rtData)
{ {
strncpy(pendingTitle, buffer, sizeof(pendingTitle)); strncpy(pendingTitle, buffer, sizeof(pendingTitle));
havePendingTitle = true; havePendingTitle = true;
break; break;
} }
@ -272,6 +282,7 @@ void EventThread::process(RGSSThreadData &rtData)
case SDL_MOUSEMOTION : case SDL_MOUSEMOTION :
mouseState.x = event.motion.x; mouseState.x = event.motion.x;
mouseState.y = event.motion.y; mouseState.y = event.motion.y;
break; break;
} }

View File

@ -316,6 +316,7 @@ RGSS_openArchive(PHYSFS_Io *io, const char *, int forWrite)
/* Read filename length, /* Read filename length,
* if nothing was read, no files remain */ * if nothing was read, no files remain */
uint32_t nameLen; uint32_t nameLen;
if (!readUint32(io, nameLen)) if (!readUint32(io, nameLen))
break; break;

View File

@ -874,7 +874,7 @@ struct TilemapPrivate
continue; continue;
VBO::uploadSubData(k*quadDataSize(bufferFrameQuadCount) + quadDataSize(scanrowBases[i]), VBO::uploadSubData(k*quadDataSize(bufferFrameQuadCount) + quadDataSize(scanrowBases[i]),
quadDataSize(scanrowSize(i)), &scanrowVert[i].v[k][0]); quadDataSize(scanrowSize(i)), &scanrowVert[i].v[k][0]);
} }
} }