Skip to content

Commit

Permalink
Merge pull request #234 from domeengine/release/v1.7.2
Browse files Browse the repository at this point in the history
release/v1.7.2
  • Loading branch information
avivbeeri authored Mar 11, 2022
2 parents 95a33c5 + 23d65d3 commit c35ab9c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/SDL
Submodule SDL updated 1311 files
7 changes: 5 additions & 2 deletions src/modules/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,12 @@ CANVAS_clip(WrenVM* vm) {
int64_t y = round(wrenGetSlotDouble(vm, 2));
int64_t w = round(wrenGetSlotDouble(vm, 3));
int64_t h = round(wrenGetSlotDouble(vm, 4));

// We store the clip that the user requested, but we modify it
// so that it fits on screen
DOME_RECT rect = {
.x = x,
.y = y,
.x = max(0, x),
.y = max(0, y),
.w = min(width - x, w),
.h = min(height - y, h)
};
Expand Down
11 changes: 10 additions & 1 deletion src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,21 @@ internal void VM_error(WrenVM* vm, WrenErrorType type, const char* module,
internal const char*
VM_resolve_module_name(WrenVM* vm, const char* importer, const char* name) {
const char* localName = name;
bool matchesInternal = false;

if (strlen(name) > 1) {
while (localName[0] == '.' && localName[1] == '/') {
localName = localName + 2;
}
}
return path_normalize(localName);
const char* normalized = path_normalize(localName);
ENGINE* engine = wrenGetUserData(vm);
matchesInternal = strcmp(name, localName) != 0 && MAP_getModule(&(engine->moduleMap), normalized) != NULL;

if (matchesInternal) {
ENGINE_printLog(engine, "WARNING: Module import path \"%s\" resolves to internal module \"%s\"\n", name, localName);
}
return normalized;
}

internal WrenVM* VM_create(ENGINE* engine) {
Expand Down

0 comments on commit c35ab9c

Please sign in to comment.