From f93e595c8dc03652e4730842e69c1927b54314ae Mon Sep 17 00:00:00 2001 From: h3ndrik Date: Thu, 22 Mar 2012 01:56:41 +0100 Subject: [PATCH] all ready and working. inkl leds --- Makefile | 2 + Makefile~ | 9 - Pfadfinder.txt~ | 47 --- Pfadfinder2.txt~ | 48 --- hid-example | Bin 9426 -> 0 bytes hid-example.c~ | 182 --------- sdljpd | Bin 40623 -> 40675 bytes sdljpd.c | 9 + sdljpd.c~ | 894 ------------------------------------------ set_led.c | 10 +- set_led.c~ | 67 ---- tastaturbelegung.txt~ | 15 - 12 files changed, 16 insertions(+), 1267 deletions(-) delete mode 100755 Makefile~ delete mode 100644 Pfadfinder.txt~ delete mode 100644 Pfadfinder2.txt~ delete mode 100755 hid-example delete mode 100644 hid-example.c~ delete mode 100644 sdljpd.c~ delete mode 100644 set_led.c~ delete mode 100644 tastaturbelegung.txt~ diff --git a/Makefile b/Makefile index 9231929..b3b582f 100755 --- a/Makefile +++ b/Makefile @@ -2,8 +2,10 @@ CC = gcc -Wall -ansi all: $(CC) sdljpd.c -o sdljpd -lm -lSDL_image -lSDL_ttf `sdl-config --cflags --libs` -lSDL_mixer -g + $(CC) set_led.c -o set_led clean: @echo Cleaning up... @rm sdljpd + @rm set_led @echo Done. diff --git a/Makefile~ b/Makefile~ deleted file mode 100755 index 114c10f..0000000 --- a/Makefile~ +++ /dev/null @@ -1,9 +0,0 @@ -CC = gcc -Wall -ansi - -all: - $(CC) sdljpd.c -o sdljpd -lm -lSDL_image -lSDL_ttf `sdl-config --cflags --libs` -lSDL_mixer -g -B/usr/lib/x86_64-linux-gnu -I/usr/include/x86_64-linux-gnu - -clean: - @echo Cleaning up... - @rm sdljpd - @echo Done. diff --git a/Pfadfinder.txt~ b/Pfadfinder.txt~ deleted file mode 100644 index 0a124ff..0000000 --- a/Pfadfinder.txt~ +++ /dev/null @@ -1,47 +0,0 @@ -Topic: G-Phasen -Frage: Diese Fuenf sollen dem Gruppenleiter dabei helfen, Gruppenprozesse besser zu verstehen und seine eigene Arbeit besser reflektieren zu koennen -Antwort: Was sind die Gruppenphasen? -Frage: In dieser Phase muss man Kinder ihre eigene Rolle in der Gruppe finden lassen. Der Leiter muss auf Fairness achten -Antwort: Was ist die Machtkampfphase? -Frage: In dieser Phase muessen Aktionen gut vorbereitet werden und jeder muss ohne Hemmungen teilnehmen koennen. Ausserdem muss man einseitige Angebote vermeiden -Antwort: Was ist die Kennenlernphase / Orientierungsphase? -Frage: In dieser Phase koennen sich die Leiter etwas ausruhen und die Fruechte ihrer Arbeit geniessen. -Antwort: Was ist die Differenzierungsphase? -Frage: In dieser Phase kann man individuelle Faehigkeiten foerdern -Antwort: Was ist die Vertrautheitsphase? - -Topic: Gruppenstd -Frage: Sie sind ein unerschoepflicher Pool Ideen und Ueberlegungen -Antwort: Was sind Gruppenkinder? -Frage: Dieser Bogen bringt jeder Gruppenstunde einen Hoehepunkt -Antwort: Was ist der Spannungsbogen? -Frage: Diese Teile der regelmaessigen Aufgaben der Gruppenleiters machen ungefaehr gleich viel Zeit aus wie die Durchfuehrung der Gruppenstunden -Antwort: Was sind Reflexion und Planung? -Frage: Dieses Pfadfinderische Grundprinzip besagt, dass wir uns den Beduerfnissen der Kinder anpassen -Antwort: Was ist "Look at the boy/girl"? -Frage: Es ist die Grundlage fuer kreative und abwechslungsreiche Arbeit -Antwort: Was ist das Kennenlernen von neuen Ideen und Inhalten? - -Topic: Stil/Kultur -Frage: Hierbei suchen sich die Kinder gute Vorsaetze, die ihnen etwas Bedeuten -Antwort: Was ist das Versprechen? -Frage: Es ist der klare Anfang einer Gruppenstunde und kann helfen, Leute zu Puenktlichkeit anzuregen -Antwort: Was ist ein Einstiegsritual? -Frage: Dieses Spiel ist gut geeignet fuer das Ende einer Gruppenstunde -Antwort: ... -Frage: Sie ist das wichtigste Instrument pfadfinderischen Handelns, muss aber viel geuebt und praktiziert werden, um ihre Macht voll entfalten zu koennen -Antwort: Was ist Reflexion? -Frage: In einer kultivierten Gruppe sorgen diese dafuer, dass Diskussionen zielfuehrend und fruchtbar sind -Antwort: Was sind Diskussionsregeln und -methoden? - -Topic: Allgemeinw -Frage: Es ist die Bezeichnung für ein internationales Pfadfinder-Grosslager -Antwort: Was ist ein Jamboree? -Frage: So nennt man eine (Klein)gruppe aus 6-7 Kindern -Antwort: Was ist eine Sippe? -Frage: Dort ist das Bundeszentrum der DPSG -Antwort: Was ist in Westernohe? -Frage: So viele Seitenstangen braucht eine Jurte -Antwort: Was sind 12? -Frage: Das ist unsere Stammesnummer -Antwort: Was ist 10/07/10? diff --git a/Pfadfinder2.txt~ b/Pfadfinder2.txt~ deleted file mode 100644 index 925e1bf..0000000 --- a/Pfadfinder2.txt~ +++ /dev/null @@ -1,48 +0,0 @@ -Topic: Konflikte -Frage: Eine Meinungsverschiedenheit, die z.B. durch unterschiedliche Werte und Ziele, unklare Strukturen oder Missverstaendnisse zustandekommt -Antwort: Was ist ein Konflikt? -Frage: Die Bereitschaft im Konflikt, sachlich und fair gegenueher dem Anderen zu bleiben -Antwort: Was ist Konfliktfaehigkeit? -Frage: Eine Vereinbarung, bei der alle Parteien von ihrer urspruenglichen Position abruecken -Antwort: Was ist ein Kompromiss? -Frage: Wer darin ist, sollte es sich eingestehen, und dem anderen entgegenkommen -Antwort: Was ist Unrecht -Frage: Es ist aus den Schriftzeichen fuer Gefahr und Chance zusammengesetzt -Antwort: Was ist das chinesische Zeichen fuer Krise? - -Topic: Motivation -Frage: Dieses Spiel foerdert Motivation der Gruppe -Antwort: ... -Frage: Mit diesem paedagogischen Grundprinzip gibt B.P. dem praktischen Lernen den Vorzug gegenueber dem theoretischen Lernen -Antwort: Was ist Learning by doing -Frage: Kann helfen, wenn die Luft raus ist, und macht aus einer guten Aktion eine hervorragende Aktion -Antwort: Was ist Animation? -Frage: Diese Form der Motivation nutzt sich schnell ab -Antwort: Was ist Belohnung? -Frage: Dies ist der Koenigsweg der Motivation -Antwort: Was ist Begeisterung? - -Topic: Partizipation -Frage: Dadurch werden Kinder z.B. bei einer Stammesversammlung zu muendigen Mit-Entscheidern und bleiben nicht bloss Stimmvieh -Antwort: Was ist Partizipation/Mitbestimmung? -Frage: Dieses Erziehungsprinzip von B.P. stellt die Eigenstaendigkeit der Kinder in den Vordergrund -Antwort: Was ist "Paddle your own canoe"? -Frage: Im Gegenzatz zum Rahmen, in der die Mitbestimmung stattfindet, entscheidet der Leiter hier nicht -Antwort: Was sind Inhalte/Thema? -Frage: Sie muss gehalten werden, damit Kinder weder ueberfordert, noch in ihrer Mitbestimmung gehindert werden -Antwort: Was ist Balance? -Frage: Diese Frage ueberfordert Kinder bei der Mitbestimmung. Sie ist selten zielfuehrend -Antwort: Was ist "Was wollt ihr denn machen?"? - -Topic: Geschichte -Frage: Es war die erste Jahresaktion der DPSG -Antwort: Was ist "Flinke Haende, flinke Fuesse"? -Frage: Der Kampf um diese Stadt machte BiPi zum Helden -Antwort: Was ist Mafeking (Suedafrika)? -Frage: Es ist ein Pfadfinderzentrum in der Naehe von London -Antwort: Was ist der Gilwell-Park? -Frage: Hier wurde die DPSG gegründet -Antwort: Was ist Altenberg? -Frage: Es ist der letzte Aufruf BiPis in seinem Abschiedsbrief -Antwort: Was ist "Versucht die Welt ein bisschen besser zurueckzulassen, als ihr sie vorgefunden habt."? - diff --git a/hid-example b/hid-example deleted file mode 100755 index 2ee8202df7efc560710e1c64236ce656e7e36fb5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9426 zcmeHNeQaCR6~D2QG;Px)4TXM?t%fC#GQ~}yt>5PVCfXj_ujc zZGu|0EG^^7gk=&)WvaAj(?lnj=pO3&5H`RJ~X~wLn)mwLsz(qN{b75hc4j!H)M&$iIqEoGXKYjf zp1tJwA<7EjHy?i3<~;aO5ktpW^o6?Ue-8X;UCo6$7SyF52fpT|3iL{6(Y+=M-jxNv zE(>0l1#irP-(P;tPQqdJ!(WJ%JG0 z6%D99w$a_Vp-#Ecd82a;L}Ro3=|~RDCax{I9plRaFx55|1Psfmh3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5b#|xFw~qgIp^x9ou<)}tpdB3Nkm;gk!5;?PVbau@LtKBByxr*u1`VH*S!Yy@ zsc|^b?u75bb*)WX6nA4wD|}&AlzJ1lsm>tshLs(`aEB+T@b_lL6YpX0P8uo&o4z%=s60vydMSn<2%=PYvMs8LXmAZ$ke}Z&u`A=gkoRRBwjF zr04^L=gd~I<%_;mYzW`-4+VP!Xz diff --git a/hid-example.c~ b/hid-example.c~ deleted file mode 100644 index 8764a67..0000000 --- a/hid-example.c~ +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Hidraw Userspace Example - * - * Copyright (c) 2010 Alan Ott - * Copyright (c) 2010 Signal 11 Software - * - * The code may be used by anyone for any purpose, - * and can serve as a starting point for developing - * applications using hidraw. - */ - -/* Linux */ -#include -#include -#include - -/* - * Ugly hack to work around failing compilation on systems that don't - * yet populate new version of hidraw.h to userspace. - * - * If you need this, please have your distro update the kernel headers. - */ -#ifndef HIDIOCSFEATURE -#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) -#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len) -#endif - -/* Unix */ -#include -#include -#include -#include -#include - -/* C */ -#include -#include -#include -#include - -const char *bus_str(int bus); - -int main(int argc, char **argv) -{ - int fd; - int i, res, desc_size = 0; - char buf[256]; - struct hidraw_report_descriptor rpt_desc; - struct hidraw_devinfo info; - - /* Open the Device with non-blocking reads. In real life, - don't use a hard coded path; use libudev instead. */ - fd = open("/dev/hidraw0", O_RDWR|O_NONBLOCK); - - if (fd < 0) { - perror("Unable to open device"); - return 1; - } - - memset(&rpt_desc, 0x0, sizeof(rpt_desc)); - memset(&info, 0x0, sizeof(info)); - memset(buf, 0x0, sizeof(buf)); - - /* Get Report Descriptor Size */ - res = ioctl(fd, HIDIOCGRDESCSIZE, &desc_size); - if (res < 0) - perror("HIDIOCGRDESCSIZE"); - else - printf("Report Descriptor Size: %d\n", desc_size); - - /* Get Report Descriptor */ - rpt_desc.size = desc_size; - res = ioctl(fd, HIDIOCGRDESC, &rpt_desc); - if (res < 0) { - perror("HIDIOCGRDESC"); - } else { - printf("Report Descriptor:\n"); - for (i = 0; i < rpt_desc.size; i++) - printf("%hhx ", rpt_desc.value[i]); - puts("\n"); - } - - /* Get Raw Name */ - res = ioctl(fd, HIDIOCGRAWNAME(256), buf); - if (res < 0) - perror("HIDIOCGRAWNAME"); - else - printf("Raw Name: %s\n", buf); - - /* Get Physical Location */ - res = ioctl(fd, HIDIOCGRAWPHYS(256), buf); - if (res < 0) - perror("HIDIOCGRAWPHYS"); - else - printf("Raw Phys: %s\n", buf); - - /* Get Raw Info */ - res = ioctl(fd, HIDIOCGRAWINFO, &info); - if (res < 0) { - perror("HIDIOCGRAWINFO"); - } else { - printf("Raw Info:\n"); - printf("\tbustype: %d (%s)\n", - info.bustype, bus_str(info.bustype)); - printf("\tvendor: 0x%04hx\n", info.vendor); - printf("\tproduct: 0x%04hx\n", info.product); - } - - /* Set Feature */ -// buf[0] = 0x9; /* Report Number */ -// buf[1] = 0xff; -// buf[2] = 0xff; -// buf[3] = 0xff; -// res = ioctl(fd, HIDIOCSFEATURE(4), buf); -// if (res < 0) -// perror("HIDIOCSFEATURE"); -// else -// printf("ioctl HIDIOCGFEATURE returned: %d\n", res); - - /* Get Feature */ -// buf[0] = 0x9; /* Report Number */ -// res = ioctl(fd, HIDIOCGFEATURE(256), buf); -// if (res < 0) { -// perror("HIDIOCGFEATURE"); -// } else { -// printf("ioctl HIDIOCGFEATURE returned: %d\n", res); -// printf("Report data (not containing the report number):\n\t"); -// for (i = 0; i < res; i++) -// printf("%hhx ", buf[i]); -// puts("\n"); -// } - - /* Send a Report to the Device */ - buf[0] = 0x0; /* Report Number */ - buf[1] = 0x00; - buf[2] = 0x01; - buf[3] = 0x00; - buf[4] = 0x00; - buf[5] = 0x01; - res = write(fd, buf, 6); - if (res < 0) { - printf("Error: %d\n", errno); - perror("write"); - } else { - printf("write() wrote %d bytes\n", res); - } - - /* Get a report from the device */ - res = read(fd, buf, 16); - if (res < 0) { - perror("read"); - } else { - printf("read() read %d bytes:\n\t", res); - for (i = 0; i < res; i++) - printf("%hhx ", buf[i]); - puts("\n"); - } - close(fd); - return 0; -} - -const char * -bus_str(int bus) -{ - switch (bus) { - case BUS_USB: - return "USB"; - break; - case BUS_HIL: - return "HIL"; - break; - case BUS_BLUETOOTH: - return "Bluetooth"; - break; - case BUS_VIRTUAL: - return "Virtual"; - break; - default: - return "Other"; - break; - } -} diff --git a/sdljpd b/sdljpd index fe0aba7b536b3857b595965be7bcdb92034bca1b..4ab58203ed8b1bbdc07bc66245f03adcd75c4c22 100755 GIT binary patch delta 10346 zcmZu%3tUuH{=avIi=g1}8U|2dc!-MfR1^hs5GinL)7>nsEPSD*7OSFb|MaRrGTzj| zW9nub>h@aKTHM)H&;opp+2+dj*wkFIwZP8D@ogG2EExc;vUYEBJQa<-54h22_)qiN_lLjyhD9(^XLEm zX7bsXFaDN!_@n=une*U3w`BK+W-jg^+zGgQ;10#z6Zb&eHry$=vv7~Vos8Re*+Hb^ zjx`wl&=0~r+`xU&$KehZI87P_VhHYd!H|-SJ{x^1?g0iKiawLI$bDFZIU|3h!KE%7 zcSIK)2s+ZhQRqW(%ebw$O}NdtW7tZwP3;3}7;d@}MJENI&%r&|z+vb!aHkoVisO$v z8n?yZ^+r!#$rnW;dG!&yEcuP=MLZfjWjwaO6~a`0?x4&{a`YHSJbDZLD~EZ7#^wTuDd zgj9iag!}Dan^}%`9|;*D%jxWPXs%jcAmp?fXfk|PQN`r|?+k?SeoxIZteB#T!vTkU z@{a5c>2|53|3^Rm=?J1;`mF#v;dne@I;r#t9FHYTr=0HKSRF+SIu-N`&d4H6Czo#LIE65s zSb7M@353%KOB}}#PAA-Ui?0E~bh7BJz?t6`J6oP8a(-D<@papThl)MTCBqz2k>@}e z?>wi%Qyh|aGYqe}T(sqiG$oU5vc50Rp#d|M`9p@5Nwo8bcf%a9Hbu-<@C0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Pj$|T2V;n- z6b}(|<6hPI8%kxUA%9kNZi7G`=Dj|tB3w@O4x6@CmMhrt>0W!ph`HOh^P72I#Bj+J zCWns+H}~{znvrECg#9cx>u$_rTe zs{FX7NEcUYqAiV9##VuQI@-n2X*#LU7PGch`H|JeUaV$6tQs7-z(5Pw(A9%O`?T5E z(JR@i)%lUZZ9aq@f=;!uGpn(Z)T~T)=ZAh@QiGDFh94rh^P`%ITpZzGc*I>2x5t2c zia1wV$J(IO<@Y8x+$B*vN`=jiQtz<3HL~2~ZL4pQ<#e`c?O=H#JG6F$EVCbQAIFBS z8xi>tl^R+DTeWU*TPswrakZG2Ro&pz9@$%K=p_R-U(JwvXb$l#_Q zpTn{%J`#O@>s?`g9p`+p4V!)<&c43psi(bkJ*#A8PcpC(4lkgHwEjYqg z*+NJU8q%U$Y+HG5AMpFI@VR!5N0FqPhG&Nn7mzoF6+Uhs zZO6M7jhDU}pytQCQcDG&ywUFtsCoDuKe00O`{3IMYQa$qB5!gzzfWLokK2={8y -#include -#include -#include /*include datei die das Komandozeilen handling vereinfacht*/ -#include -#include -#include - -#include "SDL.h" -#include "SDL_image.h" -#include "SDL_ttf.h" -#include "SDL_mixer.h" -#include "SDL_haptic.h" - -/* Define our booleans */ - #define TRUE 1 - #define FALSE 0 - -#define RENDER_MODE 2 //0=solid 1=shaded 2=blended - -/* screen width, height, and bit depth */ -/** \brief Die Bildschirmbreite fuer den Fenstermodus */ -#define SCREEN_WIDTH 1024 -/** \brief Die Bildschirmhohe fuer den Fenstermodus */ -#define SCREEN_HEIGHT 768 -/** \brief Farbtiefe des Bildschirmes */ -#define SCREEN_BPP 24 - -/* make prototype of getopt because of "implicit declaration" */ -int getopt(int argc, char * const argv[], const char *optstring); -extern char *optarg; -extern int optind, opterr, optopt; - -char xpfp[1000]; -char buf[10000]; -char pl1[1000]; -char pl2[1000]; -char pl3[1000]; -char blub[1000]; - -int enp = FALSE; -int inp = FALSE; -signed int score[3] ={0,0,0}; -int scorebuf; -int plselect = 0; -int lockbz = FALSE; -int xpos = 0, ypos = 0; -int solved[5][5] = {{0,0,0,0,0}, - {0,0,0,0,0}, - {0,0,0,0,0}, - {0,0,0,0,0}, - {0,0,0,0,0}}; -int pkt[5] = {100,200,300,400,500}; -int artype; -int countxa = 0; -int countya = 0; -int countxf = 0; -int countyf = 0; -int countxt = 0; - -FILE *file; - -typedef struct s_block{ -char frage[10000]; -char antwort[1000]; -} t_block; - -typedef struct { -char katname[1000]; -} t_kat; - -t_block myblock[5][5]; -t_kat mykat[5]; - -Mix_Music *music = NULL; - -Mix_Music *buzz_sound = NULL; - - -/** \brief This is our SDL surface -* -* Unser Haupt SDL Surface -*/ -SDL_Surface *surface; /*Display Surface*/ -SDL_Surface *kachel; /*hintergrund fuer die Fragefelder*/ -SDL_Surface *bgrnd; /*makriert blockierte Felder */ -SDL_Surface *nfield; /*Score, Namensfekder der Spieler*/ -SDL_Surface *plac; /*kenzeichnung acktiver Spierler*/ -SDL_Surface *afr; /*kenzeichnung des aktives fragen feldes */ -SDL_Surface *text; -SDL_Surface *panel; - -SDL_Rect drect; - -SDL_Color color={255,125,0}; - -TTF_Font *font; - -SDL_Joystick *joystick; - -/** \brief Hier Raeumen wir nach Programablauf auf. -* -* \param returnCode Der Zurueckzugebende Return Code -* \return Gibt den Uebergebenen Code aus -*/ -/* function to release/destroy our resources and restoring the old desktop */ -void Quit( int returnCode ) -{ - Mix_HaltMusic(); - Mix_FreeMusic(music); - music = NULL; - - SDL_JoystickClose(joystick); - - SDL_FreeSurface(panel); - SDL_FreeSurface(text); - SDL_FreeSurface(afr); - SDL_FreeSurface(plac); - SDL_FreeSurface(nfield); - SDL_FreeSurface(kachel); - SDL_FreeSurface(bgrnd); - SDL_FreeSurface(surface); - - TTF_CloseFont(font); - - TTF_Quit(); - - /* clean up the window */ - SDL_Quit( ); - - /*fclose(file);*/ - - - printf("\033[33m sdljpd:\033[m So long, and thanks for all the fish <;))>< \n"); - - /* and exit appropriately */ - exit( returnCode ); -} - -void musicDone(void){ -Mix_HaltMusic(); - Mix_FreeMusic(music); - music = NULL; - music = Mix_LoadMUS("bgmusic-loop.wav"); - Mix_PlayMusic(music, -1); -} - -void music_init(void){ -if(music == NULL) { -music = Mix_LoadMUS("bgmusic-intro.wav"); -Mix_PlayMusic(music, 0); -Mix_HookMusicFinished(musicDone); -} - -} - -void filefill(void) -{ - - if(artype == 1) - { - strcpy(mykat[countxt].katname,blub); - countxt ++; - blub[0] = '\0'; - - } - - if(artype == 2) - { - strcpy(myblock[countxf][countyf].frage,blub); - countyf ++; - blub[0] = '\0'; - - if(countyf >4) - { - countyf = 0; - countxf ++; - } - } - - if(artype == 3) - { - strcpy(myblock[countxa][countya].antwort,blub); - countya ++; - blub[0] = '\0'; - - if(countya >4) - { - countya = 0; - countxa ++; - } - } - -} - -void filefoo (void) -{ - - char ch[100]; - char ach; - - file = fopen(xpfp,"r"); - - if(file == NULL) - { - fprintf(stderr, "Folgende Datei konnte nicht geladen werden:%s\n",xpfp ); - } - - - while (fscanf(file,"%s",ch) ) - { - - if (strcmp(ch,"Topic:") == 0){ - filefill(); - artype = 1; - continue; - } - - if (strcmp(ch,"Frage:")== 0){ - filefill(); - artype = 2; - continue; - } - - if (strcmp(ch,"Antwort:") == 0){ - filefill(); - artype = 3; - continue; - } - - strcat(blub, ch); - strcat(blub, " "); - - if (fscanf(file,"%c",&ach) == EOF){ - filefill(); - break; - } - } - -fclose(file); - -} - -void loadtex( void ) -{ - kachel = IMG_Load("kachel100.jpg"); - - if (kachel == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } - - bgrnd = IMG_Load("bgrnd100.jpg"); - - if (bgrnd == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } - - nfield = IMG_Load("nfield.jpg"); - - if (nfield == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } - - - plac = IMG_Load("sp.jpg"); - - if (plac == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } - - afr = IMG_Load("aq.jpg"); - - if (afr == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } - - panel = IMG_Load("panel1.jpg"); - - if (panel == NULL) - { - fprintf(stderr, "Das Bild konnte nicht geladen werden:%s\n", SDL_GetError()); - exit(-1); - } -} - -void get_buz (void) -{ - int i,n; - - SDL_JoystickUpdate (); - - if(lockbz == FALSE ) - { - for ( i=0; i < SDL_JoystickNumButtons ( joystick ); ++i ) - { - n = SDL_JoystickGetButton ( joystick, i ); - if ( n != 0 ) { - printf ( "found you pressed button %i\n", i ); - if(i == 0) - { - plselect = 0; - lockbz = TRUE; - Mix_PlayMusic(buzz_sound, 0); - } - - if(i == 5) - { - plselect = 1; - lockbz = TRUE; - Mix_PlayMusic(buzz_sound, 0); - } - - if(i == 10) - { - plselect = 2; - lockbz = TRUE; - Mix_PlayMusic(buzz_sound, 0); - } - } - } - } -} - -void draw_sdl (void) -{ - int countx =0; - int county =0; - - int i=0; - - /* Spielfeld geschlumpfe*/ - drect.w = kachel -> w; - drect.h = kachel -> h; - - SDL_SetAlpha(bgrnd, SDL_SRCALPHA | SDL_RLEACCEL, 128); - SDL_SetAlpha(afr, SDL_SRCALPHA | SDL_RLEACCEL, 128); - SDL_SetAlpha(plac, SDL_SRCALPHA | SDL_RLEACCEL, 128); - - get_buz(); - - SDL_FillRect(surface, NULL, 0); - - for(county=0;county<=4;county++) - { - drect.y = (county*100) + 100; - - for(countx=0;countx<=4;countx++) - { - drect.x = (countx*200) + 65; - - SDL_BlitSurface(kachel, NULL, surface, &drect ); - - if(solved[countx][county] == 0){ - SDL_FreeSurface(text); - sprintf(buf,"%i",pkt[county]); - /*if(pkt[county]==100){buf = "100";} - if(pkt[county]==200){buf = "200";} - if(pkt[county]==300){buf = "300";} - f(pkt[county]==400){buf = "400";} - if(pkt[county]==500){buf = "500";}*/ - text = TTF_RenderText_Blended(font, buf,color); - drect.x = drect.x + 23; - SDL_BlitSurface(text,NULL,surface,&drect); - } - - if(solved[countx][county] >=1){ - SDL_BlitSurface(bgrnd, NULL, surface, &drect ); - if(solved[countx][county] == 1) strcpy(buf,pl1); - if(solved[countx][county] == 2) strcpy(buf,pl2); - if(solved[countx][county] == 3) strcpy(buf,pl3); - - drect.x = (countx*200) + 65; - drect.y = drect.y + 23; - - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, buf , color); - drect.w = text -> w; - drect.h = text -> h; - SDL_BlitSurface(text,NULL,surface,&drect); - - drect.y = drect.y - 23; - } - - - } - - for(countx=0;countx<=5;countx++) - { - drect.x = (countx*200) + 65; - drect.y = 45; - strcpy(buf,mykat[countx].katname); - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, buf , color); - SDL_BlitSurface(text,NULL,surface,&drect); - } - - /* The Code for the Panle Drawing goes here */ - if(enp == TRUE){ - drect.w = panel -> w; - drect.h = panel -> h; - drect.x = 185; - drect.y = 100; - SDL_BlitSurface(panel, NULL, surface, &drect ); - drect.x = drect.x + 23; - drect.y = drect.y + 23; - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, "Antwort:" , color); - SDL_BlitSurface(text,NULL,surface,&drect); - - for (i=0; i<=100; i++) - buf[i] = 0; - for (i=0; i w; - drect.h = panel -> h; - drect.x = 185; - drect.y = 100; - SDL_BlitSurface(panel, NULL, surface, &drect); - drect.x = drect.x + 23; - drect.y = drect.y + 23; - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, "Frage:" , color); - SDL_BlitSurface(text,NULL,surface,&drect); - - for (i=0; i<=100; i++) - buf[i] = 0; - for (i=0; i h; - drect.h = nfield -> w; - drect.y = 650; - - for(countx=0;countx<=2;countx++) - { - drect.x = (countx*365) + 50; - SDL_BlitSurface(nfield, NULL, surface, &drect ); - } - - drect.x = (plselect*365) + 50; - SDL_BlitSurface(plac,NULL,surface,&drect); - - drect.y = drect.y + 23; - - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, pl1,color); - drect.x = 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, pl2,color); - drect.x = (365) + 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - SDL_FreeSurface(text); - text = TTF_RenderText_Blended(font, pl3,color); - drect.x = (2*365) + 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - drect.y = drect.y + 30; - - SDL_FreeSurface(text); - scorebuf = score[0]; - sprintf(buf,"%i",scorebuf); - text = TTF_RenderText_Blended(font,buf,color); - drect.x = 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - SDL_FreeSurface(text); - scorebuf = score[1]; - sprintf(buf,"%i",scorebuf); - text = TTF_RenderText_Blended(font,buf,color); - drect.x = (365) + 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - SDL_FreeSurface(text); - scorebuf = score[2]; - sprintf(buf,"%i",scorebuf); - text = TTF_RenderText_Blended(font,buf,color); - drect.x = (2*365) + 65; - SDL_BlitSurface(text,NULL,surface,&drect); - - SDL_Flip(surface); -} - - -int main( int argc, char **argv ) -{ - /** \brief Zählt argc*/ - int option; - - /** \brief Flags zur Übergabe an den Video mode */ - int videoFlags; - - /** \brief Variable der Hauptschleife */ - int done = FALSE; - - /** \brief sammelt Events */ - SDL_Event event; - - /** \brief Display Informationen */ - const SDL_VideoInfo *videoInfo; - - /** \brief Ist unser Fenster Acti? */ - int isActive = TRUE; - - /** \brief String für den Fenstertitel */ - char *wmcapt ="SdlJPD " ; - - int audio_rate = 22050; - Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */ - int audio_channels = 2; - int audio_buffers = 4096; - - strcpy(pl1,"Jessy"); - strcpy(pl2,"Micha"); - strcpy(pl3,"Pierre"); - - strcpy(xpfp,"level.txt"); - - while (( option = getopt(argc, argv, "hf:a:b:c:")) >= 0) - switch (option) - { - case 'h': { - printf("Usage: %s [Optionen] \n Optionen: \n -h print this help Text \n-f jeopardy file\n",argv[0]); - Quit(0); - } - break; - - case 'f': - strcpy(xpfp,optarg); - break; - - case 'a': - strcpy(pl1,optarg); - break; - - case 'b': - strcpy(pl2,optarg); - break; - - case 'c': - strcpy(pl3,optarg); - break; - } - - printf("\n \033[36m sdljpd -- jeopady on steroids \n Copyright (c) 2005 Frederick Bullik \n\n This program is free software; you can redistribute it and/or\n modify it under the terms of the GNU General Public License\n as published by the Free Software Foundation; either version 2\n of the License, or (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program; if not, write to the Free Software \n Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\033[m \n\n"); - - printf("========================================================================\n"); - - filefoo(); - - if(TTF_Init()==-1) { - printf("TTF_Init: %s\n", TTF_GetError()); - exit(2); - } - - font=TTF_OpenFont("subfont.ttf", 26); - - if(!font) { - printf("TTF_OpenFont: %s\n", TTF_GetError()); - /* handle error*/ - } - - /* sprintf(wmcapt,"glpong - %s vs ", player_a );*/ - /* initialize SDL */ - if ( SDL_Init( SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK) < 0 ) - { - fprintf( stderr, "SDL initialization failed: %s\n", - SDL_GetError( ) ); - Quit( 1 ); - } - - if(Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers)) { - printf("Unable to open audio!\n"); - exit(1); - } - - Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels); - - /* Fetch the video info */ - videoInfo = SDL_GetVideoInfo( ); - - music_init(); - - buzz_sound = Mix_LoadMUS("buzzer.wav"); - - if ( !videoInfo ) - { - fprintf( stderr, "Video query failed: %s\n", - SDL_GetError( ) ); - Quit( 1 ); - } - - printf ( "%i joysticks found: ", SDL_NumJoysticks () ); - - joystick = SDL_JoystickOpen (0); - if(joystick == NULL) { - printf("Unable to open joystick!\n"); - exit(1); - } - - SDL_JoystickEventState ( SDL_QUERY ); - - SDL_JoystickUpdate (); - - printf ( "%s\n", SDL_JoystickName ( 0 ) ); - - -SDL_Haptic *haptic; -haptic = SDL_HapticOpen( 0 ); -if (haptic == NULL) - return -1; -if (SDL_HapticRumbleInit( haptic ) != 0) - return -1; -if (SDL_HapticRumblePlay( haptic, 0.5, 2000 ) != 0) - return -1; -SDL_Delay( 2000 ); -SDL_HapticClose( haptic ); - - - - SDL_WM_SetCaption(wmcapt, NULL); - /*SDL_WM_SetIcon(SDL_LoadBMP("glpong.bmp"),NULL);*/ - - /* the flags to pass to SDL_SetVideoMode */ - videoFlags |= SDL_HWPALETTE; /* Store the palette in hardware */ - videoFlags |= SDL_DOUBLEBUF; - videoFlags |= SDL_RESIZABLE; /* Enable window resizing */ - videoFlags |= SDL_HWSURFACE; - videoFlags |= SDL_HWACCEL; - - SDL_ShowCursor( SDL_DISABLE); - - /* get a SDL surface */ - surface = SDL_SetVideoMode( SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_BPP, - videoFlags ); - /* Verify there is a surface */ - if ( !surface ) - { - fprintf( stderr, "Video mode set failed: %s\n", SDL_GetError( ) ); - Quit( 1 ); - } - - loadtex(); - - /* wait for events */ - while ( !done ) - { - /* handle the events in the queue */ - - while ( SDL_PollEvent( &event ) ) - { - switch( event.type ) - { - - case SDL_ACTIVEEVENT: - /* Something's happend with our focus - * If we lost focus or we are iconified, we - * shouldn't draw the screen - */ - if ( event.active.gain == 0 ) - isActive = FALSE; - else - isActive = TRUE; - break; - - case SDL_VIDEORESIZE: - /* handle resize event */ - surface = SDL_SetVideoMode( event.resize.w, - event.resize.h, - 16, videoFlags ); - if ( !surface ) - { - fprintf( stderr, "Could not get a surface after resize: %s\n", SDL_GetError( ) ); - Quit( 1 ); - } - break; - - case SDL_KEYDOWN: - /* handle key presses */ - switch (event.key.keysym.sym){ - - case SDLK_ESCAPE: - Quit( 0 ); - break; - - case SDLK_q: - Quit( 0 ); - break; - - case SDLK_F1: - /* F1 key was pressed - * this toggles fullscreen mode - */ - SDL_WM_ToggleFullScreen( surface ); - break; - - /* Player left */ - case SDLK_a: - if(plselect >0){ - plselect --;} - enp = FALSE; - inp = FALSE; - break; - - /* Player right */ - case SDLK_d: - if(plselect <2){ - plselect ++;} - enp = FALSE; - inp = FALSE; - break; - - /* Score Add 100 */ - case SDLK_w: - score[plselect] = score[plselect] + 100; - enp = FALSE; - inp = FALSE; - break; - - /* Score Subtract 100 */ - case SDLK_s: - score[plselect] = score[plselect] - 100; - enp = FALSE; - inp = FALSE; - break; - - case SDLK_RETURN: - lockbz = FALSE; - enp = TRUE; - break; - - case SDLK_LEFT: - if(enp == FALSE){ - if(xpos >0){ - xpos --; - } - inp = FALSE; - } - break; - - case SDLK_RIGHT: - if(enp == FALSE){ - if(xpos <4){ - xpos ++; - } - inp = FALSE; - } - break; - - case SDLK_UP: - if(enp == FALSE){ - if(ypos >0){ - ypos --; - } - inp = FALSE; - } - break; - - case SDLK_DOWN: - if(enp== FALSE) - { - if(ypos <4){ - ypos ++; - } - inp = FALSE; - } - break; - - /* Right Answer */ - case SDLK_INSERT: - score[plselect]=score[plselect]+pkt[ypos]; - solved[xpos][ypos] = (plselect + 1); - lockbz = TRUE; - enp = FALSE; - inp = TRUE; - break; - - /* Wrong Answer */ - case SDLK_DELETE: - score[plselect]=score[plselect]-pkt[ypos]; - lockbz = FALSE; - inp = FALSE; - enp = TRUE; - break; - - /* Mark solved */ - case SDLK_PAGEUP: - solved[xpos][ypos] = (plselect + 1); - break; - - /* Mark unsolved */ - case SDLK_PAGEDOWN: - solved[xpos][ypos] = 0; - - /* Lock Buzzers */ - case SDLK_l: - lockbz = TRUE; - break; - - /* Unlock Buzzers */ - case SDLK_u: - lockbz = FALSE; - break; - - /* Reset playing field */ - case SDLK_r: - lockbz = FALSE; - inp = FALSE; - enp = FALSE; - break; - - default: - break; - } - break; - - case SDL_QUIT: - /* handle quit requests */ - done = TRUE; - break; - } - break; - } - draw_sdl(); - /*Mix_CloseAudio();*/ - } - - /* clean ourselves up and exit */ - Quit( 0 ); - - /* Should never get here */ - return( 0 ); -} - diff --git a/set_led.c b/set_led.c index 540a8ea..88546ae 100644 --- a/set_led.c +++ b/set_led.c @@ -50,16 +50,16 @@ int main(int argc, char **argv) /* Send a Report to the Device */ buf[0] = 0x00; /* Report Number */ buf[1] = 0x00; /* Report ID */ - //buf[2] = 0x01; /* Buzzer 1 */ - //buf[3] = 0x00; /* Buzzer 2 */ - //buf[4] = 0x00; /* Buzzer 3 */ - //buf[5] = 0x01; /* Buzzer 4 */ + /*buf[2] = 0x00; Buzzer 1 */ + /*buf[3] = 0x00; Buzzer 2 */ + /*buf[4] = 0x00; Buzzer 3 */ + /*buf[5] = 0x00; Buzzer 4 */ res = write(fd, buf, 6); if (res < 0) { printf("Error: %d\n", errno); perror("write"); } else { - //printf("write() wrote %d bytes\n", res); + /*printf("write() wrote %d bytes\n", res); */ } close(fd); diff --git a/set_led.c~ b/set_led.c~ deleted file mode 100644 index 37fb741..0000000 --- a/set_led.c~ +++ /dev/null @@ -1,67 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - int fd; - int i, res = 0; - char buf[256]; - - /* Open the Device with non-blocking reads. In real life, - don't use a hard coded path; use libudev instead. */ - fd = open("/dev/hidraw0", O_RDWR|O_NONBLOCK); - - if (fd < 0) { - perror("Unable to open device"); - return 1; - } - - memset(buf, 0x0, sizeof(buf)); - - switch (argv[1][0]) { - case '0': - break; - case '1': - buf[2] = 0xff; - break; - case '2': - buf[3] = 0xff; - break; - case '3': - buf[4] = 0xff; - break; - case '4': - buf[5] = 0xff; - break; - default: - printf("Please specify 0 ... 4 as single argument.\n"); - } - - /* Send a Report to the Device */ - buf[0] = 0x00; /* Report Number */ - buf[1] = 0x00; /* Report ID */ - //buf[2] = 0x01; /* Buzzer 1 */ - //buf[3] = 0x00; /* Buzzer 2 */ - //buf[4] = 0x00; /* Buzzer 3 */ - //buf[5] = 0x01; /* Buzzer 4 */ - res = write(fd, buf, 6); - if (res < 0) { - printf("Error: %d\n", errno); - perror("write"); - } else { - //printf("write() wrote %d bytes\n", res); - } - - close(fd); - return 0; -} diff --git a/tastaturbelegung.txt~ b/tastaturbelegung.txt~ deleted file mode 100644 index a1a1b4b..0000000 --- a/tastaturbelegung.txt~ +++ /dev/null @@ -1,15 +0,0 @@ -ESC, Q: Quit -F1: Fullscreen -A: Spieler links -D: Spieler rechts -W: Score+100 -S: Score-100 -RETURN: Frage anzeigen, Buzzer freigeben -Pfeiltasten: Frage auswählen -Insert: Gelöst, Antwort anzeigen, Punkte addieren -Delete: Buzzer freigeben, Punkte abziehen -PgUp: Gelöst (ohne Punkte) -PgDown: nicht Gelöst (ohne Punkte) -L: Lock. Buzzer sperren -U: Unlock. Buzzer freigeben -R: Reset. Spielfeld anzeigen, Buzzer freigeben