Main Page Data Structures File List Globals
mouse_input.c File ReferenceWorks out which line of text the user clicked.
More...
#include "white_interface.h"
Go to the source code of this file.
Detailed Description
Works out which line of text the user clicked.
This block is a cut down version of the process_input part of the input module. It looks at where the user clicked and determines which line of text they selected on the lobby screen. Using this information, start_game.c can work out which player they chose as their opponent.
Definition in file mouse_input.c.
Function Documentation
|
VCC Init function.
This function runs when the VCC simulation is first started.
Definition at line 19 of file mouse_input.c.
|
|
VCC Run function.
This runs whenever a message arrives at the mouse_in port.
Definition at line 29 of file mouse_input.c.
00030 {
00031 int y, grid_line, screen_line;
00032 mouse_drag input;
00033
00034
00035
00036 if (mouse_in_Enabled())
00037 {
00038 input = *mouse_in_Value();
00039 y = input.down_y;
00040
00041
00042
00043
00044
00045
00046
00047 y = y - 80;
00048
00049
00050
00051 grid_line = y / 24;
00052
00053
00054
00055
00056 screen_line = grid_line - 8;
00057 screen_line = -screen_line;
00058
00059
00060
00061
00062 if (screen_line > 0)
00063 {
00064 line_out_Post(screen_line);
00065 }
00066 }
00067 }
|
|