viseme.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __VISEME_H_
  19. #define __VISEME_H_
  20. /*typedef enum VISEME_ID
  21. {
  22. VISEME_CAT = 1, // 0 "cAt"
  23. VISEME_EAT = 2, // 1 "EAt"
  24. VISEME_IF = 1, // 2 "If"
  25. VISEME_OX = 4, // 3 "Ox"
  26. VISEME_WET = 5, // 4 "Wet", "bOOt"
  27. VISEME_UP = 5, // 5 "Up"
  28. VISEME_ROAR = 7, // 6 "Roar"
  29. VISEME_FAVE = 3, // 7 "Fart", "Van"
  30. VISEME_CHURCH = 6, // 8 "CHurch", "SHoot"
  31. VISEME_BUMP = 0, // 9 "Bump", "p", "m"
  32. VISEME_THOUGH = 6, // 10 "THough", "THen"
  33. VISEME_TOLD = 7, // 11 'Told'
  34. VISEME_CAGE = 7, // 12 'K', 'ck'
  35. VISEME_NEW = 7, // 13 "New"
  36. VISEME_SIZE = 7, // 14 "Size", "Zip"
  37. VISEME_EARTH = 2, // 15 "buttER"
  38. VISEME_COUNT = 8,
  39. } VISEME_ID;*/
  40. typedef enum VISEME_ID
  41. {
  42. VISEME_CAT = 0, // 0 "cAt"
  43. VISEME_EAT, // 1 "EAt"
  44. VISEME_IF, // 2 "If"
  45. VISEME_OX, // 3 "Ox"
  46. VISEME_WET, // 4 "Wet", "bOOt"
  47. VISEME_UP, // 5 "Up"
  48. VISEME_ROAR, // 6 "Roar"
  49. VISEME_FAVE, // 7 "Fart", "Van"
  50. VISEME_CHURCH, // 8 "CHurch", "SHoot"
  51. VISEME_BUMP, // 9 "Bump", "p", "m"
  52. VISEME_THOUGH, // 10 "THough", "THen"
  53. VISEME_TOLD, // 11 'Told'
  54. VISEME_CAGE, // 12 'K', 'ck'
  55. VISEME_NEW, // 13 "New"
  56. VISEME_SIZE, // 14 "Size", "Zip"
  57. VISEME_EARTH, // 15 "buttER"
  58. VISEME_COUNT,
  59. } VISEME_ID;
  60. class VisemeManager
  61. {
  62. public:
  63. VisemeManager(void);
  64. int Get_Visemes(const char *pword, int *visemelist, int maxvisemes=255) const;
  65. private:
  66. int Lookup(const char *pchar, const char *pword, int viseme[]) const;
  67. int Do_Letter_a(const char *pchar, char prevchar, int *viseme) const;
  68. int Do_Letter_e(const char *pchar, char prevchar, int *viseme) const;
  69. int Do_Letter_i(const char *pchar, char prevchar, int *viseme) const;
  70. int Do_Letter_o(const char *pchar, char prevchar, int *viseme) const;
  71. int Do_Letter_u(const char *pchar, char prevchar, int *viseme) const;
  72. int Do_Letter_s(const char *pchar, char prevchar, int *viseme) const;
  73. int Do_Letter_t(const char *pchar, char prevchar, int *viseme) const;
  74. };
  75. #endif