[Scummvm-cvs-logs] SF.net SVN: scummvm:[38244] scummvm/trunk/backends/platform/wii

dhewg at users.sourceforge.net dhewg at users.sourceforge.net
Sun Feb 15 15:42:27 CET 2009


Revision: 38244
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38244&view=rev
Author:   dhewg
Date:     2009-02-15 14:42:27 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
make keyboard support optional with USE_WII_KBD since libwiikeyboard is not in the official libogc svn.

Modified Paths:
--------------
    scummvm/trunk/backends/platform/wii/Makefile
    scummvm/trunk/backends/platform/wii/osystem_events.cpp

Modified: scummvm/trunk/backends/platform/wii/Makefile
===================================================================
--- scummvm/trunk/backends/platform/wii/Makefile	2009-02-15 14:26:33 UTC (rev 38243)
+++ scummvm/trunk/backends/platform/wii/Makefile	2009-02-15 14:42:27 UTC (rev 38244)
@@ -14,14 +14,25 @@
 # Builds a Gamecube version. Cleanup object files before flipping this!
 GAMECUBE = 0
 
-# Enable DVD ISO9660/Joliet support using libdi (included in libogc)
-# This requires a working DVDX install to function, not available on Gamecube
+# Enable DVD ISO9660/Joliet support using libdi (included in libogc, but the
+# ISO9660 support has not been commited to the official svn yet, requires the
+# git repository for now).
+# This requires a working DVDX install to function, not available on Gamecube.
 ifeq ($(GAMECUBE),1)
 USE_WII_DI = 0
 else
 USE_WII_DI = 1
 endif
 
+# Enable USB keyboard support through libwiikeyboard (included in libogc, but
+# it has not been commited to the official svn yet, requires the git repository
+# for now). Not available on Gamecube.
+ifeq ($(GAMECUBE),1)
+USE_WII_KBD = 0
+else
+USE_WII_KBD = 1
+endif
+
 # List of game engines to compile in. Comment a to disable the engine.
 ENABLE_SCUMM = STATIC_PLUGIN
 ENABLE_SCUMM_7_8 = STATIC_PLUGIN
@@ -142,6 +153,10 @@
 CXXFLAGS += -DUSE_WII_DI
 endif
 
+ifeq ($(USE_WII_KBD),1)
+CXXFLAGS += -DUSE_WII_KBD
+endif
+
 ifeq ($(USE_ZLIB),1)
 CXXFLAGS += -DUSE_ZLIB
 LIBS     += -lz

Modified: scummvm/trunk/backends/platform/wii/osystem_events.cpp
===================================================================
--- scummvm/trunk/backends/platform/wii/osystem_events.cpp	2009-02-15 14:26:33 UTC (rev 38243)
+++ scummvm/trunk/backends/platform/wii/osystem_events.cpp	2009-02-15 14:42:27 UTC (rev 38244)
@@ -24,6 +24,8 @@
 
 #ifndef GAMECUBE
 #include <wiiuse/wpad.h>
+#endif
+#ifdef USE_WII_KBD
 #include <wiikeyboard/keyboard.h>
 #endif
 
@@ -63,7 +65,7 @@
 #define PADS_RIGHT PAD_BUTTON_RIGHT
 #endif
 
-#ifndef GAMECUBE
+#ifdef USE_WII_KBD
 static int keymap[][2] = {
 	{ KBD_return, Common::KEYCODE_RETURN },
 	{ KBD_Up, Common::KEYCODE_UP },
@@ -114,7 +116,7 @@
 	return NULL;
 }
 
-#ifndef GAMECUBE
+#ifdef USE_WII_KBD
 static lwpq_t kbd_queue;
 static lwp_t kbd_thread;
 static u8 *kbd_stack;
@@ -158,11 +160,14 @@
 	}
 
 	timer_thread_running = res == 0;
+
 #ifndef GAMECUBE
 	WPAD_Init();
 	WPAD_SetDataFormat(WPAD_CHAN_0, WPAD_FMT_BTNS_ACC_IR);
 	WPAD_SetIdleTimeout(120);
+#endif
 
+#ifdef USE_WII_KBD
 	if(KEYBOARD_Init() >= 0) {
 		kbd_thread_quit = false;
 
@@ -196,7 +201,7 @@
 		timer_thread_running = false;
 	}
 
-#ifndef GAMECUBE
+#ifdef USE_WII_KBD
 	if (kbd_thread_running) {
 		kbd_thread_quit = true;
 		LWP_ThreadBroadcast(kbd_queue);
@@ -208,7 +213,9 @@
 
 		KEYBOARD_Deinit();
 	}
+#endif
 
+#ifndef GAMECUBE
 	WPAD_Shutdown();
 #endif
 }
@@ -220,7 +227,7 @@
 #endif
 }
 
-#ifndef GAMECUBE
+#ifdef USE_WII_KBD
 bool OSystem_Wii::pollKeyboard(Common::Event &event) {
 	int i;
 	keyboard_event kbdEvent;
@@ -290,7 +297,7 @@
 }
 #endif
 
-#define KBD_EVENT(pad_button, kbd_keycode, kbd_ascii, modifier) \
+#define PAD_EVENT(pad_button, kbd_keycode, kbd_ascii, modifier) \
 	do { \
 		if ((bd | bu) & pad_button) { \
 			if (bd & pad_button) \
@@ -336,14 +343,14 @@
 #endif
 
 	if (bd || bu) {
-		KBD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN, 0);
-		KBD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE, 0);
-		KBD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.', 0);
-		KBD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, 0);
-		KBD_EVENT(PADS_UP, Common::KEYCODE_F5, Common::ASCII_F5, Common::KBD_CTRL);
-		KBD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, 0);
-		//KBD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, 0);
-		//KBD_EVENT(PADS_RIGHT, Common::KEYCODE_n, 'n');
+		PAD_EVENT(PADS_Z, Common::KEYCODE_RETURN, Common::ASCII_RETURN, 0);
+		PAD_EVENT(PADS_X, Common::KEYCODE_ESCAPE, Common::ASCII_ESCAPE, 0);
+		PAD_EVENT(PADS_Y, Common::KEYCODE_PERIOD, '.', 0);
+		PAD_EVENT(PADS_START, Common::KEYCODE_F5, Common::ASCII_F5, 0);
+		PAD_EVENT(PADS_UP, Common::KEYCODE_F5, Common::ASCII_F5, Common::KBD_CTRL);
+		PAD_EVENT(PADS_DOWN, Common::KEYCODE_F7, Common::ASCII_F7, 0);
+		//PAD_EVENT(PADS_LEFT, Common::KEYCODE_F8, Common::ASCII_F8, 0);
+		//PAD_EVENT(PADS_RIGHT, Common::KEYCODE_n, 'n', 0);
 
 		if ((bd | bu) & (PADS_A | PADS_B)) {
 			if (bd & PADS_A)
@@ -428,7 +435,7 @@
 		}
 	}
 
-#ifndef GAMECUBE
+#ifdef USE_WII_KBD
 	if (kbd_thread_running && pollKeyboard(event))
 		return true;
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list