void CCharacter::UpdateCharacter(vfloat32 time) { if(_movementList[_indexMovement] != NULL){ _movementList[_indexMovement]->UpdateMovement(time); } if(_someProjActive){ _someProjActive = false; for(vu8 i = 0; i < _maxActiveMovement; ++i){ if(_activeProjMovements[i] != NULL){ if(_activeProjMovements[i]->isActivated()){ _activeProjMovements[i]->UpdateMovement(time); if(_activeProjMovements[i]->isActivated()){ _someProjActive = true; }else{ _activeProjMovements[i] = NULL; } } } // end if } } // some proj Activae if(isPNJ()){ checkMovementPNJ(); }else{ checkMovement(); } if(_jumping != CInputs::DirStand){ executeJump(); } if(_commands[0] != CInputs::Stand){ //printf("\n %d %d %s ",_indexMovement ,_commnads[0], CInputs::getInstance()->commandToString(_commnads[0]) ); } } // UpdateCharacter
static gboolean onKeyPressed(GtkWidget *widget, GdkEventKey *ev, gpointer data) { /* Unused parameters. */ (void)data; guint key = ev->keyval; gchar *msg = NULL; /* When inside the note pad, don't do anything here. */ if (isInsideNotePad) return FALSE; /* Jump command? * * Note: This works as long as the values of GDK keysyms satisfy: * 1) GDK_0 < GDK_1 < GDK_2 < ... < GDK_9 * 2) All of them must be >= 0. */ key -= GDK_0; if (key <= 9) { /* The initial value is -1, so we have to reset this on the * first key stroke. */ if (target_page < 0) target_page = 0; /* Do a "decimal left shift" and add the given value. */ target_page *= 10; target_page += (int)key; /* Catch overflow and announce what would happen. */ if (target_page < 0) { target_page = -1; setStatusText_strdup("Invalid page."); } else { msg = g_strdup_printf("Jump to page: %d", target_page); setStatusText_strdup(msg); g_free(msg); } return FALSE; } gboolean changed = TRUE; saveCurrentNote(); switch (ev->keyval) { case GDK_Right: case GDK_Down: case GDK_Page_Down: case GDK_space: nextSlide(); break; case GDK_Left: case GDK_Up: case GDK_Page_Up: prevSlide(); break; case GDK_F5: /* Switch to fullscreen (if needed) and start the timer * (unless it's already running). */ if (!isFullScreen) toggleFullScreen(); if (timerMode != 1) toggleTimer(); break; case GDK_F6: /* this shall trigger a hard refresh, so empty the cache. */ clearCache(); break; case GDK_w: runpref.fit_mode = FIT_WIDTH; break; case GDK_h: runpref.fit_mode = FIT_HEIGHT; break; case GDK_p: runpref.fit_mode = FIT_PAGE; break; case GDK_l: current_fixate(); break; case GDK_L: current_release(FALSE); break; case GDK_J: current_release(TRUE); break; case GDK_f: toggleFullScreen(); break; case GDK_s: toggleTimer(); changed = FALSE; break; case GDK_c: toggleCurserVisibility(); break; case GDK_r: resetTimer(); changed = FALSE; break; case GDK_Escape: case GDK_q: if (prefs.q_exits_fullscreen && isFullScreen) { toggleFullScreen(); if (prefs.stop_timer_on_fs) { toggleTimer(); } } else { changed = FALSE; onQuit(NULL, NULL, NULL); } break; case GDK_i: /* This must not work when we're on the beamer window. */ if (widget != win_beamer) setEditingState(TRUE); changed = FALSE; break; case GDK_Return: if (executeJump() == 0) nextSlide(); break; case GDK_G: executeJump(); break; case GDK_period: case GDK_b: toggleBlankBeamer(); changed = FALSE; break; default: changed = FALSE; } if (changed == TRUE) { refreshPorts(); } return TRUE; }