#include #ifdef MAP_EDITOR2 #include "../map_editor2/global.h" #include "../map_editor2/elwindows.h" #else #include "global.h" #include "elwindows.h" #endif /* NOTE: This file contains implementations of the following, currently unused, and commented functions: * Look at the end of the file. * * void change_cursor_show(int); */ actor *actor_under_mouse; int object_under_mouse; int thing_under_the_mouse; int current_cursor; int read_mouse_now=0; int elwin_mouse=-1; struct cursors_struct cursors_array[20]; char harvestable_objects[300][80]; char entrable_objects[300][80]; Uint8 *cursors_mem=NULL; int cursors_x_length; int cursors_y_length; void load_cursors() { int f_size,cursors_colors_no,x,y,i; FILE *f = NULL; Uint8 * cursors_mem_bmp; Uint8 *handle_cursors_mem_bmp; Uint8 cur_color; f = my_fopen ("./textures/cursors.bmp", "rb"); if(!f) return; fseek (f, 0, SEEK_END); f_size = ftell (f); //ok, allocate memory for it cursors_mem_bmp = (Uint8 *)calloc ( f_size, sizeof(char) ); handle_cursors_mem_bmp=cursors_mem_bmp; fseek (f, 0, SEEK_SET); fread (cursors_mem_bmp, 1, f_size, f); fclose (f); cursors_mem_bmp += 18; //x length is at offset+18 cursors_x_length = SDL_SwapLE32(*((int *) cursors_mem_bmp)); cursors_mem_bmp += 4; //y length is at offset+22 cursors_y_length = SDL_SwapLE32(*((int *) cursors_mem_bmp)); cursors_mem_bmp += 46 - 22; cursors_colors_no = SDL_SwapLE32(*((int *) cursors_mem_bmp)); cursors_mem_bmp += 54 - 46 + cursors_colors_no * 4; //ok, now transform the bitmap in cursors info if(cursors_mem) free(cursors_mem); cursors_mem = (Uint8 *)calloc ( cursors_x_length*cursors_y_length*2, sizeof(char)); for(y=cursors_y_length-1;y>=0;y--) { i=(cursors_y_length-y-1)*cursors_x_length; for(x=0;x