scroll in map problem

Issue #47 new
Benjamin Hoffmann created an issue

Hi ! I'm trying to find the origin of a bug in the scroll in map feature. When I try to draw a scroll on a process' graph, and then put this process in another scroll, this process is not displayed. It's not easy to explain it with words, I've made a little sample :

import "mod_video"
import "mod_key"
import "mod_text"
import "mod_sound"
import "mod_wm"
import "mod_map"
import "mod_draw"
import "mod_say"
import "mod_file"
import "mod_text"
import "mod_multi"
import "mod_mouse"
import "mod_proc"
import "mod_screen"
import "mod_rand"
import "mod_grproc"
import "mod_math"
import "mod_scroll" 
import "mod_timers"
import "mod_mem"

process int main()
begin

    set_mode(500, 500);
    set_fps(60, 0);

    scroll_main();  
    scroll_proc();

    loop

        if(key(_esc))
            exit();
        end

        frame;
    end
end

process scroll_proc()
private
    int graph_id, background_graph;
begin

    background_graph = map_new(10, 10, 32);
    map_clear(0, background_graph, rgb(150,0,0));

    drawing_map(0, background_graph);
    drawing_color(rgb(0, 0, 200));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);

    graph_id = map_new(100, 100, 32, 0);
    map_clear(0, graph_id, rgb(0,0,255));
    // scroll_start(1, 0, background_graph, 0, 0, 15, 0, graph_id); // If you uncomment this line, the graph is not displayed

    graph = graph_id;
    ctype = c_scroll;   
    x = 200;
    y = 200;

    loop
        angle += 1000;  
        scroll[1].x0++;
        frame;
    end
end


process scroll_main()
private
    int graph_id, scroll_angle, background_graph;
begin

    background_graph = map_new(10, 10, 32);
    map_clear(0, background_graph, rgb(150,0,0));

    drawing_map(0, background_graph);
    drawing_color(rgb(200, 0, 0));
    draw_box(0, 0, 4, 4);
    draw_box(5, 5, 10, 10);

    graph_id = map_new(400, 400, 32, 0);

    scroll_start(0, 0, background_graph, 0, 0, 15, 0, graph_id);    
    graph = graph_id;

    loop
        scroll[0].x0 = get_distx(scroll_angle, 50);
        scroll[0].y0 = get_disty(scroll_angle, 50);
        scroll_angle += 1000;
        x = 250;
        y = 250;

        frame;
    end
end

If you try this sample, you can see that the blue square is well displayed. But when you uncomment the start scroll line in the scroll_proc process, this one is no longer displayed. Can you tell me if you got the same bug ?

(And when you press escape to quit the program, you can see that pxtp.exe crashes)

Comments (3)

  1. Log in to comment