mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-21 18:35:04 +02:00
Keyboard now works, exit the game doesn't crash, feedback audio no longer plays the wrong audio.
This commit is contained in:
@@ -53,7 +53,7 @@ typedef struct {
|
||||
short flags;
|
||||
} KeyFrameHeaderType;
|
||||
|
||||
#define INITIAL_BIG_SHAPE_BUFFER_SIZE 8000000
|
||||
#define INITIAL_BIG_SHAPE_BUFFER_SIZE (64 * 1024 * 1024)
|
||||
#define THEATER_BIG_SHAPE_BUFFER_SIZE 4000000
|
||||
#define UNCOMPRESS_MAGIC_NUMBER 56789
|
||||
|
||||
@@ -62,7 +62,7 @@ unsigned TheaterShapeBufferLength = THEATER_BIG_SHAPE_BUFFER_SIZE;
|
||||
extern "C"{
|
||||
char *BigShapeBufferStart = NULL;
|
||||
char *TheaterShapeBufferStart = NULL;
|
||||
BOOL UseBigShapeBuffer = FALSE;
|
||||
BOOL UseBigShapeBuffer = TRUE;
|
||||
bool IsTheaterShape = false;
|
||||
}
|
||||
#ifdef FIXIT_SCORE_CRASH
|
||||
|
||||
@@ -838,29 +838,3 @@ void Stop_Speaking(void)
|
||||
SpeakQueue = VOX_NONE;
|
||||
Stop_Sample_Playing(SpeechBuffer);
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* Is_Speaking -- Checks to see if the eva voice is still playing. *
|
||||
* *
|
||||
* Call this routine when the EVA voice being played needs to be checked. A typical use *
|
||||
* of this would be when some action needs to be delayed until the voice has finished -- *
|
||||
* say the end of the game. *
|
||||
* *
|
||||
* INPUT: none *
|
||||
* *
|
||||
* OUTPUT: bool; Is the EVA voice still playing? *
|
||||
* *
|
||||
* WARNINGS: none *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 03/12/1995 JLB : Created. *
|
||||
*=============================================================================================*/
|
||||
bool Is_Speaking(void)
|
||||
{
|
||||
Speak_AI();
|
||||
if (!Debug_Quiet && SampleType != 0 && (SpeakQueue != VOX_NONE || Is_Sample_Playing(SpeechBuffer))) {
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
+26
-2
@@ -303,9 +303,10 @@ void AudMix_Init(void) {
|
||||
void PlayAudio(AudioBuffer_t& buffer, bool speech) {
|
||||
// Only one speech sound can play at once.
|
||||
if (speech) {
|
||||
if (AudMix_IsSourcePlaying(SPEECH_AUDIO_SOURCE))
|
||||
return;
|
||||
//if (AudMix_IsSourcePlaying(SPEECH_AUDIO_SOURCE))
|
||||
// return;
|
||||
|
||||
alSourceStop(audio_sources[SPEECH_AUDIO_SOURCE]);
|
||||
alSourcei(audio_sources[SPEECH_AUDIO_SOURCE], AL_BUFFER, buffer.buffer);
|
||||
alSourcePlay(audio_sources[SPEECH_AUDIO_SOURCE]);
|
||||
return;
|
||||
@@ -360,3 +361,26 @@ void On_Speech(int speech_index, HouseClass* house)
|
||||
// DLLExportClass::On_Speech(house, speech_index);
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************************************
|
||||
* Is_Speaking -- Checks to see if the eva voice is still playing. *
|
||||
* *
|
||||
* Call this routine when the EVA voice being played needs to be checked. A typical use *
|
||||
* of this would be when some action needs to be delayed until the voice has finished -- *
|
||||
* say the end of the game. *
|
||||
* *
|
||||
* INPUT: none *
|
||||
* *
|
||||
* OUTPUT: bool; Is the EVA voice still playing? *
|
||||
* *
|
||||
* WARNINGS: none *
|
||||
* *
|
||||
* HISTORY: *
|
||||
* 03/12/1995 JLB : Created. *
|
||||
*=============================================================================================*/
|
||||
bool Is_Speaking(void)
|
||||
{
|
||||
Speak_AI();
|
||||
return AudMix_IsSourcePlaying(SPEECH_AUDIO_SOURCE);
|
||||
}
|
||||
|
||||
@@ -566,6 +566,9 @@ KeyNumType GadgetClass::Input(void)
|
||||
flags = RIGHTRELEASE;
|
||||
}
|
||||
break;
|
||||
case SDL_KEYDOWN:
|
||||
Keyboard->Put_Element(event.key.keysym.sym);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// jmarshall end
|
||||
|
||||
+5
-6
@@ -86,6 +86,7 @@ class WWKeyboardClass
|
||||
int MouseQX;
|
||||
int MouseQY;
|
||||
|
||||
bool Put_Element(unsigned short val);
|
||||
private:
|
||||
|
||||
/*
|
||||
@@ -103,7 +104,6 @@ class WWKeyboardClass
|
||||
unsigned short Buff_Get(void);
|
||||
unsigned short Fetch_Element(void);
|
||||
unsigned short Peek_Element(void) const;
|
||||
bool Put_Element(unsigned short val);
|
||||
bool Is_Buffer_Full(void) const;
|
||||
bool Is_Buffer_Empty(void) const;
|
||||
static bool Is_Mouse_Key(unsigned short key);
|
||||
@@ -120,7 +120,6 @@ class WWKeyboardClass
|
||||
int Tail;
|
||||
};
|
||||
|
||||
|
||||
#define VK_NONE 0x00
|
||||
#define VK_LBUTTON 0x01
|
||||
#define VK_RBUTTON 0x02
|
||||
@@ -129,8 +128,8 @@ class WWKeyboardClass
|
||||
#define VK_NONE_05 0x05
|
||||
#define VK_NONE_06 0x06
|
||||
#define VK_NONE_07 0x07
|
||||
#define VK_BACK 0x08
|
||||
#define VK_TAB 0x09
|
||||
#define VK_BACK '\b'
|
||||
#define VK_TAB '\t'
|
||||
#define VK_NONE_0A 0x0A
|
||||
#define VK_NONE_0B 0x0B
|
||||
#define VK_CLEAR 0x0C
|
||||
@@ -148,7 +147,7 @@ class WWKeyboardClass
|
||||
#define VK_NONE_18 0x18
|
||||
#define VK_NONE_19 0x19
|
||||
#define VK_NONE_1A 0x1A
|
||||
#define VK_ESCAPE 0x1B
|
||||
#define VK_ESCAPE '\033'
|
||||
#define VK_NONE_1C 0x1C
|
||||
#define VK_NONE_1D 0x1D
|
||||
#define VK_NONE_1E 0x1E
|
||||
@@ -192,7 +191,7 @@ class WWKeyboardClass
|
||||
#define VK_E 0x45
|
||||
#define VK_F 0x46
|
||||
#define VK_G 0x47
|
||||
#define VK_H 0x48
|
||||
#define VK_H 'h'
|
||||
#define VK_I 0x49
|
||||
#define VK_J 0x4A
|
||||
#define VK_K 0x4B
|
||||
|
||||
@@ -1340,6 +1340,11 @@ void SidebarClass::StripClass::Reload_LogoShapes(void)
|
||||
if(PlayerPtr) {
|
||||
houseloaded = PlayerPtr->ActLike;
|
||||
}
|
||||
// jmarshall
|
||||
if (houseloaded >= HOUSE_BAD)
|
||||
return;
|
||||
// jmarshall end
|
||||
|
||||
LogoShapes = (void*)MFCD::Retrieve(stripnames[houseloaded]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user