diff --git a/ediv/CHANGE_LOG.txt b/ediv/CHANGE_LOG.txt index cf31b16..84f1305 100644 --- a/ediv/CHANGE_LOG.txt +++ b/ediv/CHANGE_LOG.txt @@ -1,3 +1,8 @@ +6/10/2002 +--------- + * Añadida estructura mouse en la input.dll. Lo malo es que peta al hacer + el blit :P supongo que no uso bien fp->Dibuja. (Er_Makina) + 28/9/2002 --------- * El título por defecto de la ventana del juego compilado es el nombre in- diff --git a/ediv/bin/test_mouse.prg b/ediv/bin/test_mouse.prg new file mode 100644 index 0000000..f3a8ac6 --- /dev/null +++ b/ediv/bin/test_mouse.prg @@ -0,0 +1,11 @@ +program test_mouse; +private + mi_mapa; + +begin + mi_mapa=load_bmp("hola.bmp"); + mouse.graph=mi_mapa; + loop + frame; + end +end diff --git a/ediv/src/dlls/dlls.suo b/ediv/src/dlls/dlls.suo index 181b14b..fc792bf 100644 Binary files a/ediv/src/dlls/dlls.suo and b/ediv/src/dlls/dlls.suo differ diff --git a/ediv/src/dlls/graphics/main.c b/ediv/src/dlls/graphics/main.c index 92e1d71..fc7b1f8 100644 --- a/ediv/src/dlls/graphics/main.c +++ b/ediv/src/dlls/graphics/main.c @@ -1326,7 +1326,7 @@ int eDIV_FADE(FUNCTION_PARAMS2) return 1 ; } - +#include //*********************************** Entry Points **********************************************// FILE * fichero ; @@ -1465,6 +1465,7 @@ void frame(FUNCTION_PARAMS) //if ( last_map >= 2 ) // Mapa[2]->flags |= SDL_SRCALPHA ; + assert(0); // Volcamos la pila de bliteos for ( i = 0 ; i <= last_blit ; i++ ) { diff --git a/ediv/src/dlls/input/input.c b/ediv/src/dlls/input/input.c index 3fb938f..13f8275 100644 --- a/ediv/src/dlls/input/input.c +++ b/ediv/src/dlls/input/input.c @@ -143,6 +143,7 @@ Uint8 *keys ; +Uint8 mbuttons; int SDLtoDIV[1024] ; @@ -264,6 +265,27 @@ int ExportaFuncs(EXPORTAFUNCS_PARAMS) _KEY(_c_del) ; FUNCTION("key",1,eDiv_Key) ; + + GLOBAL_STRUCT("mouse",0); + _INT("x",0); /* Coordenada x */ + _INT("y",0); /* Coordenada y */ + _INT("graph",0); /* Gráfico */ + _INT("file",0); /* FPG */ + _INT("z",-512); /* Profundidad (TODO) */ + _INT("angle",0); /* Ángulo (TODO) */ + _INT("size",100); /* Tamaño (TODO) */ + _INT("flags",0); /* Banderas (TODO) */ + _INT("region",0); /* Región (TODO) */ + _INT("left",0); /* Botón izquierdo */ + _INT("middle",0); /* Botón central o de ruedecilla */ + _INT("right",0); /* Botón derecho */ + _INT("wheelup",0); /* Ruedecilla arriba (NUEVO) */ + _INT("wheeldown",0); /* Ruedecilla abajo (NUEVO) */ + _INT("cursor",0); /* Emulación con teclas de cursor (TODO) */ + _INT("speed",0); /* Velocidad del ratón (TODO) */ + _INT("transparency",0); /* Transparencia (NUEVO) (TODO) */ + END_STRUCT; + ENTRYPOINT(first_load) ; ENTRYPOINT(frame) ; @@ -504,9 +526,38 @@ void first_load(FUNCTION_PARAMS) void frame(FUNCTION_PARAMS) { int numkeys ; + int _mouse=globalptr("mouse"); + SDL_Rect srcrect,dstrect; keys = SDL_GetKeyState(&numkeys ) ; + + mbuttons = SDL_GetMouseState(&fp->mem[_mouse],&fp->mem[_mouse+1]); + /* Ponemos los 5 botones a 0 */ + memset(&fp->mem[_mouse+9],0,5*4); + + if(mbuttons&SDL_BUTTON(1)) + fp->mem[_mouse+9]=1; + + if(mbuttons&SDL_BUTTON(2)) + fp->mem[_mouse+10]=1; + + if(mbuttons&SDL_BUTTON(3)) + fp->mem[_mouse+11]=1; + + if(mbuttons&SDL_BUTTON(4)) /* podria no funcionar ¿necesario sdl_event? */ + fp->mem[_mouse+12]=1; + + if(mbuttons&SDL_BUTTON(5)) /* podria no funcionar ¿necesario sdl_event? */ + fp->mem[_mouse+13]=1; + + srcrect.x=srcrect.y=srcrect.w=srcrect.h=dstrect.w=dstrect.h=0; + dstrect.x=fp->mem[_mouse]; + dstrect.y=fp->mem[_mouse+1]; + + // TODO: añadir chequeo de error si no existe file o mapa + fp->Dibuja(fp->files[fp->mem[_mouse+3]].mapa[fp->mem[_mouse+2]].Surface,srcrect,dstrect,fp->mem[_mouse+4],0); + //FILE* fichero ; //fichero = fopen( "input.txt" , "w+" ) ; //for ( i = 0 ; i < 256 ; i++ ) diff --git a/ediv/src/ediv/parser.c b/ediv/src/ediv/parser.c index 0d0b890..e429542 100644 --- a/ediv/src/ediv/parser.c +++ b/ediv/src/ediv/parser.c @@ -326,7 +326,6 @@ void sintactico(void) hacer_strfix=1; optimizar=1;*/ - printf("** CHECKPOINT 1\n"); if(case_sensitive) { memcpy(lower+129,"üéâäàåçêëèïîìäåéææôöòûùÿöü¢£¥áíóú",35); memcpy(lower+'A',"ABCDEFGHIJKLMNOPQRSTUVWXYZ",26); diff --git a/ediv/src/visual c/ediv_ws.suo b/ediv/src/visual c/ediv_ws.suo index d46e351..194fcd2 100644 Binary files a/ediv/src/visual c/ediv_ws.suo and b/ediv/src/visual c/ediv_ws.suo differ