コード例 #1
0
def run_exit(e, x, r):
    r = resolve_expr(r)
    x = resolve_expr(x)
    e = resolve_expr(e)

    if (r in state.definitions["rects"]):
        r = state.definitions["rects"][r]
        r = resolve_expr(r)

    (a, b, c, d) = r

    a, b = scale_point(a, b)
    c, d = scale_point(c, d)

    a = a + state.gorigin[0]
    b = b + state.gorigin[1]
    c = c + state.gorigin[0]
    d = d + state.gorigin[1]

    state.exits.append((a, b, c, d, e, x))
    print("exit", e, r)
コード例 #2
0
def run_dossierbitmap(x, y):
    x = resolve_expr(x)
    y = resolve_expr(y)
    x, y = scale_point(x, y)

    assert (state.dossier_current_sheet is not None)
    assert (state.dossier_current_suspect is not None)
    bmp = load_bmp(state.dossiers[state.dossier_current_suspect][
        state.dossier_current_sheet])

    state.screen.blit(bmp, [x, y])
    pygame.display.flip()
コード例 #3
0
def run_dossierprevsuspect(b, x, y):

    b = resolve_expr(b)
    x = resolve_expr(x)
    y = resolve_expr(y)
    x, y = scale_point(x, y)

    bmp = load_bmp(b)
    state.dossier_previous_suspect = (bmp, x, y)

    state.screen.blit(bmp, [x, y])
    pygame.display.flip()
コード例 #4
0
def run_chgmode(v, e, x):
    v = resolve_expr(v)
    e = resolve_expr(e)
    if x is not None:
        x = resolve_expr(x)

    print("chgmode", v, e, x)
    state.next_setting = e
    state.mode = v
    if state.mode == 0:
        state.gorigin = [0, 0]
    elif state.mode == 1:
        state.gorigin = scale_point(63, 48)
    else:
        print("mode", state.mode)
        assert (False)
コード例 #5
0
def run_dossierchgsheet(b, n, x, y):

    b = resolve_expr(b)
    n = resolve_expr(n)
    x = resolve_expr(x)
    y = resolve_expr(y)
    x, y = scale_point(x, y)

    bmp = load_bmp(b)

    if n == 1:
        state.dossier_next_sheet = (bmp, x, y)
    else:
        state.dossier_previous_sheet = (bmp, x, y)

    state.screen.blit(bmp, [x, y])
    pygame.display.flip()
コード例 #6
0
def run_bitmap(e, x, y):
    if (type(x) != int):
        x = resolve_expr(x)
        x = int(x)

    if (type(y) != int):
        y = resolve_expr(y)
        y = int(y)

    v = resolve_expr(e)
    print("bitmap", v, x, y, state.screen)
    bmp = load_bmp(v)

    if state.mode == 1:
        x, y = state.gorigin
    else:
        x, y = scale_point(x, y)

    state.screen.blit(bmp, [x, y])
    pygame.display.flip()
コード例 #7
0
def run_mask(m, e, c, x, y, drawn):

    m = resolve_expr(m)
    e = resolve_expr(e)
    c = resolve_expr(c)
    x = resolve_expr(x)
    y = resolve_expr(y)

    print("mask", m, e, c, x, y)
    bmp = load_bmp(m)

    if state.mode == 1:
        x, y = state.gorigin
    else:
        x, y = scale_point(x, y)

    print("mask (updated)", x, y)
    state.masks.append((bmp, x, y, e, "NULL", c))
    if drawn:
        state.screen.blit(bmp, [x, y])
        pygame.display.flip()