Browse Source

misc: very minor tweaks here and there.

legacy
Sam Hocevar sam 12 years ago
parent
commit
439298ee5e
3 changed files with 27 additions and 10 deletions
  1. +6
    -6
      src/gradient.cpp
  2. +2
    -0
      src/input/input.cpp
  3. +19
    -4
      src/platform/android/androidapp.cpp

+ 6
- 6
src/gradient.cpp View File

@@ -60,12 +60,12 @@ void Gradient::TickDraw(float seconds)
{
Entity::TickDraw(seconds);

float const vertex[] = { 0.0f, 0.0f, 0.0f,
640.0f, 0.0f, 0.0f,
0.0f, 480.0f, 0.0f,
640.0f, 480.0f, 0.0f,
0.0f, 480.0f, 0.0f,
640.0f, 0.0f, 0.0f, };
float const vertex[] = { m_bbox[0].x, m_bbox[0].y, 0.0f,
m_bbox[1].x, m_bbox[0].y, 0.0f,
m_bbox[0].x, m_bbox[1].y, 0.0f,
m_bbox[1].x, m_bbox[1].y, 0.0f,
m_bbox[0].x, m_bbox[1].y, 0.0f,
m_bbox[1].x, m_bbox[0].y, 0.0f, };

float const color[] = { 0.73f, 0.85f, 0.85f, 1.0f,
0.73f, 0.85f, 0.85f, 1.0f,


+ 2
- 0
src/input/input.cpp View File

@@ -403,6 +403,8 @@ void Input::SetMousePos(ivec2 coord)

WorldEntity *top = NULL;

/* Find the top “widget” amongst all entities that match the
* mouse coordinates */
for (int n = 0; n < data->nentities; n++)
{
if (coord.x < data->entities[n]->m_bbox[0].x


+ 19
- 4
src/platform/android/androidapp.cpp View File

@@ -25,11 +25,8 @@ using namespace lol;

/* One of these wrappers will be overridden by the user's version */
void lol_android_main(void) __attribute__((weak));
void lol_android_main(void) {}
void lol_android_main(int argc, char **argv) __attribute__((weak));
void lol_android_main(int argc, char **argv) {}
void lol_android_main(int argc, char **argv, char **envp) __attribute__((weak));
void lol_android_main(int argc, char **argv, char **envp) {}

namespace lol
{
@@ -87,6 +84,7 @@ AndroidApp::~AndroidApp()
extern "C" jint
JNI_OnLoad(JavaVM* vm, void* reserved)
{
Log::Info("Java layer loading library, vm=0x%08lx", (long)(intptr_t)vm);
g_vm = vm;
return JNI_VERSION_1_4;
}
@@ -94,7 +92,7 @@ JNI_OnLoad(JavaVM* vm, void* reserved)
extern "C" void
Java_org_zoy_LolEngine_LolActivity_nativeInit(JNIEnv* env, jobject thiz)
{
Log::Info("Java layer initialising activity");
Log::Info("Java layer initialising activity 0x%08lx", (long)thiz);
env->NewGlobalRef(thiz); /* FIXME: never released! */
g_activity = thiz;
}
@@ -158,5 +156,22 @@ Java_org_zoy_LolEngine_LolRenderer_nativeRender(JNIEnv* env)
Ticker::TickDraw();
}

/*
* Fake main() wrappers that let us call the user’s main() from within
* a separate thread.
*/
void lol_android_main(void) {}
void lol_android_main(int argc, char **argv)
{
(void)argc;
(void)argv;
}
void lol_android_main(int argc, char **argv, char **envp)
{
(void)argc;
(void)argv;
(void)envp;
}

#endif /* __ANDROID__ */


Loading…
Cancel
Save