コード例 #1
0
ファイル: tile_inspector.c プロジェクト: MaikelS11/OpenRCT2
static void window_tile_inspector_tool_abort()
{
	rct_window *w;
	short widgetIndex, x, y;
	window_tool_get_registers(w, widgetIndex, x, y);
	window_close(w);
}
コード例 #2
0
ファイル: tile_inspector.c プロジェクト: MaikelS11/OpenRCT2
static void window_tile_inspector_tool_down()
{
	short widgetIndex;
	rct_window* w;
	short x, y;
	int direction;

	window_tool_get_registers(w, widgetIndex, x, y);
	screen_pos_to_map_pos(&x, &y, &direction);

	if (x == (short)0x8000) {
		return;
	}

	window_tile_inspector_tile_x = x >> 5;
	window_tile_inspector_tile_y = y >> 5;

	rct_map_element *element = map_get_first_element_at(window_tile_inspector_tile_x, window_tile_inspector_tile_y);
	int numItems = 0;
	do {
		numItems++;
	} while (!map_element_is_last_for_tile(element++));

	window_tile_inspector_item_count = numItems;

	w->scrolls[0].v_top = 0;
	window_invalidate(w);
}
コード例 #3
0
ファイル: tile_inspector.c プロジェクト: MaikelS11/OpenRCT2
static void window_tile_inspector_tool_update()
{
	short widgetIndex;
	rct_window *w;
	short x, y;
	int direction;

	window_tool_get_registers(w, widgetIndex, x, y);
	map_invalidate_selection_rect();
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) &= ~(1 << 0);
	screen_pos_to_map_pos(&x, &y, &direction);

	if (x == (short)0x8000) {
		return;
	}

	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) |= (1 << 0);
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_X, sint16) = x;
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_A_Y, sint16) = y;
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_X, sint16) = x;
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_B_Y, sint16) = y;
	RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_TYPE, uint16) = 4;

	map_invalidate_selection_rect();

}
コード例 #4
0
ファイル: window_footpath.c プロジェクト: hexdec/OpenRCT2
/**
 *
 *  rct2: 0x006A8066
 */
static void window_footpath_toolup()
{
    short x, y;
    short widgetIndex;
    rct_window *w;

    window_tool_get_registers(w, widgetIndex, x, y);

    if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) {
        RCT2_CALLPROC_X(0x006A8380, x, y, 0, 0, (int)w, 0, 0);
    }
}
コード例 #5
0
ファイル: window_footpath.c プロジェクト: hexdec/OpenRCT2
/**
 *
 *  rct2: 0x006A8047
 */
static void window_footpath_tooldown()
{
    short x, y;
    short widgetIndex;
    rct_window *w;

    window_tool_get_registers(w, widgetIndex, x, y);

    if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) {
        window_footpath_place_path_at_point(x, y);
    } else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) {
        RCT2_CALLPROC_X(0x006A840F, x, y, 0, 0, (int)w, 0, 0);
    }
}