Previous 15994 Revisions Next

r1051 Saturday 29th September, 2007 at 19:51:02 UTC by R. Belmont
[SDLMESS] Added memory leak fixes from 0.119u2. (Firewave)
[src/osd/sdl]input.c

src/osd/sdl/input.c
r1050r1051
483483   return r;
484484}
485485
486static char *alloc_name(const char *instr)
487{
488   char *out;
489
490   out = (char *)malloc(strlen(instr)+1);
491   memset(out, 0, strlen(instr)+1);
492   strcpy(out, instr);
493
494   return out;
495}
496
497486//============================================================
498487//  init_joymap
499488//============================================================
r1050r1051
691680         index=i;
692681         break;
693682      }
694      i++;
683      i++;                   
695684   }
696685   return index;
697686}
r1050r1051
804793
805794   // SDL 1.2 only has 1 keyboard (1.3+ will have multiple, this must be revisited then)
806795   // add it now
807   devinfo = generic_device_alloc(&keyboard_list, alloc_name((const char *)"System keyboard"));
796   devinfo = generic_device_alloc(&keyboard_list, "System keyboard");
808797   devinfo->device = input_device_add(DEVICE_CLASS_KEYBOARD, devinfo->name, devinfo);
809798
810799   // populate it
r1050r1051
822811   }
823812
824813   // SDL 1.2 has only 1 mouse - 1.3+ will also change that, so revisit this then
825   devinfo = generic_device_alloc(&mouse_list, alloc_name((const char *)"System mouse"));
814   devinfo = generic_device_alloc(&mouse_list, "System mouse");
826815   devinfo->device = input_device_add(DEVICE_CLASS_MOUSE, devinfo->name, devinfo);
827816
828817   // add the axes

Previous 15994 Revisions Next


© 1998-2018 The MESS Team