mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
add P3D_PLUGIN_VERSION_STR, a few other minor changes
This commit is contained in:
parent
14d6123e77
commit
5e026c36a2
@ -81,7 +81,7 @@ public:
|
||||
pthread_mutexattr_t attr; \
|
||||
pthread_mutexattr_init(&attr); \
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); \
|
||||
int result = pthread_mutex_init(&(lock), &attr); \
|
||||
pthread_mutex_init(&(lock), &attr); \
|
||||
pthread_mutexattr_destroy(&attr); \
|
||||
}
|
||||
#define ACQUIRE_LOCK(lock) pthread_mutex_lock(&(lock))
|
||||
|
@ -14,6 +14,9 @@
|
||||
pandaVersion.h. */
|
||||
#$[]define P3D_COREAPI_VERSION_STR "$[join .,$[P3D_COREAPI_VERSION]]"
|
||||
|
||||
/* As does the plugin version number. */
|
||||
#$[]define P3D_PLUGIN_VERSION_STR "$[join .,$[P3D_PLUGIN_VERSION]]"
|
||||
|
||||
/* The filename(s) to generate output to when the plugin is running.
|
||||
For debugging purposes only. */
|
||||
#$[]define P3D_PLUGIN_LOG_DIRECTORY "$[subst \,\\,$[osfilename $[P3D_PLUGIN_LOG_DIRECTORY]]]"
|
||||
|
@ -135,10 +135,13 @@ PPInstance(NPMIMEType pluginType, NPP instance, uint16_t mode,
|
||||
#endif // _WIN32
|
||||
|
||||
#ifndef _WIN32
|
||||
// Save the startup time to improve precision of gettimeofday().
|
||||
// Save the startup time to improve precision of gettimeofday(). We
|
||||
// also use this to measure elapsed time from the window parameters
|
||||
// having been received.
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, (struct timezone *)NULL);
|
||||
_init_sec = tv.tv_sec;
|
||||
_init_usec = tv.tv_usec;
|
||||
#endif // !_WIN32
|
||||
|
||||
#ifdef __APPLE__
|
||||
@ -2642,10 +2645,15 @@ paint_twirl_osx_cgcontext(CGContextRef context) {
|
||||
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, (struct timezone *)NULL);
|
||||
double now = (double)(tv.tv_sec - _init_sec) + (double)tv.tv_usec / 1000000.0;
|
||||
int step = ((int)(now * 10.0)) % twirl_num_steps;
|
||||
double now = (double)(tv.tv_sec - _init_sec) + (double)(tv.tv_usec - _init_usec) / 1000000.0;
|
||||
|
||||
osx_paint_image(context, _twirl_images[step]);
|
||||
// Don't draw the twirling icon until at least half a second has
|
||||
// passed, so we don't distract people by drawing it
|
||||
// unnecessarily.
|
||||
if (now >= 0.5) {
|
||||
int step = ((int)(now * 10.0)) % twirl_num_steps;
|
||||
osx_paint_image(context, _twirl_images[step]);
|
||||
}
|
||||
}
|
||||
#endif // MACOSX_HAS_EVENT_MODELS
|
||||
|
||||
|
@ -246,6 +246,7 @@ private:
|
||||
|
||||
#ifndef _WIN32
|
||||
long _init_sec;
|
||||
long _init_usec;
|
||||
#endif // _WIN32
|
||||
|
||||
bool _python_window_open;
|
||||
|
@ -163,7 +163,7 @@ NP_Initialize(NPNetscapeFuncs *browserFuncs,
|
||||
|
||||
// open_logfile() also assigns global_root_dir.
|
||||
open_logfile();
|
||||
nout << "initializing\n";
|
||||
nout << "Initializing Panda3D plugin version " << P3D_PLUGIN_VERSION_STR << "\n";
|
||||
|
||||
nout << "browserFuncs = " << browserFuncs << "\n";
|
||||
|
||||
@ -177,12 +177,12 @@ NP_Initialize(NPNetscapeFuncs *browserFuncs,
|
||||
|
||||
int browser_major = (browser->version >> 8) && 0xff;
|
||||
int browser_minor = browser->version & 0xff;
|
||||
nout << "Browser version " << browser_major << "." << browser_minor << "\n";
|
||||
nout << "Browser NPAPI version " << browser_major << "." << browser_minor << "\n";
|
||||
|
||||
int expected_major = NP_VERSION_MAJOR;
|
||||
int expected_minor = NP_VERSION_MINOR;
|
||||
|
||||
nout << "Plugin compiled with version "
|
||||
nout << "Plugin compiled with NPAPI version "
|
||||
<< expected_major << "." << expected_minor << "\n";
|
||||
|
||||
has_plugin_thread_async_call = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user