Initial commit

This commit is contained in:
2026-02-02 04:50:13 +01:00
commit 5b11698731
22592 changed files with 7677434 additions and 0 deletions

View File

@@ -0,0 +1,775 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#define FORBIDDEN_SYMBOL_EXCEPTION_strcpy
#include "watchmaker/t2d/expr.h"
#include "watchmaker/windows_hacks.h"
#include "watchmaker/globvar.h"
#define MAX_VISEMA 1000
#define MIN_VISEMA_LENG 70
#define RandomInt(Max) (rand()%(Max+1))
#define RandomFloat(Max) ((float)rand()/MAX_RAND)*Max)
#define VIS_DEFAULT_TIME -10
#define VIS_NULL -999
#define WAVE_TOLLERANCE 15
#define MAXCICLES 10000
#define CICLECONTROL(CV) { CV++; if (CV>MAXCICLES) break; }
#define VIS_PAUSE_VAR 30
//#define PROVAMODE
namespace Watchmaker {
struct SilbsStruct {
const char *Text;
int Res[3];
} Silbs[] = {
{ " ", {14, -1, -1} },
{ ",", {14, -1, -1} },
{ "'", {-1, -1, -1} },
{ ";", {14, -1, -1} },
{ ".", {0, 14, 0} },
{ ":", {0, -1, -1} },
{ "?", {0, 14, 0} },
{ "!", {0, 14, 0} },
{ "-", {14, -1, -1} },
{ "<", {-1, -1, -1} },
{ ">", {-1, -1, -1} },
{ "a", {13, -1, -1} },
{ "ae", {11, -1, -1} },
{ "b", {1, -1, -1} },
{ "bb", {1, -1, -1} },
{ "c", {9, -1, -1} },
{ "cc", {9, -1, -1} },
{ "ch", {8, -1, -1} },
{ "ck", {9, -1, -1} },
{ "ce", {7, -1, -1} },
{ "ci", {7, -1, -1} },
{ "d", {7, -1, -1} },
{ "dd", {7, -1, -1} },
{ "det", {10, 7, -1} },
{ "ded", {10, 7, -1} },
{ "e", {11, -1, -1} },
{ "5e", {11, -1, -1} },
{ "ea", {10, -1, -1} },
{ "ee", {10, -1, -1} },
{ "e|", {10, -1, -1} },
{ "$e|", {-1, -1, -1} },
{ "ed|", {7, -1, -1} },
{ "en|", {7, -1, -1} },
{ "et|", {7, -1, -1} },
{ "ened|", {7, -1, -1} },
{ "f", {4, -1, -1} },
{ "ff", {4, -1, -1} },
{ "g", {9, -1, -1} },
{ "gp", {1, -1, -1} },
{ "gb", {1, -1, -1} },
{ "gm", {1, -1, -1} },
{ "gg", {9, -1, -1} },
{ "gh", {-1, -1, -1} },
{ "h", {-1, -1, -1} },
{ "i", {10, -1, -1} },
{ "j", {8, -1, -1} },
{ "ja", {8, -1, -1} },
{ "je", {8, -1, -1} },
{ "ji", {8, -1, -1} },
{ "jo", {8, -1, -1} },
{ "ju", {8, -1, -1} },
{ "k", {9, -1, -1} },
{ "kk", {9, -1, -1} },
{ "l", {6, -1, -1} },
{ "ll", {6, -1, -1} },
{ "m", {1, -1, -1} },
{ "mm", {1, -1, -1} },
{ "n", {7, -1, -1} },
{ "nn", {7, -1, -1} },
{ "nd", {7, -1, -1} },
{ "ng", {9, -1, -1} },
{ "nt", {9, -1, -1} },
{ "ntr", {9, -1, -1} },
{ "nce|", {9, -1, -1} },
{ "o", {12, -1, -1} },
{ "oo", {2, 2, -1} },
{ "ou", {12, -1, -1} },
{ "or", {13, -1, -1} },
{ "ou|", {2, -1, -1} },
{ "one", {7, 11, 1} },
{ "oul", {2, -1, -1} },
{ "p", {1, -1, -1} },
{ "pp", {1, -1, -1} },
{ "q", {9, 2, -1} },
{ "qq", {9, 2, -1} },
{ "rr", {3, -1, -1} },
{ "|r", {3, -1, -1} },
{ "%r", {7, -1, -1} },
{ "$r<>", {3, -1, -1} },
{ "<EFBFBD>r%", {-1, -1, -1} },
{ "s", {7, -1, -1} },
{ "ss", {7, -1, -1} },
{ "si", {8, -1, -1} },
{ "sh", {8, -1, -1} },
{ "some", {2, 11, 7} },
{ "t", {7, -1, -1} },
{ "tt", {7, -1, -1} },
{ "th", {5, -1, -1} },
{ "ted", {10, 7, -1} },
{ "tet", {10, 7, -1} },
{ "tp", {1, -1, -1} },
{ "tm", {1, -1, -1} },
{ "tb", {1, -1, -1} },
{ "u", {11, -1, -1} },
{ "uh", {9, -1, -1} },
{ "v", {4, -1, -1} },
{ "vv", {4, -1, -1} },
{ "w", {2, -1, -1} },
{ "ww", {2, -1, -1} },
{ "wa", {2, 12, -1} },
{ "x", {7, -1, -1} },
{ "xx", {7, -1, -1} },
{ "y", {9, -1, -1} },
{ "y|", {8, -1, -1} },
{ "z", {7, -1, -1} },
{ "zz", {7, -1, -1} }
};
//Spiegazione caratteri:
// <20> vocale
// $ consonante
// % qualcosa
// | fine parola
// i numeri all'inizio o alla fine indicano i visemi precedenti o successivi
// La priorit<69> <20> data dalla posizione, il piu in alto viene scelto
//Il visema 14 <20> un random fra la pausa con occhi aperti (0) e quella con occhi chiusi (14)
//Il visema 15 <20> un random fra la pausa veloce con occhi aperti (11) e quella con occhi chiusi (15)
#define NumSilbs 106
struct VisemaBufStruct {
int Visema; //Id del visema
int TimeLeng; //Lunghezza in milliseconda
};
struct VisemaBufStruct VisemaBuf[MAX_VISEMA];
int risFaces[MAX_VISEMA]; //Buffer dove verranno registrati i visemi della frase
int TotTime; //Durata della frase in millisecondi
int TimeXVis; //Tempo in millisecondi per ogni visema
int NumVis; //Numero dei visemi
int VisDefaultTime = 75;
bool VisemaInitialized = false;
//Gestione Wave
#ifndef ER_MEM
#define ER_MEM 0xe000
#endif
#ifndef ER_CANNOTOPEN
#define ER_CANNOTOPEN 0xe100
#endif
#ifndef ER_NOTWAVEFILE
#define ER_NOTWAVEFILE 0xe101
#endif
#ifndef ER_CANNOTREAD
#define ER_CANNOTREAD 0xe102
#endif
#ifndef ER_CORRUPTWAVEFILE
#define ER_CORRUPTWAVEFILE 0xe103
#endif
#ifndef ER_CANNOTWRITE
#define ER_CANNOTWRITE 0xe104
#endif
//Fine Gestione Wave
//Controlla se un carattere rappresenta una vocale
bool Vocale(char C) {
C = tolower(C);
if ((C == 'a') | (C == 'e') | (C == 'i') | (C == 'o') | (C == 'u'))
return true;
else return false;
}
//Da carattere a intero
int ctoi(char C) {
char Text[2];
Text[0] = C;
Text[1] = 0;
return atoi(Text);
}
//Restituisce la lunghezza reale di un silb
//Praticamente restituisce la lunghezza - i caratteri speciali
int TrueSilbLeng(int Silb) {
int Leng = 0;
unsigned int i;
for (i = 0; i < strlen(Silbs[Silb].Text); i++) {
warning("TODO: Properly fix the special character handling in TrueSilbLeng");
if ((Silbs[Silb].Text[i] != '|') && // (Silbs[Silb].Text[i]!='<27>') &&
(Silbs[Silb].Text[i] != '$') && (Silbs[Silb].Text[i] != '%') &&
((Silbs[Silb].Text[i] < '0') || (Silbs[Silb].Text[i] > '9'))) Leng++;
}
return Leng;
}
//Riconosce i silbs in una stringa
bool SilbRecon(char *Text, int tp, int LastVis, int NewSilb, int *CurrentSilb) {
int TextLen = strlen(Text);
int NewSilbLeng = strlen(Silbs[NewSilb].Text);
int CurrentSilbLeng = 0;
int i;
bool Equal;
if (*CurrentSilb != -1) CurrentSilbLeng = strlen(Silbs[*CurrentSilb].Text);
if (NewSilbLeng <= CurrentSilbLeng) return FALSE;
for (i = 0; i < NewSilbLeng; i++) {
Equal = false;
switch (Silbs[NewSilb].Text[i]) {
case '|':
if ((i == 0) && ((tp == 0) || ((tolower(Text[tp - 1] < 'a')) && (tolower(Text[tp - 1] > 'z'))))) Equal = TRUE;
if ((i != 0) && ((tp == TextLen) || ((tolower(Text[tp]) < 'a') || (tolower(Text[tp]) > 'z')))) Equal = TRUE;
break;
case (char)0xA3: // '£' // TODO: Create a proper constant for the Pound symbol.
if ((i == 0) && (tp > 0) && (Vocale(Text[tp - 1]))) Equal = TRUE;
if ((i != 0) && (Vocale(Text[tp]))) {
Equal = TRUE;
tp++;
}
break;
case '$':
if ((i == 0) && (tp > 0) && (!Vocale(Text[tp - 1]))) Equal = TRUE;
if ((i != 0) && (!Vocale(Text[tp]))) {
Equal = TRUE;
tp++;
}
break;
case '%':
if ((i == 0) && (tolower(Text[tp - 1]) >= 'a') && (tolower(Text[tp - 1]) <= 'z')) Equal = TRUE;
if ((i != 0) && (tolower(Text[tp]) >= 'a') && (tolower(Text[tp]) <= 'z')) {
Equal = TRUE;
tp++;
}
break;
default:
if ((Silbs[NewSilb].Text[i] >= '0') && (Silbs[NewSilb].Text[i] <= '9')) {
if (LastVis == ctoi(Silbs[NewSilb].Text[i]))
Equal = TRUE;
else Equal = false;
} else {
if (tolower(Text[tp]) == Silbs[NewSilb].Text[i]) Equal = TRUE;
tp++;
}
break;
}
if (Equal == FALSE) return FALSE;
}
*CurrentSilb = NewSilb;
return TRUE;
}
//Riconosce le pause in un file wave
int WavePauseRecon(int32 /*n*/, int /*PauseBuf*/[100][5]) {
warning("STUBBED: WavePauseRecon");
#if 0
WAVEFORMATEX *pwfxInfo;
MMCKINFO ckIn;
MMCKINFO ckInRIFF;
HMMIO hmmioIn;
UINT cbActualRead;
BYTE *Buffer;
int Size;
int i;
int Pausa, NPause = 0, PausaStart = -1, PausaEnd = -1;
int Play, PlayStart = -1, PlayEnd = -1;
int Var = WAVE_TOLLERANCE;
int MinLeng = 300;
int IgnoreLeng = 10;
int Centro = 0;
char FileName[MAX_PATH];
sprintf(FileName, "%ss%04d.wav", WmSpeechDir, n);
//Per prove
#ifdef PROVAMODE
if (strcmp(Sound[wPROVA].name, "") == 0) return -1;
if (WaveOpenFile(Sound[wPROVA].name, &hmmioIn, &pwfxInfo, &ckInRIFF) != 0) return -1;
* /
#else
if (WaveOpenFile(FileName, &hmmioIn, &pwfxInfo, &ckInRIFF) != 0) return -1;
#endif
if (WaveStartDataRead(&hmmioIn, &ckIn, &ckInRIFF) != 0) return -1;
Size = ckIn.cksize;
Buffer = (BYTE *)VirtualAlloc(NULL, Size, MEM_COMMIT, PAGE_READWRITE);
if (Buffer == NULL) return -1;
if (WaveReadFile(hmmioIn, Size, Buffer, &ckIn, &cbActualRead) != 0) return -1;
Centro = (1 << pwfxInfo->wBitsPerSample) / 2;
Pausa = -999;
Play = -999;
for (i = 0; i < Size; i++) {
if ((Buffer[i] >= Centro - Var) && (Buffer[i] <= Centro + Var)) {
//Pausa
if (PausaStart == -1) PausaStart = i;
Pausa = i;
} else {
//Play
if (PlayStart == -1) PlayStart = i;
Play = i;
if (i == Pausa + IgnoreLeng) {
//FinePausa
PausaEnd = i - IgnoreLeng;
if (PausaEnd - PausaStart > MinLeng) {
PauseBuf[NPause][0] = (int)(((double)PausaStart / pwfxInfo->nSamplesPerSec) * 1000);
PauseBuf[NPause][1] = (int)(((double)PausaEnd / pwfxInfo->nSamplesPerSec) * 1000);
NPause++;
}
PausaStart = -1;
}
}
}
if (PausaStart != -1) {
PausaEnd = Size;
PauseBuf[NPause][0] = (int)(((double)PausaStart / pwfxInfo->nSamplesPerSec) * 1000);
PauseBuf[NPause][1] = (int)(((double)PausaEnd / pwfxInfo->nSamplesPerSec) * 1000);
NPause++;
}
i = pwfxInfo->nSamplesPerSec;
WaveCloseReadFile(&hmmioIn, &pwfxInfo);
return (int)((double)Size / i * 1000.0);
#else
return 0;
#endif
}
//Restituisce il tempo del discorso a un determinato visema
int VisemaBufTimeLeng(struct VisemaBufStruct *Buf, int Leng) {
int i;
int TimeLeng = 0;
for (i = 0; i < Leng; i++) {
if (Buf[i].TimeLeng == VIS_NULL) continue;
if (Buf[i].TimeLeng == VIS_DEFAULT_TIME)
TimeLeng += VisDefaultTime;
else TimeLeng += Buf[i].TimeLeng;
}
return TimeLeng;
}
//Riconosce le pause probabili in una lista di visemi rappresentanti una frase
bool ProbPauseRecon(int ProbPause[100][5]) {
int LastVis = -2;
int i;
int NPause = 0;
LastVis = -1;
for (i = 0; i < NumVis; i++) {
if ((VisemaBuf[i].Visema == 0) || (VisemaBuf[i].Visema == 14) || (VisemaBuf[i].Visema == 15)) {
if ((LastVis != 0) && (LastVis != 14) && (LastVis != 15)) {
ProbPause[NPause][0] = VisemaBufTimeLeng(VisemaBuf, i);
ProbPause[NPause][2] = i;
}
} else {
if ((LastVis == 0) || (LastVis == 14) || (LastVis == 15)) {
ProbPause[NPause][1] = VisemaBufTimeLeng(VisemaBuf, i);
ProbPause[NPause++][3] = i;
}
}
LastVis = VisemaBuf[i].Visema;
}
if ((LastVis == 0) || (LastVis == 14) || (LastVis == 15)) {
ProbPause[NPause][1] = VisemaBufTimeLeng(VisemaBuf, i);
ProbPause[NPause++][3] = i;
}
return TRUE;
}
//Restituisce la distanza vera in numero dei visemi
//Praticamente la distanza - il numero dei visemi speciali
int TrueVisemaDist(struct VisemaBufStruct */*Buf*/, int Start, int End) {
int i;
int Leng = 0;
for (i = Start; i < End; i++) {
if (VisemaBuf[i].TimeLeng != VIS_NULL) Leng++;
}
return Leng;
}
// Sovrappone le pause probabili con le pause del wave, e calcola di conseguenza
// il TimeLeng dei visemi.
bool PauseOnPause(int32 n) {
int LastVis = -2;
int i, j;
int Rnd;
int DistCentro;
int ProbPause[500][5]; //Posizione probabile delle pause
int WavePause[500][5]; //(TimeStart, TimeEnd, VisStart, VisEnd, Misc)
// int NPause=0;
//Inizializzazione Buffers
for (i = 0; i < 100; i++) {
ProbPause[i][0] = -1;
ProbPause[i][1] = -1;
ProbPause[i][2] = -1;
ProbPause[i][3] = -1;
ProbPause[i][4] = -1;
WavePause[i][0] = -1;
WavePause[i][1] = -1;
WavePause[i][2] = -1;
WavePause[i][3] = -1;
WavePause[i][4] = -1;
}
i = -1;
//Riconoscimento pause nel Wave
i = WavePauseRecon(n, WavePause);
if (i == -1) return FALSE;
VisDefaultTime = i / (NumVis - 2);
//Riconoscimento pause probabili
ProbPauseRecon(ProbPause);
//Sovrapposizione pause
j = 0;
while (WavePause[j][0] != -1) {
i = 0;
DistCentro = -1;
while (ProbPause[i][0] != -1) {
if (((ProbPause[i][0] > WavePause[j][0] - VIS_PAUSE_VAR) && (ProbPause[i][1] < WavePause[j][1] + VIS_PAUSE_VAR)) ||
((ProbPause[i][0] < WavePause[j][0] + VIS_PAUSE_VAR) && (ProbPause[i][1] > WavePause[j][0] - VIS_PAUSE_VAR) && (ProbPause[i][1] < WavePause[j][1] + VIS_PAUSE_VAR)) ||
((ProbPause[i][0] > WavePause[j][0] - VIS_PAUSE_VAR) && (ProbPause[i][0] < WavePause[j][1] + VIS_PAUSE_VAR) && (ProbPause[i][1] > WavePause[j][1] - VIS_PAUSE_VAR)) ||
((ProbPause[i][0] < WavePause[j][0] + VIS_PAUSE_VAR) && (ProbPause[i][1] > WavePause[j][1] - VIS_PAUSE_VAR))) {
/*if (DistCentro==-1)
{
WavePause[j][2]=ProbPause[i][2];
WavePause[j][3]=ProbPause[i][3];
DistCentro=abs((ProbPause[i][0]+ProbPause[i][1])/2-(WavePause[j][0]-WavePause[j][1])/2);
}
else
{
Rnd=abs((ProbPause[i][0]+ProbPause[i][1])/2-(WavePause[j][0]-WavePause[j][1])/2);
if (Rnd<DistCentro)
{
DistCentro=Rnd;
WavePause[j][2]=ProbPause[i][2];
WavePause[j][3]=ProbPause[i][3];
}
}
break;*/
/*if (DistCentro==-1)
{
if (WavePause[j][4]==-1)
{
WavePause[j][2]=ProbPause[i][2];
WavePause[j][3]=ProbPause[i][3];
DistCentro=abs((ProbPause[i][0]+ProbPause[i][1])/2-(WavePause[j][0]-WavePause[j][1])/2);
WavePause[j][4]=DistCentro;
}
else
{
DistCentro=abs((ProbPause[i][0]+ProbPause[i][1])/2-(WavePause[j][0]-WavePause[j][1])/2);
if (DistCentro<WavePause[j][4])
{
WavePause[j][2]=ProbPause[i][2];
WavePause[j][3]=ProbPause[i][3];
WavePause[j][4]=DistCentro;
}
}
}
else
{
Rnd=abs((ProbPause[i][0]+ProbPause[i][1])/2-(WavePause[j][0]-WavePause[j][1])/2);
if (Rnd<DistCentro)
{
WavePause[j][2]=ProbPause[i][2];
WavePause[j][3]=ProbPause[i][3];
DistCentro=Rnd;
WavePause[j][4]=DistCentro;
}
}*/
if (DistCentro == -1) {
WavePause[j][2] = ProbPause[i][2];
WavePause[j][3] = ProbPause[i][3];
DistCentro = abs((ProbPause[i][0] + ProbPause[i][1]) / 2 - (WavePause[j][0] + WavePause[j][1]) / 2);
//DistCentro=abs(ProbPause[i][0]-WavePause[j][0]);
WavePause[j][4] = i;
ProbPause[i][4] = j;
} else {
Rnd = abs((ProbPause[i][0] + ProbPause[i][1]) / 2 - (WavePause[j][0] + WavePause[j][1]) / 2);
//Rnd=abs(ProbPause[i][0]-WavePause[j][0]);
if (Rnd < DistCentro) {
WavePause[j][2] = ProbPause[i][2];
WavePause[j][3] = ProbPause[i][3];
ProbPause[WavePause[j][4]][4] = -1;
WavePause[j][4] = i;
ProbPause[i][4] = j;
DistCentro = Rnd;
}
}
}
i++;
}
j++;
}
//Fine Sovrapposizione pause
//Controllo pause non trovate
i = 0;
while (ProbPause[i][0] != -1) {
j = 0;
DistCentro = false;
while (WavePause[j][0] != -1) {
if ((WavePause[j][2] == ProbPause[i][2]) && (WavePause[j][3] == ProbPause[i][3])) {
DistCentro = TRUE;
break;
}
j++;
}
if (!DistCentro) {
for (j = ProbPause[i][2]; j < ProbPause[i][3]; j++)
VisemaBuf[j].TimeLeng = VIS_NULL;
}
i++;
}
//Fine Controllo pause non trovate
//Calcolo TimeLeng dei visemi in base alle pause trovate
j = 0;
LastVis = 0;
while (WavePause[j][0] != -1) {
if (WavePause[j][2] == -1) {
j++;
continue;
}
if (TrueVisemaDist(VisemaBuf, LastVis, WavePause[j][2]) > 0) {
TimeXVis = (WavePause[j][0] - VisemaBufTimeLeng(VisemaBuf, LastVis)) / (TrueVisemaDist(VisemaBuf, LastVis, WavePause[j][2]));
//Correzione Velocit<69>
i = 0;
while ((TimeXVis < MIN_VISEMA_LENG) && (TimeXVis != 0)) {
CICLECONTROL(i);
error("TODO: Randomness");
#if 0
Rnd = LastVis + RandomInt(WavePause[j][2] - LastVis - 1);
#endif
if (VisemaBuf[Rnd].Visema != 0)
VisemaBuf[Rnd].TimeLeng = VIS_NULL;
if (TrueVisemaDist(VisemaBuf, LastVis, WavePause[j][2]) == 0) break;
TimeXVis = (WavePause[j][0] - VisemaBufTimeLeng(VisemaBuf, LastVis)) / (TrueVisemaDist(VisemaBuf, LastVis, WavePause[j][2]));
}
//Fine Correzione Velocit<69>
for (i = LastVis; i < WavePause[j][2]; i++) {
if (VisemaBuf[i].TimeLeng != VIS_NULL)
VisemaBuf[i].TimeLeng = TimeXVis;
}
}
if (TrueVisemaDist(VisemaBuf, WavePause[j][2], WavePause[j][3]) > 0) {
TimeXVis = (WavePause[j][1] - WavePause[j][0]) / (TrueVisemaDist(VisemaBuf, WavePause[j][2], WavePause[j][3]));
for (i = WavePause[j][2]; i < WavePause[j][3]; i++) {
if (VisemaBuf[i].TimeLeng != VIS_NULL)
VisemaBuf[i].TimeLeng = TimeXVis;
}
}
LastVis = WavePause[j][3];
j++;
}
//Fine Calcolo TimeLeng dei visemi in base alle pause trovate
return TRUE;
}
//Funzione principale del lip-sync
//Riconosce i silb, trova le pause, le sovrappone, e setta le variabili globali
int VisemaRecon(int32 n) {
char Text[1000];
int RPos = 0;
int Leng;
int LastVis = -2;
int tp = 0; //Text Position
int i;
int Silb = -1;
int Rnd;
bool Pensiero = false;
//int NPause=0;
strcpy(Text, Sentence[n]);
Leng = strlen(Text);
VisemaInitialized = false;
for (i = 0; i < MAX_VISEMA; i++) {
VisemaBuf[i].Visema = 0;
VisemaBuf[i].TimeLeng = 0;
}
if ((Text[0] == '<') && (Text[Leng - 1] == '>')) Pensiero = TRUE;
// FIXME: condition never happen
//if (Text==NULL) return -1;
error("TODO: Randomness");
#if 0
srand((unsigned int)time(NULL));
#endif
VisemaBuf[RPos].Visema = 0;
VisemaBuf[RPos++].TimeLeng = VIS_NULL;
while (tp < Leng) {
for (i = 0; i < NumSilbs; i++) {
SilbRecon(Text, tp, LastVis, i, &Silb);
}
if (Silb == -1) tp++;
else {
for (i = 0; i < 3; i++) {
if (!Pensiero)
switch (Silbs[Silb].Res[i]) {
case -1:
break;
case 0:
VisemaBuf[RPos].Visema = 0;
VisemaBuf[RPos++].TimeLeng = VIS_DEFAULT_TIME;
LastVis = 0;
break;
case 14:
/*if (RandomInt(100)<80) VisemaBuf[RPos].Visema=0;
else VisemaBuf[RPos].Visema=14;*/
VisemaBuf[RPos].Visema = 0;
VisemaBuf[RPos++].TimeLeng = VIS_DEFAULT_TIME;
LastVis = 0;
break;
case 15:
error("TODO: Randomness");
#if 0
Rnd = RandomInt(100);
#endif
if (Rnd < 15) VisemaBuf[RPos].Visema = 15;
else if (Rnd < 30) VisemaBuf[RPos].Visema = 15;
VisemaBuf[RPos++].TimeLeng = VIS_DEFAULT_TIME;
LastVis = 0;
break;
default:
VisemaBuf[RPos].Visema = Silbs[Silb].Res[i];
VisemaBuf[RPos++].TimeLeng = VIS_DEFAULT_TIME;
LastVis = Silbs[Silb].Res[i];
break;
} else if (Silbs[Silb].Res[i] != -1) {
VisemaBuf[RPos].Visema = 0;
VisemaBuf[RPos++].TimeLeng = VIS_NULL;
}
}
tp += TrueSilbLeng(Silb);
Silb = -1;
}
}
VisemaBuf[RPos].Visema = 0;
VisemaBuf[RPos++].TimeLeng = VIS_NULL;
NumVis = RPos;
PauseOnPause(n);
TotTime = NumVis * VisDefaultTime;
TimeXVis = TotTime / NumVis;
VisemaInitialized = TRUE;
return TotTime;
}
//Restituisce il visema corrispondente a un determinato tempo
int32 VisemaTimeRecon(int32 Time) {
if (Time < 0) return 0;
if (!VisemaInitialized) return 0;
#ifdef PROVAMODE
static bool Partito = FALSE;
if (Time == 0) Partito = FALSE;
if ((!Partito) && (Time > 0)) {
Partito = TRUE;
StartSound(wPROVA);
}
#endif
for (int i = 0; i < NumVis; i++) {
if ((Time >= VisemaBufTimeLeng(VisemaBuf, i)) && (Time < VisemaBufTimeLeng(VisemaBuf, i + 1)))
return VisemaBuf[i].Visema;
}
return VisemaBuf[NumVis - 1].Visema;
}
} // End of namespace Watchmaker

