Rename and move frontend/menu/disp/tween.c to frontend/menu/menu_animation.c

This commit is contained in:
twinaphex 2014-10-10 19:53:13 +02:00
parent ddd210d4f0
commit 50a45ab073
8 changed files with 65 additions and 20 deletions

View File

@ -280,7 +280,7 @@ ifeq ($(HAVE_MENU_COMMON), 1)
frontend/menu/menu_action.o \ frontend/menu/menu_action.o \
frontend/menu/menu_shader.o \ frontend/menu/menu_shader.o \
frontend/menu/menu_entries.o \ frontend/menu/menu_entries.o \
frontend/menu/disp/tween.o frontend/menu/menu_animation.o
endif endif
ifeq ($(HAVE_FREETYPE), 1) ifeq ($(HAVE_FREETYPE), 1)

View File

@ -35,7 +35,7 @@
#include "../../../settings_data.h" #include "../../../settings_data.h"
#include "../disp/lakka.h" #include "../disp/lakka.h"
#include "../disp/tween.h" #include "../menu_animation.h"
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "../../../config.h" #include "../../../config.h"

View File

@ -1,7 +1,6 @@
/* RetroArch - A frontend for libretro. /* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis * Copyright (C) 2011-2014 - Daniel De Matteis
* Copyright (C) 2012-2014 - Michael Lelli * Copyright (C) 2014 - Jean-André Santoni
* *
* RetroArch is free software: you can redistribute it and/or modify it under the terms * RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found- * of the GNU General Public License as published by the Free Software Found-

View File

@ -42,7 +42,7 @@
#include "../../../gfx/fonts/bitmap.h" #include "../../../gfx/fonts/bitmap.h"
#include "lakka.h" #include "lakka.h"
#include "tween.h" #include "../menu_animation.h"
static const GLfloat lakka_vertex[] = { static const GLfloat lakka_vertex[] = {
0, 0, 0, 0,

View File

@ -1,7 +1,6 @@
/* RetroArch - A frontend for libretro. /* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis * Copyright (C) 2011-2014 - Daniel De Matteis
* Copyright (C) 2012-2014 - Michael Lelli * Copyright (C) 2014 - Jean-André Santoni
* *
* RetroArch is free software: you can redistribute it and/or modify it under the terms * RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found- * of the GNU General Public License as published by the Free Software Found-
@ -39,7 +38,7 @@
#include "../../../screenshot.h" #include "../../../screenshot.h"
#include "shared.h" #include "shared.h"
#include "tween.h" #include "../menu_animation.h"
#ifndef XMB_THEME #ifndef XMB_THEME
#define XMB_THEME "monochrome" #define XMB_THEME "monochrome"

View File

@ -1,4 +1,20 @@
#include "tween.h" /* RetroArch - A frontend for libretro.
* Copyright (C) 2011-2014 - Daniel De Matteis
* Copyright (C) 2014 - Jean-André Santoni
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "menu_animation.h"
#include <math.h> #include <math.h>
static tween_t* tweens = NULL; static tween_t* tweens = NULL;

View File

@ -1,5 +1,4 @@
/* RetroArch - A frontend for libretro. /* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
* Copyright (C) 2011-2014 - Daniel De Matteis * Copyright (C) 2011-2014 - Daniel De Matteis
* Copyright (C) 2014 - Jean-André Santoni * Copyright (C) 2014 - Jean-André Santoni
* *
@ -15,13 +14,13 @@
* If not, see <http://www.gnu.org/licenses/>. * If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef _TWEEN_H #ifndef _MENU_DISPLAY_H
#define _TWEEN_H #define _MENU_DISPLAY_H
#include <stdint.h>
#include <stdlib.h> #include <stdlib.h>
typedef float (*easingFunc)(float, float, float, float); typedef float (*easingFunc)(float, float, float, float);
typedef void (*tweenCallback) (void); typedef void (*tweenCallback) (void);
typedef struct typedef struct
@ -36,45 +35,77 @@ typedef struct
tweenCallback callback; tweenCallback callback;
} tween_t; } tween_t;
void add_tween(float duration, float target_value, void add_tween(float duration, float target_value, float* subject,
float* subject, easingFunc easing, tweenCallback callback); easingFunc easing, tweenCallback callback);
void update_tweens(float dt); void update_tweens(float dt);
// from https://github.com/kikito/tween.lua/blob/master/tween.lua /* from https://github.com/kikito/tween.lua/blob/master/tween.lua */
float linear(float t, float b, float c, float d); float linear(float t, float b, float c, float d);
float inQuad(float t, float b, float c, float d); float inQuad(float t, float b, float c, float d);
float outQuad(float t, float b, float c, float d); float outQuad(float t, float b, float c, float d);
float inOutQuad(float t, float b, float c, float d); float inOutQuad(float t, float b, float c, float d);
float outInQuad(float t, float b, float c, float d); float outInQuad(float t, float b, float c, float d);
float inCubic(float t, float b, float c, float d); float inCubic(float t, float b, float c, float d);
float outCubic(float t, float b, float c, float d); float outCubic(float t, float b, float c, float d);
float inOutCubic(float t, float b, float c, float d); float inOutCubic(float t, float b, float c, float d);
float outInCubic(float t, float b, float c, float d); float outInCubic(float t, float b, float c, float d);
float inQuart(float t, float b, float c, float d); float inQuart(float t, float b, float c, float d);
float outQuart(float t, float b, float c, float d); float outQuart(float t, float b, float c, float d);
float inOutQuart(float t, float b, float c, float d); float inOutQuart(float t, float b, float c, float d);
float outInQuart(float t, float b, float c, float d); float outInQuart(float t, float b, float c, float d);
float inQuint(float t, float b, float c, float d); float inQuint(float t, float b, float c, float d);
float outQuint(float t, float b, float c, float d); float outQuint(float t, float b, float c, float d);
float inOutQuint(float t, float b, float c, float d); float inOutQuint(float t, float b, float c, float d);
float outInQuint(float t, float b, float c, float d); float outInQuint(float t, float b, float c, float d);
float inSine(float t, float b, float c, float d); float inSine(float t, float b, float c, float d);
float outSine(float t, float b, float c, float d); float outSine(float t, float b, float c, float d);
float inOutSine(float t, float b, float c, float d); float inOutSine(float t, float b, float c, float d);
float outInSine(float t, float b, float c, float d); float outInSine(float t, float b, float c, float d);
float inExpo(float t, float b, float c, float d); float inExpo(float t, float b, float c, float d);
float outExpo(float t, float b, float c, float d); float outExpo(float t, float b, float c, float d);
float inOutExpo(float t, float b, float c, float d); float inOutExpo(float t, float b, float c, float d);
float outInExpo(float t, float b, float c, float d); float outInExpo(float t, float b, float c, float d);
float inCirc(float t, float b, float c, float d); float inCirc(float t, float b, float c, float d);
float outCirc(float t, float b, float c, float d); float outCirc(float t, float b, float c, float d);
float inOutCirc(float t, float b, float c, float d); float inOutCirc(float t, float b, float c, float d);
float outInCirc(float t, float b, float c, float d); float outInCirc(float t, float b, float c, float d);
float inBounce(float t, float b, float c, float d); float inBounce(float t, float b, float c, float d);
float outBounce(float t, float b, float c, float d); float outBounce(float t, float b, float c, float d);
float inOutBounce(float t, float b, float c, float d); float inOutBounce(float t, float b, float c, float d);
float outInBounce(float t, float b, float c, float d); float outInBounce(float t, float b, float c, float d);
#endif /* TWEEN_H */ #endif

View File

@ -650,6 +650,7 @@ MENU
#include "../frontend/menu/menu_entries.c" #include "../frontend/menu/menu_entries.c"
#include "../frontend/menu/menu_shader.c" #include "../frontend/menu/menu_shader.c"
#include "../frontend/menu/menu_navigation.c" #include "../frontend/menu/menu_navigation.c"
#include "../frontend/menu/menu_animation.c"
#include "../frontend/menu/backend/menu_common_backend.c" #include "../frontend/menu/backend/menu_common_backend.c"
#endif #endif
@ -667,7 +668,6 @@ MENU
#endif #endif
#ifdef HAVE_OPENGL #ifdef HAVE_OPENGL
#include "../frontend/menu/disp/tween.c"
#ifdef HAVE_LAKKA #ifdef HAVE_LAKKA
#include "../frontend/menu/backend/menu_lakka_backend.c" #include "../frontend/menu/backend/menu_lakka_backend.c"