global void KillAllSounds() { Sound *sn; Handle theHandle; /* Stop and delete each node in the sound list */ while(!EmptyList(&soundList)) { sn = (Sound *) Native(FirstNode(&soundList)); if (sn->sSample) { audArgs.count = 2; audArgs.func = STOP; audArgs.arg2 = sn->sNumber; KDoAudio ((word *)&audArgs); } else { DoSound(SEnd,(char far *) sn); ResLock(RES_SOUND,sn->sNumber,FALSE); if(theHandle = (Handle) Native(GetProperty((Obj *) Native(sn->sKey), s_handle))) { if ((int)theHandle != 1) { CriticalHandle(theHandle,FALSE); UnlockHandle(theHandle); } } } DeleteNode(&soundList,Pseudo(sn)); } }
void Draw::DrawDataOp(int x, int y, int cx, int cy, const String& data, const char *id) { bool tonative = !IsNative(); if(tonative) { BeginNative(); Native(x, y); Native(cx, cy); } One<DataDrawer> dd = DataDrawer::Create(id); if(dd) { dd->Open(data, cx, cy); if((cx > 2048 || cy > 2048) && (GetInfo() & DATABANDS)) { int yy = 0; while(yy < cy) { int ccy = min(cy - yy, 32); ImageBuffer ib(cx, ccy); dd->Render(ib); DrawImageBandRLE(*this, x, y + yy, ib, 16); yy += ccy; } } else { ImageBuffer m(cx, cy); dd->Render(m); DrawImage(x, y, m); } } if(tonative) EndNative(); }
global void RestoreAllSounds() { Sound *sn; Obj *soundObj; Handle sHandle; int soundId; /* For every node on the sound list, load the resource in * the s_number property. If the sState property of the node * is non-zero, restart the sound using the SRestore function * in MIDI.S */ sn = (Sound *) Native(FirstNode(&soundList)); while(sn) { soundObj = (Obj *) Native(GetKey(Pseudo(sn))); soundId = GetProperty (soundObj, s_number); if(sn->sSample) { /* put sample stuff here */ } else { if(soundId) { ResLoad(RES_SOUND,soundId); } if(sn->sState) { sHandle = ResLoad(RES_SOUND,soundId); CriticalHandle(sHandle,TRUE); ResLock(RES_SOUND,soundId,TRUE); SetProperty(soundObj,s_handle,(uint) Pseudo(sHandle)); sn->sPointer = (char far *) sHandle; DoSound(SRestore,(char far *) sn); // if(sn->sSample) { // LockHandle(sHandle); // } UpdateCues(soundObj); } } sn = (Sound *) Native(NextNode(Pseudo(sn))); } /* Reset the default reverb mode */ DoSound(SSetReverb,reverbDefault); }
void Draw::BeginNative() { if(inchPixels != nativeDpi && ++native == 1) { ::SetMapMode(handle, MM_TEXT); actual_offset_bak = actual_offset; Native(actual_offset); SetOrg(); } }
void KMapKeyToDir( word* args) { Obj *SCIEvent; REventRecord event; SCIEvent = (Obj *) Native(*(args+1)); ObjToEvent(SCIEvent, &event); MapKeyToDir(&event); EventToObj(&event, SCIEvent); acc = Pseudo(SCIEvent); }
bool CCoordTransService::Native ( const double &rdX, const double &rdY, Punkt &outPt) { return Native (rdX, rdY, &outPt.X(), &outPt.Y()); }
, Methods ( GetWindow, "getWindow", "()Landroid/view/Window;" ) ( HandleActivityMessages, "handleActivityMessages", "(Z)V" ) , Callbacks ( Native(Activity::RawOnCreate), "nativeOnCreate", "(Landroid/os/Bundle;)V" ) ( Native(Activity::RawOnPause), "nativeOnPause", "()V" ) ( Native(Activity::RawHandleActivityMessage), "nativeHandleActivityMessage", "(Landroid/os/Message;)Z" ) )
void Draw::Native(Rect& r) const { Native(r.left, r.top); Native(r.right, r.bottom); }
void Draw::Native(Size& sz) const { Native(sz.cx, sz.cy); }
void Draw::Native(Point& p) const { Native(p.x, p.y); }
void KMessage( word* args) { switch (arg(1)) { case MSG_GET: get( (uint) arg(2), // module (uchar) arg(3), // noun (uchar) arg(4), // verb (uchar) arg(5), // case (uchar) arg(6), // sequence argCount < 7 ? NULL : Native(arg(7)) // buffer ); break; case MSG_NEXT: getNext(argCount < 2 ? NULL : Native(arg(2))); // buffer break; case MSG_SIZE: getSize( (uint) arg(2), // module (uchar) arg(3), // noun (uchar) arg(4), // verb (uchar) arg(5), // case (uchar) arg(6) // sequence ); break; case MSG_GETREFNOUN: case MSG_GETREFVERB: case MSG_GETREFCASE: { uchar refNoun; uchar refVerb; uchar refCond; bool rc = getRefValues( (uint) arg(2), // module (uchar) arg(3), // noun (uchar) arg(4), // verb (uchar) arg(5), // case (uchar) arg(6), // sequence &refNoun, &refVerb, &refCond ); if (!rc) acc = -1; else acc = arg(1) == MSG_GETREFNOUN ? refNoun : arg(1) == MSG_GETREFVERB ? refVerb : refCond; break; } case MSG_PUSH: pushStack(); break; case MSG_POP: popStack(); break; case MSG_GETKEY: { int* ip = (int*) arg(2); ip[0] = curModule; ip[1] = curNoun; ip[2] = curVerb; ip[3] = curCond; ip[4] = curSeq; break; } default: Panic(E_MESSAGE, arg(1)); } }