Project

General

Profile

Revision 171

crosshair and mouse (not working yet)

View differences:

proj.c
29 29
    #include "shooter.h"
30 30
    #include "pistol.xpm"
31 31
#endif
32
#ifdef TELMO
33
    #include "crosshair.h"
34
#endif
32 35

  
33 36
int main(int argc, char* argv[]) {
34 37

  
......
78 81
        sprite_dtor(shooter1);
79 82
    #endif
80 83

  
84
    #ifdef TELMO
85
    sprite_t *crosshair = get_crosshair();
86
    graph_clear_screen();
87
    sprite_draw(crosshair);
88
    graph_draw();
89
    #endif
90

  
81 91
    /// loop stuff
82 92
    int ipc_status;
83 93
    message msg;
......
100 110
                        if (msg.m_notify.interrupts & n) {
101 111
                            interrupt_handler(i);
102 112
                            if ((scancode[0]) == ESC_BREAK_CODE) good = 0;
113
                            #ifdef TELMO
114
                            if (counter_mouse_ih >= 3) {
115
                                struct packet pp = mouse_parse_packet(packet_mouse_ih);
116
                                update_mouse_position(&pp);
117
                                sprite_set_pos(crosshair, get_mouse_X(), get_mouse_Y());
118
                                graph_clear_screen();
119
                                sprite_draw(crosshair);
120
                                graph_draw();
121
                            }
122
                            #endif
103 123
                        }
104 124
                    }
105 125

  

Also available in: Unified diff