View File

@@ -0,0 +1,34 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef WATCHMAKER_EXPR_H
#define WATCHMAKER_EXPR_H
#include "watchmaker/types.h"
namespace Watchmaker {
int VisemaRecon(int32 n);
int32 VisemaTimeRecon(int32 Time);
} // End of namespace Watchmaker
#endif // WATCHMAKER_EXPR_H

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,38 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef WATCHMAKER_T2D_H
#define WATCHMAKER_T2D_H
#include "watchmaker/game.h"
#include "watchmaker/globvar.h"
#include "watchmaker/renderer.h"
namespace Watchmaker {
void doT2D(WGame &game);
void doT2DMouse(WGame &game);
void doT2DKeyboard(WGame &game);
void PaintT2D(Renderer &renderer);
} // End of namespace Watchmaker
#endif // WATCHMAKER_T2D_H

View File

@@ -0,0 +1,567 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program 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 Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef WATCHMAKER_T2D_INTERNAL_H
#define WATCHMAKER_T2D_INTERNAL_H
#include "watchmaker/types.h"
#define T2D_MAX_WINDOWS 32
#define T2D_MAX_BITMAPS_IN_WIN 64
#define T2D_MAX_TEXTS_IN_WIN 64
#define T2D_MAX_BUTTONS_IN_WIN 64
#define T2D_BM_OFF (1<<31)
#define T2D_BM_SCROLL (1<<30)
#define T2D_BM2TEXT_MASK 0x3F000000
#define T2D_BM2TEXT_SHIFT 24
#define T2D_WIN_SCANNER_BACKGROUND 1
#define T2D_BM_SCANNER_BACKGROUND_WIN 0
#define T2D_BM_SCANNER_BACKGROUND_EXIT 1
#define T2D_BM_SCANNER_BACKGROUND_PIC_LOW 2
#define T2D_BM_SCANNER_BACKGROUND_PIC_HI 3
#define T2D_BM_SCANNER_BACKGROUND_SELECTOR 4
#define T2D_BT_SCANNER_BACKGROUND_EXIT 1
#define T2D_BT_SCANNER_BACKGROUND_SELECTOR 2
#define T2D_WIN_SCANNER_TOOLBAR 2
#define T2D_BM_SCANNER_TOOLBAR_WIN 0
#define T2D_BM_SCANNER_TOOLBAR_EXIT 1
#define T2D_BM_SCANNER_TOOLBAR_PREVIEW_FREEZE 2
#define T2D_BM_SCANNER_TOOLBAR_PREVIEW_OFF 3
#define T2D_BM_SCANNER_TOOLBAR_PREVIEW_ON 4
#define T2D_BM_SCANNER_TOOLBAR_SELECTAREA_FREEZE 5
#define T2D_BM_SCANNER_TOOLBAR_SELECTAREA_OFF 6
#define T2D_BM_SCANNER_TOOLBAR_SELECTAREA_ON 7
#define T2D_BM_SCANNER_TOOLBAR_SCAN_FREEZE 8
#define T2D_BM_SCANNER_TOOLBAR_SCAN_OFF 9
#define T2D_BM_SCANNER_TOOLBAR_SCAN_ON 10
#define T2D_BT_SCANNER_TOOLBAR_MOVE 1
#define T2D_BT_SCANNER_TOOLBAR_EXIT 2
#define T2D_BT_SCANNER_TOOLBAR_PREVIEW_OFF 3
#define T2D_BT_SCANNER_TOOLBAR_SELECTAREA_OFF 4
#define T2D_BT_SCANNER_TOOLBAR_SCAN_OFF 5
#define T2D_WIN_SCANNER_PROGRESSBAR 3
#define T2D_BM_SCANNER_PROGRESSBAR_WIN 0
#define T2D_BM_SCANNER_PROGRESSBAR_EXIT 1
#define T2D_BM_SCANNER_PROGRESSBAR_PROGRESS_OFF 2
#define T2D_BM_SCANNER_PROGRESSBAR_PROGRESS_ON 3
#define T2D_BM_SCANNER_PROGRESSBAR_SCANNING_OFF 4
#define T2D_BM_SCANNER_PROGRESSBAR_SCANNING_ON 5
#define T2D_WIN_COMPUTER_BACKGROUND 4
#define T2D_BM_COMPUTER_BACKGROUND_WIN 0
#define T2D_BM_COMPUTER_EMAIL_ON 1
#define T2D_BM_COMPUTER_SEARCH_ON 2
#define T2D_BM_COMPUTER_QUIT_ON 3
#define T2D_BM_COMPUTER_SCRITTE_1 4
#define T2D_BM_COMPUTER_SCRITTE_2 5
#define T2D_BM_COMPUTER_SCRITTE_3 6
#define T2D_BM_COMPUTER_SCRITTE_4 7
#define T2D_BT_COMPUTER_BACKGROUND_EMAIL 1
#define T2D_BT_COMPUTER_BACKGROUND_SEARCH 2
#define T2D_BT_COMPUTER_BACKGROUND_QUIT 3
#define T2D_BT_BackgroundWin_TGA__cia1 4
#define T2D_BT_BackgroundWin_TGA__cia2 5
#define T2D_TEXT_COMPUTER_SCRITTE_1 1
#define T2D_TEXT_COMPUTER_SCRITTE_2 2
#define T2D_TEXT_COMPUTER_SCRITTE_3 3
#define T2D_TEXT_COMPUTER_SCRITTE_4 4
#define T2D_WIN_COMPUTER_ERROR 5
#define T2D_BM_COMPUTER_COMERROR_WIN 0
#define T2D_BM_COMPUTER_DIALERROR_WIN 1
#define T2D_BM_COMPUTER_SEARCHERROR_WIN 2
#define T2D_BM_COMPUTER_ERROR_COMQUIT_ON 3
#define T2D_BM_COMPUTER_ERROR_DIALQUIT_ON 4
#define T2D_BM_COMPUTER_ERROR_DIALUP_ON 5
#define T2D_BM_COMPUTER_ERROR_OK_ON 6
#define T2D_BT_COMPUTER_ERROR_WIN 1
#define T2D_BT_COMPUTER_ERROR_MOVE 2
#define T2D_BT_COMPUTER_ERROR_COMQUIT 3
#define T2D_BT_COMPUTER_ERROR_DIALUP 4
#define T2D_BT_COMPUTER_ERROR_DIALQUIT 5
#define T2D_BT_COMPUTER_ERROR_OK 6
#define T2D_BT_ComError_Win_TGA 7
#define T2D_BT_DialError_Win_TGA 8
#define T2D_BT_SearchError_Win_TGA 9
#define T2D_WIN_COMPUTER_DIALUP 7
#define T2D_BM_COMPUTER_DIALUP_WIN 0
#define T2D_BM_COMPUTER_DIALUP_1_ON 1
#define T2D_BM_COMPUTER_DIALUP_2_ON 2
#define T2D_BM_COMPUTER_DIALUP_3_ON 3
#define T2D_BM_COMPUTER_DIALUP_4_ON 4
#define T2D_BM_COMPUTER_DIALUP_5_ON 5
#define T2D_BM_COMPUTER_DIALUP_6_ON 6
#define T2D_BM_COMPUTER_DIALUP_7_ON 7
#define T2D_BM_COMPUTER_DIALUP_8_ON 8
#define T2D_BM_COMPUTER_DIALUP_9_ON 9
#define T2D_BM_COMPUTER_DIALUP_0_ON 10
#define T2D_BM_COMPUTER_DIALUP_ENTER_ON 11
#define T2D_BM_COMPUTER_DIALUP_C_ON 12
#define T2D_BM_COMPUTER_DIALUP_OK_ON 13
#define T2D_BM_COMPUTER_DIALUP_EXIT_ON 14
#define T2D_BM_COMPUTER_DIALUP_NUMBER 15
#define T2D_BT_COMPUTER_DIALUP_MOVE 1
#define T2D_BT_COMPUTER_DIALUP_1 2
#define T2D_BT_COMPUTER_DIALUP_2 3
#define T2D_BT_COMPUTER_DIALUP_3 4
#define T2D_BT_COMPUTER_DIALUP_4 5
#define T2D_BT_COMPUTER_DIALUP_5 6
#define T2D_BT_COMPUTER_DIALUP_6 7
#define T2D_BT_COMPUTER_DIALUP_7 8
#define T2D_BT_COMPUTER_DIALUP_8 9
#define T2D_BT_COMPUTER_DIALUP_9 10
#define T2D_BT_COMPUTER_DIALUP_0 11
#define T2D_BT_COMPUTER_DIALUP_ENTER 12
#define T2D_BT_COMPUTER_DIALUP_C 13
#define T2D_BT_COMPUTER_DIALUP_OK 14
#define T2D_BT_COMPUTER_DIALUP_EXIT 15
#define T2D_BT_DialUpWin_TGA__Dial 16
#define T2D_BT_DialUpWin_TGA__Enter 17
#define T2D_BT_DialUpWin_TGA__Dialling 18
#define T2D_TEXT_COMPUTER_DIALUP_NUMBER 1
#define T2D_WIN_COMPUTER_SEARCH 8
#define T2D_BM_COMPUTER_SEARCH_ALPHABETICAL_WIN 0
#define T2D_BM_COMPUTER_SEARCH_CASENAME_WIN 1
#define T2D_BM_COMPUTER_SEARCH_SEARCH_ON 2
#define T2D_BM_COMPUTER_SEARCH_EXIT_ON 3
#define T2D_BM_COMPUTER_SEARCH_NAME_ON 4
#define T2D_BM_COMPUTER_SEARCH_SURNAME_ON 5
#define T2D_BM_COMPUTER_SEARCH_CASENAME_ON 6
#define T2D_BM_COMPUTER_SEARCH_YEAR_ON 7
#define T2D_BM_COMPUTER_SEARCH_NAME 8
#define T2D_BM_COMPUTER_SEARCH_SURNAME 9
#define T2D_BM_COMPUTER_SEARCH_CASENAME 10
#define T2D_BM_COMPUTER_SEARCH_YEAR 11
#define T2D_BT_COMPUTER_SEARCH_WIN 1
#define T2D_BT_COMPUTER_SEARCH_MOVE 2
#define T2D_BT_COMPUTER_SEARCH_SEARCH 3
#define T2D_BT_COMPUTER_SEARCH_ALPHABETICAL 4
#define T2D_BT_COMPUTER_SEARCH_CASENAME 5
#define T2D_BT_COMPUTER_SEARCH_NAME_TEXT 6
#define T2D_BT_COMPUTER_SEARCH_SURNAME_TEXT 7
#define T2D_BT_COMPUTER_SEARCH_CASENAME_TEXT 8
#define T2D_BT_COMPUTER_SEARCH_YEAR_TEXT 9
#define T2D_BT_COMPUTER_SEARCH_EXIT 10
#define T2D_BT_Search_Alphabetical_TGA__search 11
#define T2D_BT_Search_Alphabetical_TGA__findby 12
#define T2D_BT_Search_Alphabetical_TGA__name 13
#define T2D_BT_Search_Alphabetical_TGA__surname 14
#define T2D_BT_Search_Alphabetical_TGA__subject 15
#define T2D_BT_Search_Alphabetical_TGA__casename 16
#define T2D_BT_Search_Alphabetical_TGA__year 17
#define T2D_TEXT_COMPUTER_SEARCH_NAME 1
#define T2D_TEXT_COMPUTER_SEARCH_SURNAME 2
#define T2D_TEXT_COMPUTER_SEARCH_CASENAME 3
#define T2D_TEXT_COMPUTER_SEARCH_YEAR 4
#define T2D_WIN_COMPUTER_EMAIL 9
#define T2D_BM_COMPUTER_EMAIL_WIN 0
#define T2D_BM_COMPUTER_EMAIL_EXIT_ON 1
#define T2D_BM_COMPUTER_EMAIL_ICON_1 2
#define T2D_BM_COMPUTER_EMAIL_ICON_2 3
#define T2D_BT_COMPUTER_EMAIL_WIN 1
#define T2D_BT_COMPUTER_EMAIL_MOVE 2
#define T2D_BT_COMPUTER_EMAIL_EXIT 3
#define T2D_BT_COMPUTER_EMAIL_SCROLLUP 4
#define T2D_BT_COMPUTER_EMAIL_SCROLLDOWN 5
#define T2D_BT_COMPUTER_EMAIL_ICON_1 6
#define T2D_BT_COMPUTER_EMAIL_ICON_2 7
#define T2D_BT_EMail_Win_TGA__email 8
#define T2D_BT_EMail_Win_TGA__avail 9
#define T2D_WIN_COMPUTER_DOCUMENT 10
#define T2D_BM_COMPUTER_DOCUMENT_WIN 0
#define T2D_BM_COMPUTER_DOCUMENT_SCROLLUP_ON 1
#define T2D_BM_COMPUTER_DOCUMENT_SCROLLDOWN_ON 2
#define T2D_BM_COMPUTER_DOCUMENT_EXIT_ON 3
#define T2D_BM_COMPUTER_DOCUMENT_FIRST 4
#define T2D_BM_COMPUTER_DOCUMENT_ANTONIOCORONA 4
#define T2D_BM_COMPUTER_DOCUMENT_JACOBKRENN 5
#define T2D_BM_COMPUTER_DOCUMENT_PETERDUKES 6
#define T2D_BM_COMPUTER_DOCUMENT_VICTORVALENCIA 7
#define T2D_BM_COMPUTER_DOCUMENT_MERCURY_1969_1 8
#define T2D_BM_COMPUTER_DOCUMENT_MERCURY_1969_2 9
#define T2D_BM_COMPUTER_DOCUMENT_MERCURY_1969_3 10
#define T2D_BM_COMPUTER_DOCUMENT_MERCURY_1969_4 11
#define T2D_BM_COMPUTER_DOCUMENT_CONFIDENCE_1942_1 12
#define T2D_BM_COMPUTER_DOCUMENT_CONFIDENCE_1942_2 13
#define T2D_BM_COMPUTER_DOCUMENT_CONFIDENCE_1942_3 14
#define T2D_BM_COMPUTER_DOCUMENT_ARL_1998_1 15
#define T2D_BM_COMPUTER_DOCUMENT_CONV_CONFIDENCE 16
#define T2D_BM_COMPUTER_DOCUMENT_CONV_MERCURY 17
#define T2D_BM_COMPUTER_DOCUMENT_GREGOR_MEM 18
#define T2D_BM_COMPUTER_DOCUMENT_BENNA 19
#define T2D_BM_COMPUTER_DOCUMENT_ANDREA 20
#define T2D_BM_COMPUTER_DOCUMENT_BELLONDS 21
#define T2D_BM_COMPUTER_DOCUMENT_DANIELE 22
#define T2D_BM_COMPUTER_DOCUMENT_EDO 23
#define T2D_BM_COMPUTER_DOCUMENT_FEDE 24
#define T2D_BM_COMPUTER_DOCUMENT_FIABE 25
#define T2D_BM_COMPUTER_DOCUMENT_FOX 26
#define T2D_BM_COMPUTER_DOCUMENT_GIUSTI 27
#define T2D_BM_COMPUTER_DOCUMENT_KRIZIA 28
#define T2D_BM_COMPUTER_DOCUMENT_NONJI 29
#define T2D_BM_COMPUTER_DOCUMENT_SPARTECO 30
#define T2D_BM_COMPUTER_DOCUMENT_TAG 31
#define T2D_BM_COMPUTER_DOCUMENT_TIZ 32
#define T2D_BM_COMPUTER_DOCUMENT_WALTER 33
#define T2D_BM_COMPUTER_DOCUMENT_VICKY 34
#define T2D_BM_COMPUTER_DOCUMENT_PIETRO 35
#define T2D_BM_COMPUTER_DOCUMENT_LAST 35
#define T2D_BT_COMPUTER_DOCUMENT_WIN 1
#define T2D_BT_COMPUTER_DOCUMENT_MOVE 2
#define T2D_BT_COMPUTER_DOCUMENT_SCROLL 3
#define T2D_BT_COMPUTER_DOCUMENT_EXIT 4
#define T2D_BT_COMPUTER_DOCUMENT_SCROLLUP 5
#define T2D_BT_COMPUTER_DOCUMENT_SCROLLDOWN 6
#define T2D_BT_Document_Win_TGA 7
#define T2D_WIN_COMPUTER_DOCLIST 11
#define T2D_BM_COMPUTER_DOCLIST_WIN 0
#define T2D_BM_COMPUTER_DOCLIST_EXIT_ON 1
#define T2D_BM_COMPUTER_DOCLIST_SCROLLUP_ON 2
#define T2D_BM_COMPUTER_DOCLIST_SCROLLDOWN_ON 3
#define T2D_BM_COMPUTER_DOCLIST_LINES_START 4
#define T2D_BM_COMPUTER_DOCLIST_LINES_END 7
#define T2D_BT_COMPUTER_DOCLIST_WIN 1
#define T2D_BT_COMPUTER_DOCLIST_MOVE 2
#define T2D_BT_COMPUTER_DOCLIST_EXIT 3
#define T2D_BT_COMPUTER_DOCLIST_SCROLLUP 4
#define T2D_BT_COMPUTER_DOCLIST_SCROLLDOWN 5
#define T2D_BT_COMPUTER_DOCLIST_LINES_START 6
#define T2D_BT_COMPUTER_DOCLIST_LINES_END 12
#define T2D_BT_DocList_Win_TGA 13
#define T2D_TEXT_COMPUTER_DOCLIST_LINES_START 1
#define T2D_TEXT_COMPUTER_DOCLIST_LINES_END 7
#define T2D_WIN_COMPUTER_EMAIL_VIEWER 12
#define T2D_BM_COMPUTER_EMAIL_VIEWER_WIN 0
#define T2D_BM_COMPUTER_EMAIL_VIEWER_SCROLLUP_ON 1
#define T2D_BM_COMPUTER_EMAIL_VIEWER_SCROLLDOWN_ON 2
#define T2D_BM_COMPUTER_EMAIL_VIEWER_EXIT_ON 3
#define T2D_BM_COMPUTER_EMAIL_1 4
#define T2D_BM_COMPUTER_EMAIL_2 5
#define T2D_BM_COMPUTER_EMAIL_TEXT_1 6
#define T2D_BM_COMPUTER_EMAIL_TEXT_2 7
#define T2D_BT_COMPUTER_EMAIL_VIEWER_WIN 1
#define T2D_BT_COMPUTER_EMAIL_VIEWER_MOVE 2
#define T2D_BT_COMPUTER_EMAIL_VIEWER_SCROLL 3
#define T2D_BT_COMPUTER_EMAIL_VIEWER_SCROLLUP 4
#define T2D_BT_COMPUTER_EMAIL_VIEWER_SCROLLDOWN 5
#define T2D_BT_COMPUTER_EMAIL_VIEWER_EXIT 6
#define T2D_BT_EMail_Viewer_Win_TGA 7
#define T2D_TEXT_COMPUTER_EMAIL_1 1
#define T2D_TEXT_COMPUTER_EMAIL_2 2
#define T2D_WIN_DIARIO 13
#define T2D_BM_DIARIO_PAGE_1 0
#define T2D_BM_DIARIO_PAGE_2 1
#define T2D_BM_DIARIO_PAGE_3 2
#define T2D_BM_DIARIO_PAGE_4 3
#define T2D_BM_DIARIO_PAGE_LEFT_ON 4
#define T2D_BM_DIARIO_PAGE_RIGHT_ON 5
#define T2D_BM_DIARIO_EXIT_ON 6
#define T2D_BM_DIARIO_PAGE_1_TEXT_1 11
#define T2D_BM_DIARIO_PAGE_1_TEXT_2 12
#define T2D_BM_DIARIO_PAGE_1_TEXT_3 13
#define T2D_BM_DIARIO_PAGE_1_TEXT_4 14
#define T2D_BM_DIARIO_PAGE_1_TEXT_5 15
#define T2D_BM_DIARIO_PAGE_1_TEXT_6 16
#define T2D_BM_DIARIO_PAGE_2_TEXT_1 21
#define T2D_BM_DIARIO_PAGE_2_TEXT_2 22
#define T2D_BM_DIARIO_PAGE_2_TEXT_3 23
#define T2D_BM_DIARIO_PAGE_2_TEXT_4 24
#define T2D_BM_DIARIO_PAGE_2_TEXT_5 25
#define T2D_BM_DIARIO_PAGE_2_TEXT_6 26
#define T2D_BM_DIARIO_PAGE_3_TEXT_1 31
#define T2D_BM_DIARIO_PAGE_3_TEXT_2 32
#define T2D_BM_DIARIO_PAGE_3_TEXT_3 33
#define T2D_BM_DIARIO_PAGE_3_TEXT_4 34
#define T2D_BM_DIARIO_PAGE_4_TEXT_1 41
#define T2D_BM_DIARIO_PAGE_4_TEXT_2 42
#define T2D_BM_DIARIO_PAGE_4_TEXT_3 43
#define T2D_BM_DIARIO_PAGE_4_TEXT_4 44
#define T2D_BM_DIARIO_PAGE_4_TEXT_5 45
#define T2D_BM_DIARIO_PAGE_4_TEXT_6 46
#define T2D_BM_DIARIO_PAGE_4_TEXT_7 47
#define T2D_BM_DIARIO_PAGE_4_TEXT_8 48
#define T2D_BM_DIARIO_PAGE_4_TEXT_9 49
#define T2D_BM_DIARIO_PAGE_4_TEXT_10 50
#define T2D_BM_DIARIO_PAGE_4_TEXT_11 51
#define T2D_BM_DIARIO_PAGE_4_TEXT_12 52
#define T2D_BT_DIARIO_PAGE_LEFT 1
#define T2D_BT_DIARIO_PAGE_RIGHT 2
#define T2D_BT_DIARIO_EXIT 3
#define T2D_BT_DIARIO_PAGE_1_TEXT_1 11
#define T2D_BT_DIARIO_PAGE_1_TEXT_2 12
#define T2D_BT_DIARIO_PAGE_1_TEXT_3 13
#define T2D_BT_DIARIO_PAGE_1_TEXT_4 14
#define T2D_BT_DIARIO_PAGE_1_TEXT_5 15
#define T2D_BT_DIARIO_PAGE_1_TEXT_6 16
#define T2D_BT_DIARIO_PAGE_2_TEXT_1 21
#define T2D_BT_DIARIO_PAGE_2_TEXT_2 22
#define T2D_BT_DIARIO_PAGE_2_TEXT_3 23
#define T2D_BT_DIARIO_PAGE_2_TEXT_4 24
#define T2D_BT_DIARIO_PAGE_2_TEXT_5 25
#define T2D_BT_DIARIO_PAGE_2_TEXT_6 26
#define T2D_BT_DIARIO_PAGE_3_TEXT_1 31
#define T2D_BT_DIARIO_PAGE_3_TEXT_2 32
#define T2D_BT_DIARIO_PAGE_3_TEXT_3 33
#define T2D_BT_DIARIO_PAGE_3_TEXT_4 34
#define T2D_BT_DIARIO_PAGE_4_TEXT_1 41
#define T2D_BT_DIARIO_PAGE_4_TEXT_2 42
#define T2D_BT_DIARIO_PAGE_4_TEXT_3 43
#define T2D_BT_DIARIO_PAGE_4_TEXT_4 44
#define T2D_BT_DIARIO_PAGE_4_TEXT_5 45
#define T2D_BT_DIARIO_PAGE_4_TEXT_6 46
#define T2D_BT_DIARIO_PAGE_4_TEXT_7 47
#define T2D_BT_DIARIO_PAGE_4_TEXT_8 48
#define T2D_BT_DIARIO_PAGE_4_TEXT_9 49
#define T2D_BT_DIARIO_PAGE_4_TEXT_10 50
#define T2D_BT_DIARIO_PAGE_4_TEXT_11 51
#define T2D_BT_DIARIO_PAGE_4_TEXT_12 52
#define T2D_WIN_PDA_MAIN 14
#define T2D_BM_PDA_MAIN_WIN 0
#define T2D_BM_PDA_MAIN_TONE_ON 1
#define T2D_BM_PDA_MAIN_LOG_ON 2
#define T2D_BM_PDA_MAIN_TIME 3
#define T2D_BM_PDA_MAIN_QUIT_ON 4
#define T2D_BT_PDA_MAIN_TONE 1
#define T2D_BT_PDA_MAIN_LOG 2
#define T2D_BT_PDA_MAIN_QUIT 3
#define T2D_TEXT_PDA_MAIN_TIME 1
#define T2D_WIN_PDA_LOG 15
#define T2D_BM_PDA_LOG_WIN 0
#define T2D_BM_PDA_LOG_SCROLLUP_ON 1
#define T2D_BM_PDA_LOG_SCROLLDOWN_ON 2
#define T2D_BM_PDA_LOG_SB 3
#define T2D_BM_PDA_LOG_EXIT_ON 4
#define T2D_BM_PDA_LOG_DATA_START 5
#define T2D_BM_PDA_LOG_DATA_END 25
#define T2D_BM_PDA_LOG_TEXT_START 26
#define T2D_BM_PDA_LOG_TEXT_END 46
#define T2D_BT_PDA_LOG_WIN 1
#define T2D_BT_PDA_LOG_SCROLL 2
#define T2D_BT_PDA_LOG_SCROLLUP 3
#define T2D_BT_PDA_LOG_SCROLLDOWN 4
#define T2D_BT_PDA_LOG_BARRA 5
#define T2D_BT_PDA_LOG_SB 6
#define T2D_BT_PDA_LOG_EXIT 7
#define T2D_BT_PDA_Log_Win_TGA 8
#define T2D_TEXT_PDA_LOG_DATA_START 1
#define T2D_TEXT_PDA_LOG_DATA_END 21
#define T2D_TEXT_PDA_LOG_TEXT_START 22
#define T2D_TEXT_PDA_LOG_TEXT_END 42
#define T2D_WIN_PDA_TONE 16
#define T2D_BM_PDA_TONE_WIN 0
#define T2D_BM_PDA_TONE_HELP_ON 1
#define T2D_BM_PDA_TONE_EXIT_ON 2
#define T2D_BM_PDA_TONE_WAVE_1 3
#define T2D_BM_PDA_TONE_WAVE_2 4
#define T2D_BM_PDA_TONE_REDLINE 5
#define T2D_BM_PDA_TONE_BARRA_1 6
#define T2D_BM_PDA_TONE_BARRA_2 7
#define T2D_BM_PDA_TONE_ACQUIRE_ON 8
#define T2D_BM_PDA_TONE_PROCESS_ON 9
#define T2D_BM_PDA_TONE_RISULTATO 10
#define T2D_BT_PDA_TONE_WIN 1
#define T2D_BT_PDA_TONE_HELP 2
#define T2D_BT_PDA_TONE_EXIT 3
#define T2D_BT_PDA_TONE_ACQUIRE 4
#define T2D_BT_PDA_TONE_PROCESS 5
#define T2D_BT_PDA_Tone_Win_TGA 6
//#define T2D_TEXT_PDA_TONE_RISULTATO 1
#define T2D_WIN_PDA_HELP 17
#define T2D_BM_PDA_HELP_WIN 0
#define T2D_BM_PDA_HELP_WIN2 1
#define T2D_BM_PDA_HELP_SCROLLUP_ON 2
#define T2D_BM_PDA_HELP_SCROLLDOWN_ON 3
#define T2D_BM_PDA_HELP_EXIT_ON 4
#define T2D_BM_PDA_HELP_TEXT_START 5
#define T2D_BM_PDA_HELP_TEXT_END 15
#define T2D_BT_PDA_HELP_WIN 1
#define T2D_BT_PDA_HELP_MOVE 2
#define T2D_BT_PDA_HELP_SCROLL 3
#define T2D_BT_PDA_HELP_SCROLLUP 4
#define T2D_BT_PDA_HELP_SCROLLDOWN 5
#define T2D_BT_PDA_HELP_EXIT 6
#define T2D_BT_Help_Win_TGA 7
#define T2D_TEXT_PDA_HELP_START 1
#define T2D_TEXT_PDA_HELP_END 11
#define T2D_WIN_OPTIONS_MAIN 18
#define T2D_BM_OPTIONS_WIN 1
#define T2D_BM_OPTIONS_CONTORNO 2
#define T2D_BM_OPTIONS_SAVE 3
#define T2D_BM_OPTIONS_LOAD 4
#define T2D_BM_OPTIONS_OPTIONS 5
#define T2D_BM_OPTIONS_GRIGLIA 6
#define T2D_BM_OPTIONS_FRECCIA_SU_OFF 7
#define T2D_BM_OPTIONS_FRECCIA_SU_ON 8
#define T2D_BM_OPTIONS_FRECCIA_GIU_OFF 9
#define T2D_BM_OPTIONS_FRECCIA_GIU_ON 10
#define T2D_BM_OPTIONS_SAVE_START 11
#define T2D_BM_OPTIONS_SAVE_END T2D_BM_OPTIONS_SAVE_START+8
#define T2D_BM_OPTIONS_TEXT_SAVE_START 20
#define T2D_BM_OPTIONS_TEXT_SAVE_END T2D_BM_OPTIONS_TEXT_SAVE_START+8
#define T2D_BM_OPTIONS_SOUND_ON 29
#define T2D_BM_OPTIONS_MUSIC_ON 30
#define T2D_BM_OPTIONS_SPEECH_ON 31
#define T2D_BM_OPTIONS_SUBTITLES_ON 32
#define T2D_BM_OPTIONS_SOUND_OFF 33
#define T2D_BM_OPTIONS_MUSIC_OFF 34
#define T2D_BM_OPTIONS_SPEECH_OFF 35
#define T2D_BM_OPTIONS_SUBTITLES_OFF 36
#define T2D_BM_OPTIONS_SOUND_BARRA 37
#define T2D_BM_OPTIONS_SOUND_PIROLO 38
#define T2D_BM_OPTIONS_MUSIC_BARRA 39
#define T2D_BM_OPTIONS_MUSIC_PIROLO 40
#define T2D_BM_OPTIONS_SPEECH_BARRA 41
#define T2D_BM_OPTIONS_SPEECH_PIROLO 42
#define T2D_BM_OPTIONS_MAINMENU_OFF 43
#define T2D_BM_OPTIONS_MAINMENU_ON 44
#define T2D_BT_OPTIONS_SAVE 1
#define T2D_BT_OPTIONS_LOAD 2
#define T2D_BT_OPTIONS_OPTIONS 3
#define T2D_BT_OPTIONS_QUIT 4
#define T2D_BT_OPTIONS_CLOSE 5
#define T2D_BT_OPTIONS_FRECCIA_SU 6
#define T2D_BT_OPTIONS_FRECCIA_GIU 7
#define T2D_BT_OPTIONS_SAVE_START 8
#define T2D_BT_OPTIONS_SAVE_END T2D_BT_OPTIONS_SAVE_START+8
#define T2D_BT_OPTIONS_SOUND 17
#define T2D_BT_OPTIONS_MUSIC 18
#define T2D_BT_OPTIONS_SPEECH 19
#define T2D_BT_OPTIONS_SUBTITLES 20
#define T2D_BT_OPTIONS_SOUND_BARRA 21
#define T2D_BT_OPTIONS_MUSIC_BARRA 22
#define T2D_BT_OPTIONS_SPEECH_BARRA 23
#define T2D_BT_OPTIONS_MAINMENU 24
#define T2D_TEXT_OPTIONS_SAVE_START 1
#define T2D_TEXT_OPTIONS_SAVE_END T2D_TEXT_OPTIONS_SAVE_START+1
#define T2D_WIN_MAINMENU_MAIN 19
#define T2D_BM_MAINMENU_WIN 1
#define T2D_BM_MAINMENU_PLAY_ON 2
#define T2D_BM_MAINMENU_PLAY_OFF 3
#define T2D_BM_MAINMENU_LOAD_ON 4
#define T2D_BM_MAINMENU_LOAD_OFF 5
#define T2D_BM_MAINMENU_EXIT_ON 6
#define T2D_BM_MAINMENU_EXIT_OFF 7
#define T2D_BT_MAINMENU_PLAY 1
#define T2D_BT_MAINMENU_LOAD 2
#define T2D_BT_MAINMENU_EXIT 3
#define T2D_WIN_GAMEOVER_MAIN 20
#define T2D_BM_GAMEOVER_WIN 1
#define T2D_BT_GameOver_Win_TGA 1
namespace Watchmaker {
struct t2dBUTTON {
uint8 on; // on/off
struct SRect lim; // limiti del bottone
int32 tnum; // numero bitmap col tooltip
t2dBUTTON() {
reset();
}
void reset() {
on = 0;
lim.reset();
tnum = 0;
}
};
struct t2dWINDOW {
int32 px, py; // poszione finestra
int32 sy; // scroll interno finestra
struct SDDBitmap bm[T2D_MAX_BITMAPS_IN_WIN]; // bitmaps ordinate
struct SDDText text[T2D_MAX_TEXTS_IN_WIN]; // testi
t2dBUTTON bt[T2D_MAX_BUTTONS_IN_WIN]; // bottoni ordinati
bool NOTSTRETCHED;
t2dWINDOW() {
reset();
}
void reset() {
px = 0;
py = 0;
sy = 0;
for (uint i = 0; i < ARRAYSIZE(bm); i++) bm[i].reset();
for (uint i = 0; i < ARRAYSIZE(text); i++) text[i].reset();
for (uint i = 0; i < ARRAYSIZE(bt); i++) bt[i].reset();
NOTSTRETCHED = false;
}
};
struct PDALogS {
int PDALogInd = 0;
int IndentX = 0;
};
struct SavesS {
int NFile;
int Hour;
int Min;
int Sec;
int Day;
int Month;
int Year;
};
void ChangeExclusiveMouseMode();
void PDA_Tone_Acquire_Help_Func();
void SetHelpWin(Fonts &fonts, void (*Func)(), int NArg, ...);
void CaricaSaves(WGame &game);
void SortSaves();
void RefreshSaveImg(WGame &game, int Pos, uint8 Type);
void FormattaLogs(WGame &game);
} // End of namespace Watchmaker
#endif // WATCHMAKER_T2D_INTERNAL_H