Changeset 1:36cf4d98558c in xplra
- Timestamp:
- 01/03/13 09:09:43 (12 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r0 r1 16 16 17 17 AM_CONDITIONAL([TARGET_API_WIN32], test $_target_win32 -eq 0) 18 AM_CONDITIONAL([TARGET_API_WIN64], test $_target_win32 -eq 0 -a "$host_cpu" = "x86_64") 18 19 AM_CONDITIONAL([TARGET_API_POSIX], test $_target_win32 -ne 0) 19 20 if test $_target_win32 -eq 0; then 21 if test "$host_cpu" = "x86_64"; then 22 AC_DEFINE([TARGET_API_WIN64], [1], [Define if the target is the 64-bit Win32 API.]) 23 fi 20 24 AC_DEFINE([TARGET_API_WIN32], [1], [Define if the target is the Win32 API.]) 21 25 else -
src/xplra/ListenThread.cc
r0 r1 31 31 #include "ListenThread.h" 32 32 33 #include < XPLMUtilities.h>33 #include <xplcommon/Util.h> 34 34 35 35 //------------------------------------------------------------------------------ … … 37 37 using xplra::ListenThread; 38 38 39 using xplcommon::Util; 40 39 41 //------------------------------------------------------------------------------ 40 42 41 43 void ListenThread::run() 42 44 { 43 XPLMDebugString("xplra::ListenThread::run: started\n");45 Util::debug("xplra::ListenThread::run: started\n"); 44 46 45 47 while(!quitEvent.check() && !quitEvent.failed()) { … … 47 49 } 48 50 49 XPLMDebugString("xplra::ListenThread::run: quitting\n");51 Util::debug("xplra::ListenThread::run: quitting\n"); 50 52 } 51 53 -
src/xplra/Makefile.am
r0 r1 5 5 if TARGET_API_WIN32 6 6 AM_CPPFLAGS=-DIBM 7 AM_LDFLAGS=@XPSDK_LDFLAGS@ -lXPLM -no-undefined 7 AM_LDFLAGS=@XPSDK_LDFLAGS@ -no-undefined 8 if TARGET_API_WIN64 9 AM_LDFLAGS+=-lXPLM_64 10 else 11 AM_LDFLAGS+=-lXPLM 12 endif 8 13 endif 9 14 -
src/xplra/plugin.cc
r0 r1 1 // Copyright (c) 2013 by István Váradi 2 3 // This file is part of XPLRA, a remote-access plugin for X-Plane 4 5 // Redistribution and use in source and binary forms, with or without 6 // modification, are permitted provided that the following conditions are met: 7 8 // 1. Redistributions of source code must retain the above copyright notice, this 9 // list of conditions and the following disclaimer. 10 // 2. Redistributions in binary form must reproduce the above copyright notice, 11 // this list of conditions and the following disclaimer in the documentation 12 // and/or other materials provided with the distribution. 13 14 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 25 // The views and conclusions contained in the software and documentation are those 26 // of the authors and should not be interpreted as representing official policies, 27 // either expressed or implied, of the FreeBSD Project. 28 29 //------------------------------------------------------------------------------ 30 1 31 #include "ListenThread.h" 32 33 #include <xplcommon/Util.h> 2 34 3 35 #include <XPLMDefs.h> … … 13 45 using xplra::ListenThread; 14 46 47 using xplcommon::Util; 48 15 49 //------------------------------------------------------------------------------ 16 50 51 /** 52 * The thread to use to listen for incoming connections. 53 */ 17 54 static ListenThread* listenThread = 0; 18 55 19 56 //------------------------------------------------------------------------------ 20 57 21 static void debug(const char* format, ...)22 {23 va_list ap;24 va_start(ap, format);25 26 char buf[256];27 vsnprintf(buf, sizeof(buf), format, ap);28 29 va_end(ap);30 31 XPLMDebugString(buf);32 }33 34 58 PLUGIN_API int XPluginStart(char* outName, char* outSignature, 35 59 char* outDescription) 36 60 { 37 debug("hu.varadiistvan.xplra called\n");61 Util::debug("hu.varadiistvan.xplra called\n"); 38 62 39 63 strcpy(outName, "X-Plane Remote Access"); … … 44 68 } 45 69 46 // float callback(float elapsedSinceLastCall, float elapsedTimeSinceLastFlightLoop, 47 // int counter, void* refcon) 48 // { 49 // debug("hu.varadiistvan.proba.callback called: elapsedSinceLastCall=%f, elapsedTimeSinceLastFlightLoop=%f, counter=%d, refcon=%p\n", 50 // elapsedSinceLastCall, elapsedTimeSinceLastFlightLoop, 51 // counter, refcon); 52 // return 5.0; 53 // } 70 //------------------------------------------------------------------------------ 54 71 55 72 PLUGIN_API void XPluginEnable(void) 56 73 { 57 debug("hu.varadiistvan.proba.XPluginEnable called\n");74 Util::debug("hu.varadiistvan.xplra.XPluginEnable called\n"); 58 75 // XPLMRegisterFlightLoopCallback(&callback, 5.0, 0); 59 76 listenThread = new ListenThread(); … … 61 78 } 62 79 80 //------------------------------------------------------------------------------ 81 63 82 PLUGIN_API void XPluginReceiveMessage(XPLMPluginID inFrom, long inMessage, 64 83 void* inParam) 65 84 { 66 debug("hu.varadiistvan.proba.XPluginReceiveMessage called, inFrom=%d, inMessage=%ld, inParam=%p\n",85 Util::debug("hu.varadiistvan.xplra.XPluginReceiveMessage called, inFrom=%d, inMessage=%ld, inParam=%p\n", 67 86 inFrom, inMessage, inParam); 68 87 } 69 88 89 //------------------------------------------------------------------------------ 90 70 91 PLUGIN_API void XPluginDisable(void) 71 92 { 72 debug("hu.varadiistvan.proba.XPluginDisable called\n");93 Util::debug("hu.varadiistvan.xplra.XPluginDisable called\n"); 73 94 // XPLMUnregisterFlightLoopCallback(&callback, 0); 74 95 if (listenThread!=0) { … … 78 99 } 79 100 101 //------------------------------------------------------------------------------ 102 80 103 PLUGIN_API void XPluginStop(void) 81 104 { 82 debug("hu.varadiistvan.proba.XPluginStop called\n");105 Util::debug("hu.varadiistvan.xplra.XPluginStop called\n"); 83 106 } 107 108 //------------------------------------------------------------------------------ 109 110 // Local Variables: 111 // mode: C++ 112 // c-basic-offset: 4 113 // indent-tabs-mode: nil 114 // End:
Note:
See TracChangeset
for help on using the changeset viewer.