Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Meehan committed Mar 30, 2012
2 parents f5ecc45 + 7d71dd7 commit b1b6e21
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 28 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.GET_TASKS"/>
<!-- <uses-permission android:name="android.permission.GET_TASKS"/> -->
22 changes: 22 additions & 0 deletions ant/host-source/source/project/src/moai/adcolony/MoaiAdColony.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ public static void onCreate ( Activity activity ) {

sActivity = activity;
}

//----------------------------------------------------------------//
public static void onPause ( ) {

MoaiLog.i ( "MoaiAdColony onPause: Notifying AdColony" );

AdColony.setAppStatus ( true );
}

//----------------------------------------------------------------//
public static void onResume ( ) {

MoaiLog.i ( "MoaiAdColony onResume: Notifying AdColony" );

AdColony.setAppStatus ( false );
}

//================================================================//
// AdColony JNI callback methods
Expand Down Expand Up @@ -90,4 +106,10 @@ public void onAdColonyVideoFinished () {

AKUNotifyAdColonyVideoComplete ();
}

//----------------------------------------------------------------//
public void onAdColonyVideoStarted () {

// TODO: Notify
}
}
2 changes: 1 addition & 1 deletion ant/libmoai/jni/src/moai.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@
}

//----------------------------------------------------------------//
extern "C" void Java_@PACKAGE_UNDERSCORED@_MoaiView_AKUSetScreenDpi ( JNIEnv* env, jclass obj, jint dpi ) {
extern "C" void Java_com_ziplinegames_moai_Moai_AKUSetScreenDpi ( JNIEnv* env, jclass obj, jint dpi ) {

AKUSetScreenDpi ( dpi );
}
Expand Down
63 changes: 38 additions & 25 deletions src/moaicore/MOAIGfxDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1580,35 +1580,48 @@ void MOAIGfxDevice::UpdateFinalColor () {
//----------------------------------------------------------------//
void MOAIGfxDevice::UpdateCpuVertexMtx () {

// Used signed, so we can roll "under" to -1 without an extra range check
int start = this->mVertexMtxInput;
int finish = this->mVertexMtxOutput;

// The matrices are being multiplied A*B*C, but the common case is that
// B and C are static throughout all/most of a frame. Thus, we can
// capitalize on the associativity of matrix multiplication by caching
// (B*C) and save a matrix mult in the common case (assuming they haven't
// changed since the last update request).

int i = finish - 1;
u32 start = this->mVertexMtxInput;
u32 finish = this->mVertexMtxOutput;

if ( this->mCpuVertexTransformCache [ i ]) {
while ( i >= start && this->mCpuVertexTransformCache [ i ]) {
--i;
}
this->mCpuVertexTransformMtx = this->mCpuVertexTransformCacheMtx [ i + 1 ];
}
else {
this->mCpuVertexTransformMtx.Ident();
}
this->mCpuVertexTransformMtx.Ident ();

for ( ; i >= start; --i ) {
this->mCpuVertexTransformMtx.Prepend ( this->mVertexTransforms [ i ]);
this->mCpuVertexTransformCacheMtx [ i ] = this->mCpuVertexTransformMtx;
this->mCpuVertexTransformCache [ i ] = true;
for ( u32 i = start; i < finish; ++i ) {
this->mCpuVertexTransformMtx.Append ( this->mVertexTransforms [ i ]);
}

this->mCpuVertexTransform = !this->mCpuVertexTransformMtx.IsIdent ();

#ifdef USE_VTX_MTX_CACHE

// Used signed, so we can roll "under" to -1 without an extra range check
int start = this->mVertexMtxInput;
int finish = this->mVertexMtxOutput;

// The matrices are being multiplied A*B*C, but the common case is that
// B and C are static throughout all/most of a frame. Thus, we can
// capitalize on the associativity of matrix multiplication by caching
// (B*C) and save a matrix mult in the common case (assuming they haven't
// changed since the last update request).

int i = finish - 1;

if ( this->mCpuVertexTransformCache [ i ]) {
while ( i >= start && this->mCpuVertexTransformCache [ i ]) {
--i;
}
this->mCpuVertexTransformMtx = this->mCpuVertexTransformCacheMtx [ i + 1 ];
}
else {
this->mCpuVertexTransformMtx.Ident();
}

for ( ; i >= start; --i ) {
this->mCpuVertexTransformMtx.Prepend ( this->mVertexTransforms [ i ]);
this->mCpuVertexTransformCacheMtx [ i ] = this->mCpuVertexTransformMtx;
this->mCpuVertexTransformCache [ i ] = true;
}

this->mCpuVertexTransform = !this->mCpuVertexTransformMtx.IsIdent ();
#endif
}

//----------------------------------------------------------------//
Expand Down
32 changes: 31 additions & 1 deletion src/moaiext-iphone/MOAIKeyboardIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,37 @@
// MOAIKeyboardIOS
//================================================================//
/** @name MOAIKeyboardIOS
@text Wrapper for the native keyboard.
@text <p>Wrapper for the native keyboard. This is a first pass
of the keyboard functionality and is missing some
important features (such as spell check) that will be
added in the near future. We also need to trap the
keyboard notifications that tell us the position and
dimensions of the keyboard.</p>
<p>The decision to divorce the keyboard from the text
input field was deliberate. We're not ready (and may never
be ready) to own a binding to a full set of native UI
widgets. In future releases we'll give better was to
connect the software keyboard to a MOAITextBox. This will
give better integration of editable text fields with
Moai. Even though this is more work up front, it means
it will be easier in the long run to keep editable text
synchronized with everything else in a scene.</p>
<p>The other short term limitation we face is complex
text layout for languages such as Arabic. Since we aren't
displaying native text fields, input is limited to what
MOAITextBox can display. Support for complex text layout
is something we want to handle down the road, but until
then we're going to be limited.</p>
<p>If the keyboard (as written) doesn't meet your needs,
if should be straightforward to adapt it into a native
text field class that does. You'd need to change it from
a singleton to a factory/instance type and add some API to
position it on the screen, but otherwise most of the
callbacks are already handled.</p>
@const EVENT_INPUT
@const EVENT_RETURN
Expand Down

0 comments on commit b1b6e21

Please sign in to comment.