Project

General

Profile

Revision 207

maybe working

View differences:

proj.c
24 24
#include "pistol.h"
25 25
#include "nothing.h"
26 26
#include "bullet.h"
27
#include "map.h"
27 28

  
28 29
int main(int argc, char* argv[]) {
29 30

  
......
127 128
        graph_draw();
128 129

  
129 130
        uint32_t refresh_count_value = sys_hz() / REFRESH_RATE;
131

  
132
        basic_sprite_t *bsp_pink = get_map();
133
        sprite_t *pink = sprite_ctor(bsp_pink);
134
        basic_sprite_dtor(bsp_pink);
130 135
    #endif
131 136

  
132 137
    /// loop stuff
......
156 161
                                if (no_interrupts % refresh_count_value == 0) {
157 162
                                    update_movement(shooter1);
158 163
                                    update_scale();
159
                                    ent_set_origin(bullet_get_x(bullet)-ent_get_XLength()/2.0,
160
                                                   bullet_get_y(bullet)-ent_get_YLength()/2.0);
164
                                    ent_set_origin(gunner_get_x(shooter1)-ent_get_XLength()/2.0,
165
                                                   gunner_get_y(shooter1)-ent_get_YLength()/2.0);
161 166

  
162 167
                                    sprite_set_pos(sp_crosshair, get_mouse_X(), get_mouse_Y());
163 168
                                    double angle = get_mouse_angle(shooter1);
164 169
                                    gunner_set_angle(shooter1, angle - M_PI_2);
165 170
                                    graph_clear_screen();
171

  
172
                                    clock_t t = clock();
173

  
174
                                    sprite_draw(pink);
166 175
                                    gunner_draw(shooter2);
167 176
                                    gunner_draw(shooter1);
168 177
                                    bullet_draw(bullet);
178

  
179
                                    t = clock()-t; printf("%d\n", (t*1000)/CLOCKS_PER_SEC);
180

  
169 181
                                    sprite_draw(sp_crosshair);
170 182
                                    graph_draw();
171 183
                                }
......
193 205

  
194 206
    #ifdef TELMO
195 207
        gunner_dtor(shooter1); shooter1 = NULL;
208
        sprite_dtor(pink); pink = NULL;
196 209
    #endif
197 210

  
198 211
    basic_sprite_dtor(bsp_crosshair); bsp_crosshair = NULL;

Also available in: Unified diff