Пример #1
0
void cxJsonPrint(cxAny pjson)
{
    CX_ASSERT_THIS(pjson, cxJson);
    cxStr txt = cxJsonDump(this);
    CX_LOGGER("%s",cxStrBody(txt));
    CX_UNUSED_PARAM(txt);
}
Пример #2
0
cxAny cxPlayEffect(cxConstChars file,cxBool loop)
{
    cxPlayer this = cxPlayerInstance();
    JniMethodInfo methodInfo;
    cxBool ret = cxGetStaticMethodInfo(&methodInfo, CLASS_NAME, "cxEnginePlayEffect","(Ljava/lang/String;Z)I");
    CX_ASSERT(ret, "get static method info failed");
    CX_UNUSED_PARAM(ret);
    jstring path = (*methodInfo.env)->NewStringUTF(methodInfo.env,file);
    cxInt soundId = (*methodInfo.env)->CallStaticIntMethod(methodInfo.env, methodInfo.classID, methodInfo.methodID, path, loop);
    (*methodInfo.env)->DeleteLocalRef(methodInfo.env,path);
    if(soundId <= 0){
        CX_ERROR("play file failed %s",file);
        return NULL;
    }
    cxTrack track = cxHashGet(this->tracks, cxHashStrKey(file));
    //add or replace
    if(track == NULL || track->soundId != soundId){
        track = CX_ALLOC(cxTrack);
        track->file = cxStringAllocChars(file);
        track->soundId = soundId;
        cxHashSet(this->tracks, cxHashStrKey(file), track);
        CX_RELEASE(track);
    }
    return track;
}
Пример #3
0
void cxResumeMusic()
{
    JniMethodInfo methodInfo;
    cxBool ret = cxGetStaticMethodInfo(&methodInfo, CLASS_NAME, "cxEngineResumeMusic","()V");
    CX_ASSERT(ret, "get static method info failed");
    CX_UNUSED_PARAM(ret);
    (*methodInfo.env)->CallStaticVoidMethod(methodInfo.env, methodInfo.classID, methodInfo.methodID);
}
Пример #4
0
void cxStopEffect(cxAny track)
{
    cxTrack this = track;
    JniMethodInfo methodInfo;
    cxBool ret = cxGetStaticMethodInfo(&methodInfo, CLASS_NAME, "cxEngineStopEffect","(I)V");
    CX_ASSERT(ret, "get static method info failed");
    CX_UNUSED_PARAM(ret);
    (*methodInfo.env)->CallStaticVoidMethod(methodInfo.env, methodInfo.classID, methodInfo.methodID, this->soundId);
}
Пример #5
0
void cxPlayMusic(cxConstChars file,cxBool loop){
    JniMethodInfo methodInfo;
    cxBool ret = cxGetStaticMethodInfo(&methodInfo, CLASS_NAME, "cxEnginePlayMusic","(Ljava/lang/String;Z)V");
    CX_ASSERT(ret, "get static method info failed");
    CX_UNUSED_PARAM(ret);
    jstring path = (*methodInfo.env)->NewStringUTF(methodInfo.env,file);
    (*methodInfo.env)->CallStaticVoidMethod(methodInfo.env, methodInfo.classID, methodInfo.methodID, path, loop);
    (*methodInfo.env)->DeleteLocalRef(methodInfo.env,path);
}
Пример #6
0
cxAny cxAutoPoolAppend(cxAny any)
{
    CX_RETURN(any == NULL,NULL);
    cxObject object = any;
    cxAutoPool pool = cxAutoPoolInstance();
    cxArrayAppend(pool->objects, any);
    CX_ASSERT(object->cxRefcount > 1, "apped to auto pool object,refcount > 1");
    CX_UNUSED_PARAM(object);
    CX_RELEASE(any);
    return any;
}
Пример #7
0
static void cxTimerStep(cxAny pav,cxFloat dt,cxFloat time)
{
    cxTimer this = pav;
    CX_UNUSED_PARAM(this);
}
Пример #8
0
static void cxTimerInit(cxAny pav)
{
    cxTimer this = pav;
    CX_ASSERT(this->super.view != NULL, "view not set");
    CX_UNUSED_PARAM(this);
}