Symbian multi-platform game engine development diary 2006-6-26

xiaoxiao2021-04-11  3.0K+

Endless overtime, overtime is always quiet, didn't say hello.

This two weeks took out the time to improve the sound engine, SMS and telephone event testing. Since the conditions are limited, there is only one mobile phone, add an infrared adapter. SMS events are depressed, the simulator can not test this event, can only send the packaged program to the mobile phone, then start the program, then send a file to the mobile phone to test the SMS event, after entering hundreds of transmission Finally OK.

Here is also the code of OGGPLAY here. I only handled Kerrdied and KerrinUse errors in MaoscPlayComplete. When these two errors occurred, I made a short time after waiting for the CMDAAUDIOOOUTSTREAM, and there is no need to re-establish the hybrid thread in the "Swift Symbian C Game Code". Just re-establishing cmdaAudioOutputStream, the main thread needs to do a short time, and the two errors in the SMS event appear, but also a Kerrabort error, but can be processed. After starting the sound engine, let the main thread do a short time waiting, this only needs this to do this in Symbian's first edition, which may be this version of bug.

A cripple has been added last week, which can set the crop area on the screen. In the next time you need to test whether the phone event can be normal and increase the material class compressed by the RLE compression, further compressing the memory usage during the execution process.

The code for the test phone event in OGGPLAY (should not be used in the third edition): Tint CoggActive :: Callback (Tany * Aptr) {Coggactive * Self = (Coggactive *) Aptr; if (Self-> Iappui-> IISstartup ) {Self-> ketpui-> postconstructl ();} self-> ketpui-> notifyupdate (); if (self-> iline) {rphone :: tlineinfo linfo; self-> iphone-> getLineInfo (Self-> ilinetomonitor, Linfo; self-> iphone-> open (* self-> iPhone, linfo.iname); Tint nCalls = 0; self-> iline-> enumerateCall (ncalls); self-> iline-> close (); tbool isringing = nCalls> self-> iLineCallsReportedAtIdle; TBool isIdle = nCalls == self-> iLineCallsReportedAtIdle; if (! isRinging && self-> iInterrupted) {// the phone is ringing or someone is making a call, pause the music if any if ( Self-> Iappui-> IOGGPLAYBACK-> State () == Cabsplayback :: Eplaying) {Tracelf ("GSM IS Active"); self-> iINterrupted = ETRUE; Self-> Iappui-> handlecommandl (eoggpauseresume);}} else IF (self-> interrupted) {// o o,, now what if (isidle) {tracelf ("GSM IS "); // okay, the phone is idle again, let's continue with the music self-> interrupted = Efalse; if (Self-> Iappui-> ioggplayback-> state () == Cabsplayback :: EPAUSED) Self-> Iappui-> handlecommandl (eoggpauseresume);}}} Return 1;} OGGPLAY Processing Phone Events and SMS events: void Coggplayback :: MaoscPlayComplete (Tint aerror) {// error cots: // kerrcancel -3 // kerrunderflow - 10 // kerrdied -13 (Interrupted by Higher Priority) // Kerrinuse -14

IF (istate == Epaused || istate == eclosed) return;

IF (aerror == kerrunderflow) return; if (aerror == kerrinuse) AERROR = Kerrnone; if (aerror == kerrcancel) return;

IF (aerror == kerrdied) {IOWNTERVER-> NotifyPlayInterrupted (); return;}

IF (Aerror! = Kerrnone) {TBUF <256> BUF, TBUF; Ceikonennv :: Static () -> ReadResource (TBUF, R_OGG_ERROR_18); Ceikonenv :: Static () -> ReadResource (buf, r_ogg_error_16); buf.appendnum AERROR); IEENV-> OggerrorMsgl (TBUF, BUF); if (iobserver) {if (! io) observer-> notifyplayinterrupted ();}}}

转载请注明原文地址:https://www.9cbs.com/read-133604.html

New Post(0)