mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 08:47:58 +03:00
Refactoring
This commit is contained in:
parent
fce3ca3b5f
commit
5a2842f89d
14 changed files with 307 additions and 368 deletions
|
@ -54,7 +54,7 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
|
|
||||||
// Poll the keyboard and update input variables
|
// Poll the keyboard and update input variables
|
||||||
if (S_UpdateInput() == -1)
|
if (S_UpdateInput() == -1)
|
||||||
return GAME_STATUS::GAME_STATUS_NONE;
|
return GAME_STATUS_NONE;
|
||||||
|
|
||||||
// Has Lara control been disabled?
|
// Has Lara control been disabled?
|
||||||
if (DisableLaraControl)
|
if (DisableLaraControl)
|
||||||
|
@ -79,16 +79,16 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
switch (inventoryResult)
|
switch (inventoryResult)
|
||||||
{
|
{
|
||||||
case INV_RESULT_LOAD_GAME:
|
case INV_RESULT_LOAD_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_LOAD_GAME;
|
return GAME_STATUS_LOAD_GAME;
|
||||||
case INV_RESULT_EXIT_TO_TILE:
|
case INV_RESULT_EXIT_TO_TILE:
|
||||||
return GAME_STATUS::GAME_STATUS_EXIT_TO_TITLE;
|
return GAME_STATUS_EXIT_TO_TITLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Has level been completed?
|
// Has level been completed?
|
||||||
if (LevelComplete)
|
if (LevelComplete)
|
||||||
return GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED;
|
return GAME_STATUS_LEVEL_COMPLETED;
|
||||||
|
|
||||||
__int32 oldInput = TrInput;
|
__int32 oldInput = TrInput;
|
||||||
|
|
||||||
|
@ -99,11 +99,11 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
switch (inventoryResult)
|
switch (inventoryResult)
|
||||||
{
|
{
|
||||||
case INV_RESULT_NEW_GAME:
|
case INV_RESULT_NEW_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_NEW_GAME;
|
return GAME_STATUS_NEW_GAME;
|
||||||
case INV_RESULT_LOAD_GAME:
|
case INV_RESULT_LOAD_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_LOAD_GAME;
|
return GAME_STATUS_LOAD_GAME;
|
||||||
case INV_RESULT_EXIT_TO_TILE:
|
case INV_RESULT_EXIT_TO_TILE:
|
||||||
return GAME_STATUS::GAME_STATUS_EXIT_TO_TITLE;
|
return GAME_STATUS_EXIT_TO_TITLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ GAME_STATUS __cdecl ControlPhase(__int32 numFrames, __int32 demoMode)
|
||||||
HealtBarTimer--;
|
HealtBarTimer--;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GAME_STATUS::GAME_STATUS_NONE;
|
return GAME_STATUS_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned __stdcall GameMain(void*)
|
unsigned __stdcall GameMain(void*)
|
||||||
|
@ -416,14 +416,14 @@ GAME_STATUS __cdecl DoTitle(__int32 index)
|
||||||
switch (inventoryResult)
|
switch (inventoryResult)
|
||||||
{
|
{
|
||||||
case INV_RESULT_NEW_GAME:
|
case INV_RESULT_NEW_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_NEW_GAME;
|
return GAME_STATUS_NEW_GAME;
|
||||||
case INV_RESULT_LOAD_GAME:
|
case INV_RESULT_LOAD_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_LOAD_GAME;
|
return GAME_STATUS_LOAD_GAME;
|
||||||
case INV_RESULT_EXIT_GAME:
|
case INV_RESULT_EXIT_GAME:
|
||||||
return GAME_STATUS::GAME_STATUS_EXIT_GAME;
|
return GAME_STATUS_EXIT_GAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GAME_STATUS::GAME_STATUS_NEW_GAME;
|
return GAME_STATUS_NEW_GAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
GAME_STATUS __cdecl DoLevel(__int32 index, __int32 ambient, bool loadFromSavegame)
|
GAME_STATUS __cdecl DoLevel(__int32 index, __int32 ambient, bool loadFromSavegame)
|
||||||
|
@ -509,9 +509,9 @@ GAME_STATUS __cdecl DoLevel(__int32 index, __int32 ambient, bool loadFromSavegam
|
||||||
nframes = DrawPhaseGame();
|
nframes = DrawPhaseGame();
|
||||||
result = ControlPhase(nframes, 0);
|
result = ControlPhase(nframes, 0);
|
||||||
|
|
||||||
if (result == GAME_STATUS::GAME_STATUS_EXIT_TO_TITLE ||
|
if (result == GAME_STATUS_EXIT_TO_TITLE ||
|
||||||
result == GAME_STATUS::GAME_STATUS_LOAD_GAME ||
|
result == GAME_STATUS_LOAD_GAME ||
|
||||||
result == GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED)
|
result == GAME_STATUS_LEVEL_COMPLETED)
|
||||||
{
|
{
|
||||||
// Here is the only way for exiting from the loop
|
// Here is the only way for exiting from the loop
|
||||||
SOUND_Stop();
|
SOUND_Stop();
|
||||||
|
|
|
@ -2535,11 +2535,14 @@ void Inventory::DoControlsSettings()
|
||||||
ring->frameIndex = 0;
|
ring->frameIndex = 0;
|
||||||
ring->selectedIndex = 0;
|
ring->selectedIndex = 0;
|
||||||
ring->waitingForKey = false;
|
ring->waitingForKey = false;
|
||||||
|
|
||||||
PopupObject();
|
PopupObject();
|
||||||
|
|
||||||
bool closeObject = false;
|
bool closeObject = false;
|
||||||
|
|
||||||
|
// Copy configuration to a temporary object
|
||||||
|
memcpy(&ring->Configuration.KeyboardLayout, &KeyboardLayout1, NUM_CONTROLS);
|
||||||
|
|
||||||
// Do the passport
|
// Do the passport
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
@ -2582,7 +2585,9 @@ void Inventory::DoControlsSettings()
|
||||||
|
|
||||||
if (ring->selectedIndex == NUM_CONTROLS)
|
if (ring->selectedIndex == NUM_CONTROLS)
|
||||||
{
|
{
|
||||||
|
memcpy(KeyboardLayout1, ring->Configuration.KeyboardLayout, NUM_CONTROLS);
|
||||||
SaveConfiguration();
|
SaveConfiguration();
|
||||||
|
|
||||||
closeObject = true;
|
closeObject = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -2745,7 +2750,7 @@ void Inventory::DoGraphicsSettings()
|
||||||
{
|
{
|
||||||
case INV_DISPLAY_RESOLUTION:
|
case INV_DISPLAY_RESOLUTION:
|
||||||
SoundEffect(SFX_MENU_CHOOSE, NULL, 0);
|
SoundEffect(SFX_MENU_CHOOSE, NULL, 0);
|
||||||
//if (ring->SelectedVideoMode < adapter->DisplayModes.size() - 1)
|
if (ring->SelectedVideoMode < adapter->DisplayModes.size() - 1)
|
||||||
ring->SelectedVideoMode++;
|
ring->SelectedVideoMode++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ void __cdecl WildBoarControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, VIOLENT);
|
GetCreatureMood(item, &info, VIOLENT);
|
||||||
if (item->flags)
|
if (item->flags)
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
CreatureMood(item, &info, VIOLENT);
|
CreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
angle = CreatureTurn(item, creature->maximumTurn);
|
angle = CreatureTurn(item, creature->maximumTurn);
|
||||||
|
@ -758,7 +758,7 @@ void __cdecl BatControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, VIOLENT);
|
GetCreatureMood(item, &info, VIOLENT);
|
||||||
if (item->flags)
|
if (item->flags)
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
CreatureMood(item, &info, VIOLENT);
|
CreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
angle = CreatureTurn(item, 3640);
|
angle = CreatureTurn(item, 3640);
|
||||||
|
@ -802,7 +802,7 @@ void __cdecl BatControl(__int16 itemNum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
creature->mood = MOOD_TYPE::BORED_MOOD;
|
creature->mood = BORED_MOOD;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1068,7 +1068,7 @@ void __cdecl TigerControl(__int16 itemNum)
|
||||||
GetCreatureMood(item, &info, 1);
|
GetCreatureMood(item, &info, 1);
|
||||||
|
|
||||||
if (creature->alerted && info.zoneNumber != info.enemyZone)
|
if (creature->alerted && info.zoneNumber != info.enemyZone)
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
|
|
||||||
CreatureMood(item, &info, 1);
|
CreatureMood(item, &info, 1);
|
||||||
|
|
||||||
|
@ -1080,14 +1080,14 @@ void __cdecl TigerControl(__int16 itemNum)
|
||||||
creature->maximumTurn = 0;
|
creature->maximumTurn = 0;
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target != item && info.ahead)
|
if (Lara.target != item && info.ahead)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
__int16 random = GetRandomControl();
|
__int16 random = GetRandomControl();
|
||||||
if (random < 0x60)
|
if (random < 0x60)
|
||||||
|
@ -1113,7 +1113,7 @@ void __cdecl TigerControl(__int16 itemNum)
|
||||||
case 2:
|
case 2:
|
||||||
creature->maximumTurn = ANGLE(3);
|
creature->maximumTurn = ANGLE(3);
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD || creature->mood == MOOD_TYPE::ATTACK_MOOD)
|
if (creature->mood == ESCAPE_MOOD || creature->mood == ATTACK_MOOD)
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
else if (GetRandomControl() < 0x60)
|
else if (GetRandomControl() < 0x60)
|
||||||
{
|
{
|
||||||
|
@ -1125,7 +1125,7 @@ void __cdecl TigerControl(__int16 itemNum)
|
||||||
case 3:
|
case 3:
|
||||||
creature->maximumTurn = ANGLE(6);
|
creature->maximumTurn = ANGLE(6);
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (creature->flags && info.ahead)
|
else if (creature->flags && info.ahead)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -1136,12 +1136,12 @@ void __cdecl TigerControl(__int16 itemNum)
|
||||||
else
|
else
|
||||||
item->goalAnimState = 7;
|
item->goalAnimState = 7;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::ATTACK_MOOD && GetRandomControl() < 0x60)
|
else if (creature->mood != ATTACK_MOOD && GetRandomControl() < 0x60)
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 5;
|
item->requiredAnimState = 5;
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD && Lara.target != item && info.ahead)
|
else if (creature->mood == ESCAPE_MOOD && Lara.target != item && info.ahead)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
|
@ -1355,7 +1355,7 @@ void __cdecl RaptorControl(__int16 itemNum)
|
||||||
GetCreatureMood(item, &info, VIOLENT);
|
GetCreatureMood(item, &info, VIOLENT);
|
||||||
CreatureMood(item, &info, VIOLENT);
|
CreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
creature->maximumTurn >>= 1;
|
creature->maximumTurn >>= 1;
|
||||||
|
|
||||||
angle = CreatureTurn(item, creature->maximumTurn);
|
angle = CreatureTurn(item, creature->maximumTurn);
|
||||||
|
@ -1378,9 +1378,9 @@ void __cdecl RaptorControl(__int16 itemNum)
|
||||||
item->goalAnimState = 8;
|
item->goalAnimState = 8;
|
||||||
else if (info.bite && info.distance < SQUARE(1536))
|
else if (info.bite && info.distance < SQUARE(1536))
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD && Lara.target != item && info.ahead && !item->hitStatus)
|
else if (creature->mood == ESCAPE_MOOD && Lara.target != item && info.ahead && !item->hitStatus)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
|
@ -1390,7 +1390,7 @@ void __cdecl RaptorControl(__int16 itemNum)
|
||||||
creature->maximumTurn = ANGLE(2);
|
creature->maximumTurn = ANGLE(2);
|
||||||
creature->flags &= ~1;
|
creature->flags &= ~1;
|
||||||
|
|
||||||
if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
if (creature->mood != BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (info.ahead && GetRandomControl() < 0x80)
|
else if (info.ahead && GetRandomControl() < 0x80)
|
||||||
{
|
{
|
||||||
|
@ -1424,12 +1424,12 @@ void __cdecl RaptorControl(__int16 itemNum)
|
||||||
item->goalAnimState = 7;
|
item->goalAnimState = 7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (info.ahead && creature->mood != MOOD_TYPE::ESCAPE_MOOD && GetRandomControl() < 0x80)
|
else if (info.ahead && creature->mood != ESCAPE_MOOD && GetRandomControl() < 0x80)
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 6;
|
item->requiredAnimState = 6;
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD || (creature->mood == MOOD_TYPE::ESCAPE_MOOD && Lara.target != item && info.ahead))
|
else if (creature->mood == BORED_MOOD || (creature->mood == ESCAPE_MOOD && Lara.target != item && info.ahead))
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1631,13 +1631,13 @@ void EagleControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
case 7:
|
case 7:
|
||||||
item->pos.yPos = item->floor;
|
item->pos.yPos = item->floor;
|
||||||
if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
if (creature->mood != BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
item->pos.yPos = item->floor;
|
item->pos.yPos = item->floor;
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
break;
|
break;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -1648,7 +1648,7 @@ void EagleControl(__int16 itemNum)
|
||||||
|
|
||||||
if (item->requiredAnimState)
|
if (item->requiredAnimState)
|
||||||
item->goalAnimState = item->requiredAnimState;
|
item->goalAnimState = item->requiredAnimState;
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else if (info.ahead && info.distance < SQUARE(512))
|
else if (info.ahead && info.distance < SQUARE(512))
|
||||||
item->goalAnimState = 6;
|
item->goalAnimState = 6;
|
||||||
|
@ -1769,7 +1769,7 @@ void __cdecl BearControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = item->requiredAnimState;
|
item->goalAnimState = item->requiredAnimState;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 0;
|
item->goalAnimState = 0;
|
||||||
}
|
}
|
||||||
|
@ -1786,10 +1786,10 @@ void __cdecl BearControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood != BORED_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 0;
|
item->requiredAnimState = 0;
|
||||||
}
|
}
|
||||||
|
@ -1811,7 +1811,7 @@ void __cdecl BearControl(__int16 itemNum)
|
||||||
LaraItem->hitStatus = true;
|
LaraItem->hitStatus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD || LaraItem->hitPoints <= 0)
|
if (creature->mood == BORED_MOOD || LaraItem->hitPoints <= 0)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
|
@ -1840,7 +1840,7 @@ void __cdecl BearControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = item->requiredAnimState;
|
item->goalAnimState = item->requiredAnimState;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD || creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == BORED_MOOD || creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
|
@ -1864,12 +1864,12 @@ void __cdecl BearControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
item->requiredAnimState = 0;
|
item->requiredAnimState = 0;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD || GetRandomControl() < 0x50)
|
else if (creature->mood == BORED_MOOD || GetRandomControl() < 0x50)
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 5;
|
item->requiredAnimState = 5;
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
|
@ -1958,7 +1958,7 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
case 8:
|
case 8:
|
||||||
head = 0;
|
head = 0;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD || info.zoneNumber == info.enemyZone)
|
if (creature->mood == ESCAPE_MOOD || info.zoneNumber == info.enemyZone)
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 9;
|
item->requiredAnimState = 9;
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -1980,7 +1980,7 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
case 2:
|
case 2:
|
||||||
creature->maximumTurn = ANGLE(2);
|
creature->maximumTurn = ANGLE(2);
|
||||||
|
|
||||||
if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
if (creature->mood != BORED_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 5;
|
item->goalAnimState = 5;
|
||||||
item->requiredAnimState = 0;
|
item->requiredAnimState = 0;
|
||||||
|
@ -1995,13 +1995,13 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
case 9:
|
case 9:
|
||||||
if (item->requiredAnimState)
|
if (item->requiredAnimState)
|
||||||
item->goalAnimState = item->requiredAnimState;
|
item->goalAnimState = item->requiredAnimState;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
else if (info.distance < SQUARE(345) && info.bite)
|
else if (info.distance < SQUARE(345) && info.bite)
|
||||||
item->goalAnimState = 12;
|
item->goalAnimState = 12;
|
||||||
else if (creature->mood == MOOD_TYPE::STALK_MOOD)
|
else if (creature->mood == STALK_MOOD)
|
||||||
item->goalAnimState = 5;
|
item->goalAnimState = 5;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
|
@ -2016,7 +2016,7 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
item->goalAnimState = 12;
|
item->goalAnimState = 12;
|
||||||
else if (info.distance > SQUARE(3072))
|
else if (info.distance > SQUARE(3072))
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
else if (creature->mood == MOOD_TYPE::ATTACK_MOOD)
|
else if (creature->mood == ATTACK_MOOD)
|
||||||
{
|
{
|
||||||
if (!info.ahead || info.distance > SQUARE(1536) ||
|
if (!info.ahead || info.distance > SQUARE(1536) ||
|
||||||
(info.enemyFacing < FRONT_ARC && info.enemyFacing > -FRONT_ARC))
|
(info.enemyFacing < FRONT_ARC && info.enemyFacing > -FRONT_ARC))
|
||||||
|
@ -2027,7 +2027,7 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
item->requiredAnimState = 7;
|
item->requiredAnimState = 7;
|
||||||
item->goalAnimState = 9;
|
item->goalAnimState = 9;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 9;
|
item->goalAnimState = 9;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2049,12 +2049,12 @@ void __cdecl WolfControl(__int16 itemNum)
|
||||||
item->requiredAnimState = 0;
|
item->requiredAnimState = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::STALK_MOOD && info.distance < SQUARE(3072))
|
else if (creature->mood == STALK_MOOD && info.distance < SQUARE(3072))
|
||||||
{
|
{
|
||||||
item->requiredAnimState = 5;
|
item->requiredAnimState = 5;
|
||||||
item->goalAnimState = 9;
|
item->goalAnimState = 9;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 9;
|
item->goalAnimState = 9;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2153,7 +2153,7 @@ void TyrannosaurControl(__int16 itemNum)
|
||||||
if (item->touchBits)
|
if (item->touchBits)
|
||||||
LaraItem->hitPoints -= (item->currentAnimState == 3) ? 10 : 1;
|
LaraItem->hitPoints -= (item->currentAnimState == 3) ? 10 : 1;
|
||||||
|
|
||||||
creature->flags = (creature->mood != MOOD_TYPE::ESCAPE_MOOD && !info.ahead &&
|
creature->flags = (creature->mood != ESCAPE_MOOD && !info.ahead &&
|
||||||
info.enemyFacing > -FRONT_ARC && info.enemyFacing < FRONT_ARC);
|
info.enemyFacing > -FRONT_ARC && info.enemyFacing < FRONT_ARC);
|
||||||
|
|
||||||
if (!creature->flags && info.distance > SQUARE(1500) && info.distance < SQUARE(4096) && info.bite)
|
if (!creature->flags && info.distance > SQUARE(1500) && info.distance < SQUARE(4096) && info.bite)
|
||||||
|
@ -2166,7 +2166,7 @@ void TyrannosaurControl(__int16 itemNum)
|
||||||
item->goalAnimState = item->requiredAnimState;
|
item->goalAnimState = item->requiredAnimState;
|
||||||
else if (info.distance < SQUARE(1500) && info.bite)
|
else if (info.distance < SQUARE(1500) && info.bite)
|
||||||
item->goalAnimState = 7;
|
item->goalAnimState = 7;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD || creature->flags)
|
else if (creature->mood == BORED_MOOD || creature->flags)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
|
@ -2175,7 +2175,7 @@ void TyrannosaurControl(__int16 itemNum)
|
||||||
case 2:
|
case 2:
|
||||||
creature->maximumTurn = ANGLE(2);
|
creature->maximumTurn = ANGLE(2);
|
||||||
|
|
||||||
if (creature->mood != MOOD_TYPE::BORED_MOOD || !creature->flags)
|
if (creature->mood != BORED_MOOD || !creature->flags)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (info.ahead && GetRandomControl() < 0x200)
|
else if (info.ahead && GetRandomControl() < 0x200)
|
||||||
{
|
{
|
||||||
|
@ -2196,7 +2196,7 @@ void TyrannosaurControl(__int16 itemNum)
|
||||||
item->requiredAnimState = 6;
|
item->requiredAnimState = 6;
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -2313,7 +2313,7 @@ void __cdecl ApeControl(__int16 itemNum)
|
||||||
item->requiredAnimState = 4;
|
item->requiredAnimState = 4;
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood != ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
random = (__int16)GetRandomControl();
|
random = (__int16)GetRandomControl();
|
||||||
if (random < 0xA0)
|
if (random < 0xA0)
|
||||||
|
@ -2439,7 +2439,7 @@ void __cdecl RatControl(__int16 itemNum)
|
||||||
switch (item->currentAnimState)
|
switch (item->currentAnimState)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD || creature->mood == MOOD_TYPE::STALK_MOOD)
|
if (creature->mood == BORED_MOOD || creature->mood == STALK_MOOD)
|
||||||
{
|
{
|
||||||
__int16 random = (__int16)GetRandomControl();
|
__int16 random = (__int16)GetRandomControl();
|
||||||
if (random < 0x500)
|
if (random < 0x500)
|
||||||
|
@ -2466,7 +2466,7 @@ void __cdecl RatControl(__int16 itemNum)
|
||||||
case 1:
|
case 1:
|
||||||
creature->maximumTurn = ANGLE(6);
|
creature->maximumTurn = ANGLE(6);
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD || creature->mood == MOOD_TYPE::STALK_MOOD)
|
if (creature->mood == BORED_MOOD || creature->mood == STALK_MOOD)
|
||||||
{
|
{
|
||||||
random = (__int16)GetRandomControl();
|
random = (__int16)GetRandomControl();
|
||||||
if (random < 0x500)
|
if (random < 0x500)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "..\Game\sphere.h"
|
#include "..\Game\sphere.h"
|
||||||
#include "..\Game\effect2.h"
|
#include "..\Game\effect2.h"
|
||||||
#include "..\Game\people.h"
|
#include "..\Game\people.h"
|
||||||
|
#include "..\Game\lara.h"
|
||||||
|
|
||||||
BITE_INFO baddyGun = { 0, -16, 200, 11 };
|
BITE_INFO baddyGun = { 0, -16, 200, 11 };
|
||||||
BITE_INFO baddySword = { 0, 0, 0, 15 };
|
BITE_INFO baddySword = { 0, 0, 0, 15 };
|
||||||
|
@ -341,9 +342,9 @@ void __cdecl BaddyControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, VIOLENT);
|
GetCreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
// Bike handling
|
// Vehicle handling
|
||||||
//if (Lara.bike != -1 && info.bite)
|
if (g_LaraExtra.Vehicle != NO_ITEM && info.bite)
|
||||||
// currentCreature->mood == MOOD_TYPE::ESCAPE_MOOD;
|
currentCreature->mood == ESCAPE_MOOD;
|
||||||
|
|
||||||
CreatureMood(item, &info, VIOLENT);
|
CreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
|
@ -643,7 +644,7 @@ void __cdecl BaddyControl(__int16 itemNum)
|
||||||
item->currentAnimState = 0;
|
item->currentAnimState = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (currentCreature->mood == MOOD_TYPE::ATTACK_MOOD &&
|
if (currentCreature->mood == ATTACK_MOOD &&
|
||||||
!(currentCreature->jumpAhead) &&
|
!(currentCreature->jumpAhead) &&
|
||||||
info.distance > SQUARE(1024))
|
info.distance > SQUARE(1024))
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "..\Game\sphere.h"
|
#include "..\Game\sphere.h"
|
||||||
#include "..\Game\effect2.h"
|
#include "..\Game\effect2.h"
|
||||||
#include "..\Game\people.h"
|
#include "..\Game\people.h"
|
||||||
|
#include "..\Game\lara.h"
|
||||||
|
|
||||||
BITE_INFO sasGun = { 0, 300, 64, 7 };
|
BITE_INFO sasGun = { 0, 300, 64, 7 };
|
||||||
|
|
||||||
|
@ -84,13 +85,9 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, creature->enemy != LaraItem);
|
GetCreatureMood(item, &info, creature->enemy != LaraItem);
|
||||||
|
|
||||||
/*if (Lara.bike != -1)
|
// Vehicle handling
|
||||||
{
|
if (g_LaraExtra.Vehicle != NO_ITEM && info.bite)
|
||||||
if (v44)
|
creature->mood == ESCAPE_MOOD;
|
||||||
{
|
|
||||||
*(_DWORD *)&creature->gapD[1] = 2;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
CreatureMood(item, &info, creature->enemy != LaraItem);
|
CreatureMood(item, &info, creature->enemy != LaraItem);
|
||||||
angle = CreatureTurn(item, creature->maximumTurn);
|
angle = CreatureTurn(item, creature->maximumTurn);
|
||||||
|
@ -181,16 +178,16 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((creature->alerted || creature->mood != MOOD_TYPE::BORED_MOOD) &&
|
if ((creature->alerted || creature->mood != BORED_MOOD) &&
|
||||||
(!item->hitStatus || !creature->reachedGoal && distance <= 0x400000))
|
(!item->hitStatus || !creature->reachedGoal && distance <= 0x400000))
|
||||||
{
|
{
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD || info.distance <= 0x400000)
|
if (creature->mood == BORED_MOOD || info.distance <= 0x400000)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
break;
|
break;
|
||||||
|
@ -226,7 +223,7 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Targetable(item, &info)
|
else if (Targetable(item, &info)
|
||||||
|| creature->mood != MOOD_TYPE::BORED_MOOD
|
|| creature->mood != BORED_MOOD
|
||||||
|| !info.ahead
|
|| !info.ahead
|
||||||
|| item->hitStatus
|
|| item->hitStatus
|
||||||
/*|| Lara_Bike*/)
|
/*|| Lara_Bike*/)
|
||||||
|
@ -246,7 +243,7 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
else if (/*!Lara_Bike ||*/ !(item->aiBits & GUARD) && item->aiBits)
|
else if (/*!Lara_Bike ||*/ !(item->aiBits & GUARD) && item->aiBits)
|
||||||
{
|
{
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
}
|
}
|
||||||
|
@ -306,7 +303,7 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (creature->mood != MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood != ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Targetable(item, &info))
|
if (Targetable(item, &info))
|
||||||
{
|
{
|
||||||
|
@ -314,7 +311,7 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (creature->mood != MOOD_TYPE::BORED_MOOD || creature->mood == MOOD_TYPE::STALK_MOOD &&
|
if (creature->mood != BORED_MOOD || creature->mood == STALK_MOOD &&
|
||||||
item->aiBits & FOLLOW && info.distance < 0x400000)
|
item->aiBits & FOLLOW && info.distance < 0x400000)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
|
@ -418,7 +415,7 @@ void __cdecl SasControl(__int16 itemNum)
|
||||||
case 6:
|
case 6:
|
||||||
if (item->currentAnimState == 11 || item->currentAnimState == 13)
|
if (item->currentAnimState == 11 || item->currentAnimState == 13)
|
||||||
{
|
{
|
||||||
if (item->goalAnimState != 1 && item->goalAnimState != 14 && (creature->mood == MOOD_TYPE::ESCAPE_MOOD || !Targetable(item, &info)))
|
if (item->goalAnimState != 1 && item->goalAnimState != 14 && (creature->mood == ESCAPE_MOOD || !Targetable(item, &info)))
|
||||||
{
|
{
|
||||||
item->goalAnimState = item->currentAnimState != 11 ? 14 : 1;
|
item->goalAnimState = item->currentAnimState != 11 ? 14 : 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,7 +195,7 @@ void __cdecl ScubaControl(__int16 itemNumber)
|
||||||
|
|
||||||
if (creature->target.y < waterHeight && item->pos.yPos < waterHeight + creature->LOT.fly)
|
if (creature->target.y < waterHeight && item->pos.yPos < waterHeight + creature->LOT.fly)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
break;
|
break;
|
||||||
else if (shoot)
|
else if (shoot)
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
|
@ -207,7 +207,7 @@ void __cdecl ScubaControl(__int16 itemNumber)
|
||||||
if (shoot)
|
if (shoot)
|
||||||
neck = -info.angle;
|
neck = -info.angle;
|
||||||
|
|
||||||
if (!shoot || creature->mood == MOOD_TYPE::ESCAPE_MOOD || (creature->target.y < waterHeight && item->pos.yPos < waterHeight + creature->LOT.fly))
|
if (!shoot || creature->mood == ESCAPE_MOOD || (creature->target.y < waterHeight && item->pos.yPos < waterHeight + creature->LOT.fly))
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
|
@ -233,7 +233,7 @@ void __cdecl ScubaControl(__int16 itemNumber)
|
||||||
|
|
||||||
if (creature->target.y > waterHeight)
|
if (creature->target.y > waterHeight)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
break;
|
break;
|
||||||
else if (shoot)
|
else if (shoot)
|
||||||
item->goalAnimState = 6;
|
item->goalAnimState = 6;
|
||||||
|
@ -245,7 +245,7 @@ void __cdecl ScubaControl(__int16 itemNumber)
|
||||||
if (shoot)
|
if (shoot)
|
||||||
head = info.angle;
|
head = info.angle;
|
||||||
|
|
||||||
if (!shoot || creature->mood == MOOD_TYPE::ESCAPE_MOOD || creature->target.y > waterHeight)
|
if (!shoot || creature->mood == ESCAPE_MOOD || creature->target.y > waterHeight)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 7;
|
item->goalAnimState = 7;
|
||||||
|
|
|
@ -141,7 +141,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
GetCreatureMood(item, &info, 1);
|
GetCreatureMood(item, &info, 1);
|
||||||
|
|
||||||
if (!(item->meshBits & 0x200))
|
if (!(item->meshBits & 0x200))
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
else
|
else
|
||||||
CreatureMood(item, &info, 1);
|
CreatureMood(item, &info, 1);
|
||||||
|
|
||||||
|
@ -230,9 +230,9 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
case 2:
|
case 2:
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
creature->LOT.isJumping = false;
|
creature->LOT.isJumping = false;
|
||||||
creature->maximumTurn = creature->mood != MOOD_TYPE::ESCAPE_MOOD ? ANGLE(2) : 0;
|
creature->maximumTurn = creature->mood != ESCAPE_MOOD ? ANGLE(2) : 0;
|
||||||
if (item->aiBits & GUARD
|
if (item->aiBits & GUARD
|
||||||
|| !(GetRandomControl() & 0x1F) && (info.distance > SQUARE(1024) || creature->mood != MOOD_TYPE::ATTACK_MOOD))
|
|| !(GetRandomControl() & 0x1F) && (info.distance > SQUARE(1024) || creature->mood != ATTACK_MOOD))
|
||||||
{
|
{
|
||||||
if (!(GetRandomControl() & 0x3F))
|
if (!(GetRandomControl() & 0x3F))
|
||||||
{
|
{
|
||||||
|
@ -285,7 +285,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target == item || !info.ahead || item->hitStatus || !(item->meshBits & 0x200))
|
if (Lara.target == item || !info.ahead || item->hitStatus || !(item->meshBits & 0x200))
|
||||||
{
|
{
|
||||||
|
@ -294,7 +294,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::BORED_MOOD ||
|
else if (creature->mood != BORED_MOOD ||
|
||||||
item->aiBits & FOLLOW &&
|
item->aiBits & FOLLOW &&
|
||||||
(creature->reachedGoal ||
|
(creature->reachedGoal ||
|
||||||
laraInfo.distance > SQUARE(2048)))
|
laraInfo.distance > SQUARE(2048)))
|
||||||
|
@ -359,7 +359,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
case 15:
|
case 15:
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
creature->LOT.isJumping = false;
|
creature->LOT.isJumping = false;
|
||||||
creature->maximumTurn = creature->mood != MOOD_TYPE::BORED_MOOD ? 1092 : 364;
|
creature->maximumTurn = creature->mood != BORED_MOOD ? 1092 : 364;
|
||||||
if (item->aiBits & PATROL1)
|
if (item->aiBits & PATROL1)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 15;
|
item->goalAnimState = 15;
|
||||||
|
@ -383,11 +383,11 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 16;
|
item->goalAnimState = 16;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood != BORED_MOOD)
|
||||||
{
|
{
|
||||||
if (info.distance >= SQUARE(682))
|
if (info.distance >= SQUARE(682))
|
||||||
{
|
{
|
||||||
|
@ -444,7 +444,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target != item && info.ahead && (item->meshBits & 0x200))
|
if (Lara.target != item && info.ahead && (item->meshBits & 0x200))
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
|
@ -453,7 +453,7 @@ void __cdecl SkeletonControl(__int16 itemNum)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
}
|
}
|
||||||
else if (creature->mood != MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood != BORED_MOOD)
|
||||||
{
|
{
|
||||||
if (info.ahead && info.distance < SQUARE(2048))
|
if (info.ahead && info.distance < SQUARE(2048))
|
||||||
{
|
{
|
||||||
|
|
|
@ -62,7 +62,7 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, VIOLENT);
|
GetCreatureMood(item, &info, VIOLENT);
|
||||||
if (creature->enemy == LaraItem && creature->hurtByLara && info.distance > SQUARE(3072) && info.enemyFacing < ANGLE(67) && info.enemyFacing > -ANGLE(67))
|
if (creature->enemy == LaraItem && creature->hurtByLara && info.distance > SQUARE(3072) && info.enemyFacing < ANGLE(67) && info.enemyFacing > -ANGLE(67))
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
CreatureMood(item, &info, VIOLENT);
|
CreatureMood(item, &info, VIOLENT);
|
||||||
|
|
||||||
angle = CreatureTurn(item, creature->maximumTurn);
|
angle = CreatureTurn(item, creature->maximumTurn);
|
||||||
|
@ -75,13 +75,13 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
creature->maximumTurn = ANGLE(4);
|
creature->maximumTurn = ANGLE(4);
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
creature->maximumTurn = 0;
|
creature->maximumTurn = 0;
|
||||||
if (GetRandomControl() < 0x100)
|
if (GetRandomControl() < 0x100)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target != item && info.ahead && !item->hitStatus)
|
if (Lara.target != item && info.ahead && !item->hitStatus)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -116,13 +116,13 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
creature->maximumTurn = ANGLE(4);
|
creature->maximumTurn = ANGLE(4);
|
||||||
creature->flags = 0;
|
creature->flags = 0;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
creature->maximumTurn = 0;
|
creature->maximumTurn = 0;
|
||||||
if (GetRandomControl() < 0x100)
|
if (GetRandomControl() < 0x100)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target != item && info.ahead && !item->hitStatus)
|
if (Lara.target != item && info.ahead && !item->hitStatus)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -147,7 +147,7 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
creature->maximumTurn = ANGLE(9);
|
creature->maximumTurn = ANGLE(9);
|
||||||
tilt = angle >> 3;
|
tilt = angle >> 3;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
creature->maximumTurn >>= 2;
|
creature->maximumTurn >>= 2;
|
||||||
if (GetRandomControl() < 0x100)
|
if (GetRandomControl() < 0x100)
|
||||||
|
@ -158,7 +158,7 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
else if (info.ahead && info.distance < SQUARE(682))
|
else if (info.ahead && info.distance < SQUARE(682))
|
||||||
{
|
{
|
||||||
|
@ -176,7 +176,7 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
creature->maximumTurn = ANGLE(6);
|
creature->maximumTurn = ANGLE(6);
|
||||||
tilt = angle >> 2;
|
tilt = angle >> 2;
|
||||||
|
|
||||||
if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
creature->maximumTurn >>= 2;
|
creature->maximumTurn >>= 2;
|
||||||
if (GetRandomControl() < 0x100)
|
if (GetRandomControl() < 0x100)
|
||||||
|
@ -187,7 +187,7 @@ void __cdecl TribemanAxeControl(__int16 itemNum)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD && Lara.target != item && info.ahead)
|
else if (creature->mood == ESCAPE_MOOD && Lara.target != item && info.ahead)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
else if (info.bite || info.distance < SQUARE(2048))
|
else if (info.bite || info.distance < SQUARE(2048))
|
||||||
{
|
{
|
||||||
|
@ -350,12 +350,12 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
|
|
||||||
GetCreatureMood(item, &info, (info.zoneNumber == info.enemyZone ? VIOLENT : TIMID));
|
GetCreatureMood(item, &info, (info.zoneNumber == info.enemyZone ? VIOLENT : TIMID));
|
||||||
|
|
||||||
if (item->hitStatus && Lara.poisoned >= 0x100 && creature->mood == MOOD_TYPE::BORED_MOOD)
|
if (item->hitStatus && Lara.poisoned >= 0x100 && creature->mood == BORED_MOOD)
|
||||||
creature->mood = MOOD_TYPE::ESCAPE_MOOD;
|
creature->mood = ESCAPE_MOOD;
|
||||||
|
|
||||||
CreatureMood(item, &info, TIMID);
|
CreatureMood(item, &info, TIMID);
|
||||||
|
|
||||||
angle = CreatureTurn(item, creature->mood == MOOD_TYPE::BORED_MOOD ? ANGLE(2) : creature->maximumTurn);
|
angle = CreatureTurn(item, creature->mood == BORED_MOOD ? ANGLE(2) : creature->maximumTurn);
|
||||||
if (info.ahead)
|
if (info.ahead)
|
||||||
{
|
{
|
||||||
headY = info.angle >> 1;
|
headY = info.angle >> 1;
|
||||||
|
@ -387,7 +387,7 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Lara.target != item && info.ahead && !item->hitStatus)
|
if (Lara.target != item && info.ahead && !item->hitStatus)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
|
@ -400,7 +400,7 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
||||||
item->goalAnimState = 4;
|
item->goalAnimState = 4;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
if (GetRandomControl() < 0x200)
|
if (GetRandomControl() < 0x200)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
|
@ -437,7 +437,7 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD && GetRandomControl() < 0x200)
|
else if (creature->mood == BORED_MOOD && GetRandomControl() < 0x200)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else
|
else
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
|
@ -452,9 +452,9 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
else if (Targetable(item, &info) && info.distance < SQUARE(8192))
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
{
|
{
|
||||||
if (GetRandomControl() > 0x200)
|
if (GetRandomControl() > 0x200)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
|
@ -478,9 +478,9 @@ void __cdecl TribesmanDartsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
if (item->aiBits & GUARD)
|
if (item->aiBits & GUARD)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD && Lara.target != item && info.ahead)
|
else if (creature->mood == ESCAPE_MOOD && Lara.target != item && info.ahead)
|
||||||
item->goalAnimState = 11;
|
item->goalAnimState = 11;
|
||||||
else if (creature->mood == MOOD_TYPE::BORED_MOOD)
|
else if (creature->mood == BORED_MOOD)
|
||||||
item->goalAnimState = 1;
|
item->goalAnimState = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "..\Game\sphere.h"
|
#include "..\Game\sphere.h"
|
||||||
#include "..\Game\effect2.h"
|
#include "..\Game\effect2.h"
|
||||||
#include "..\Game\people.h"
|
#include "..\Game\people.h"
|
||||||
|
#include "..\Game\lara.h"
|
||||||
|
|
||||||
BITE_INFO TroopsBite1 = { 0, 300, 64, 7 };
|
BITE_INFO TroopsBite1 = { 0, 300, 64, 7 };
|
||||||
|
|
||||||
|
@ -172,6 +173,11 @@ void __cdecl TroopsControl(__int16 itemNum)
|
||||||
}
|
}
|
||||||
|
|
||||||
GetCreatureMood(item, &info, TIMID);
|
GetCreatureMood(item, &info, TIMID);
|
||||||
|
|
||||||
|
// Vehicle handling
|
||||||
|
if (g_LaraExtra.Vehicle != NO_ITEM && info.bite)
|
||||||
|
creature->mood == ESCAPE_MOOD;
|
||||||
|
|
||||||
CreatureMood(item, &info, TIMID);
|
CreatureMood(item, &info, TIMID);
|
||||||
|
|
||||||
angle = CreatureTurn(item, creature->maximumTurn);
|
angle = CreatureTurn(item, creature->maximumTurn);
|
||||||
|
@ -223,7 +229,7 @@ void __cdecl TroopsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
joint2 = 0;
|
joint2 = 0;
|
||||||
}
|
}
|
||||||
else if (creature->mood == MOOD_TYPE::ESCAPE_MOOD)
|
else if (creature->mood == ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
item->goalAnimState = 3;
|
item->goalAnimState = 3;
|
||||||
}
|
}
|
||||||
|
@ -325,14 +331,14 @@ void __cdecl TroopsControl(__int16 itemNum)
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (creature->mood != MOOD_TYPE::ESCAPE_MOOD)
|
if (creature->mood != ESCAPE_MOOD)
|
||||||
{
|
{
|
||||||
if (Targetable(item, &info))
|
if (Targetable(item, &info))
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!creature->mood || creature->mood == MOOD_TYPE::STALK_MOOD &&
|
if (!creature->mood || creature->mood == STALK_MOOD &&
|
||||||
!(item->aiBits & FOLLOW) && info.distance < SQUARE(2048))
|
!(item->aiBits & FOLLOW) && info.distance < SQUARE(2048))
|
||||||
{
|
{
|
||||||
item->goalAnimState = 2;
|
item->goalAnimState = 2;
|
||||||
|
@ -428,7 +434,7 @@ void __cdecl TroopsControl(__int16 itemNum)
|
||||||
|
|
||||||
case 11:
|
case 11:
|
||||||
if (item->goalAnimState != 1
|
if (item->goalAnimState != 1
|
||||||
&& (creature->mood == MOOD_TYPE::ESCAPE_MOOD ||
|
&& (creature->mood == ESCAPE_MOOD ||
|
||||||
info.distance > SQUARE(3072) ||
|
info.distance > SQUARE(3072) ||
|
||||||
!Targetable(item, &info)))
|
!Targetable(item, &info)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -2633,11 +2633,6 @@ bool Renderer11::ChangeScreenResolution(__int32 width, __int32 height, __int32 f
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Renderer11::Test()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ID3D11Buffer* Renderer11::createConstantBuffer(__int32 size)
|
ID3D11Buffer* Renderer11::createConstantBuffer(__int32 size)
|
||||||
{
|
{
|
||||||
ID3D11Buffer* buffer;
|
ID3D11Buffer* buffer;
|
||||||
|
|
|
@ -762,78 +762,78 @@ class Renderer11
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
// Core DX11 objects
|
// Core DX11 objects
|
||||||
ID3D11Device* m_device = NULL;
|
ID3D11Device* m_device = NULL;
|
||||||
ID3D11DeviceContext* m_context = NULL;
|
ID3D11DeviceContext* m_context = NULL;
|
||||||
IDXGISwapChain* m_swapChain = NULL;
|
IDXGISwapChain* m_swapChain = NULL;
|
||||||
IDXGIDevice* m_dxgiDevice = NULL;
|
IDXGIDevice* m_dxgiDevice = NULL;
|
||||||
CommonStates* m_states = NULL;
|
CommonStates* m_states = NULL;
|
||||||
ID3D11InputLayout* m_inputLayout = NULL;
|
ID3D11InputLayout* m_inputLayout = NULL;
|
||||||
D3D11_VIEWPORT m_viewport;
|
D3D11_VIEWPORT m_viewport;
|
||||||
D3D11_VIEWPORT m_shadowMapViewport;
|
D3D11_VIEWPORT m_shadowMapViewport;
|
||||||
Viewport* m_viewportToolkit;
|
Viewport* m_viewportToolkit;
|
||||||
vector<RendererVideoAdapter> m_adapters;
|
vector<RendererVideoAdapter> m_adapters;
|
||||||
|
|
||||||
// Main back buffer
|
// Main back buffer
|
||||||
ID3D11RenderTargetView* m_backBufferRTV;
|
ID3D11RenderTargetView* m_backBufferRTV;
|
||||||
ID3D11Texture2D* m_backBufferTexture;
|
ID3D11Texture2D* m_backBufferTexture;
|
||||||
|
|
||||||
ID3D11DepthStencilState* m_depthStencilState;
|
ID3D11DepthStencilState* m_depthStencilState;
|
||||||
ID3D11DepthStencilView* m_depthStencilView;
|
ID3D11DepthStencilView* m_depthStencilView;
|
||||||
ID3D11Texture2D* m_depthStencilTexture;
|
ID3D11Texture2D* m_depthStencilTexture;
|
||||||
|
|
||||||
RenderTarget2D* m_dumpScreenRenderTarget;
|
RenderTarget2D* m_dumpScreenRenderTarget;
|
||||||
RenderTarget2D* m_renderTarget;
|
RenderTarget2D* m_renderTarget;
|
||||||
RenderTarget2D* m_currentRenderTarget;
|
RenderTarget2D* m_currentRenderTarget;
|
||||||
RenderTarget2D* m_shadowMap;
|
RenderTarget2D* m_shadowMap;
|
||||||
|
|
||||||
// Shaders
|
// Shaders
|
||||||
ID3D11VertexShader* m_vsRooms;
|
ID3D11VertexShader* m_vsRooms;
|
||||||
ID3D11PixelShader* m_psRooms;
|
ID3D11PixelShader* m_psRooms;
|
||||||
ID3D11VertexShader* m_vsItems;
|
ID3D11VertexShader* m_vsItems;
|
||||||
ID3D11PixelShader* m_psItems;
|
ID3D11PixelShader* m_psItems;
|
||||||
ID3D11VertexShader* m_vsHairs;
|
ID3D11VertexShader* m_vsHairs;
|
||||||
ID3D11PixelShader* m_psHairs;
|
ID3D11PixelShader* m_psHairs;
|
||||||
ID3D11VertexShader* m_vsStatics;
|
ID3D11VertexShader* m_vsStatics;
|
||||||
ID3D11PixelShader* m_psStatics;
|
ID3D11PixelShader* m_psStatics;
|
||||||
ID3D11VertexShader* m_vsSky;
|
ID3D11VertexShader* m_vsSky;
|
||||||
ID3D11PixelShader* m_psSky;
|
ID3D11PixelShader* m_psSky;
|
||||||
ID3D11VertexShader* m_vsSprites;
|
ID3D11VertexShader* m_vsSprites;
|
||||||
ID3D11PixelShader* m_psSprites;
|
ID3D11PixelShader* m_psSprites;
|
||||||
ID3D11VertexShader* m_vsSolid;
|
ID3D11VertexShader* m_vsSolid;
|
||||||
ID3D11PixelShader* m_psSolid;
|
ID3D11PixelShader* m_psSolid;
|
||||||
ID3D11VertexShader* m_vsInventory;
|
ID3D11VertexShader* m_vsInventory;
|
||||||
ID3D11PixelShader* m_psInventory;
|
ID3D11PixelShader* m_psInventory;
|
||||||
ID3D11VertexShader* m_vsFullScreenQuad;
|
ID3D11VertexShader* m_vsFullScreenQuad;
|
||||||
ID3D11PixelShader* m_psFullScreenQuad;
|
ID3D11PixelShader* m_psFullScreenQuad;
|
||||||
ID3D11VertexShader* m_vsShadowMap;
|
ID3D11VertexShader* m_vsShadowMap;
|
||||||
ID3D11PixelShader* m_psShadowMap;
|
ID3D11PixelShader* m_psShadowMap;
|
||||||
|
|
||||||
// Constant buffers
|
// Constant buffers
|
||||||
CCameraMatrixBuffer m_stCameraMatrices;
|
CCameraMatrixBuffer m_stCameraMatrices;
|
||||||
ID3D11Buffer* m_cbCameraMatrices;
|
ID3D11Buffer* m_cbCameraMatrices;
|
||||||
CItemBuffer m_stItem;
|
CItemBuffer m_stItem;
|
||||||
ID3D11Buffer* m_cbItem;
|
ID3D11Buffer* m_cbItem;
|
||||||
CStaticBuffer m_stStatic;
|
CStaticBuffer m_stStatic;
|
||||||
ID3D11Buffer* m_cbStatic;
|
ID3D11Buffer* m_cbStatic;
|
||||||
CLightBuffer m_stLights;
|
CLightBuffer m_stLights;
|
||||||
ID3D11Buffer* m_cbLights;
|
ID3D11Buffer* m_cbLights;
|
||||||
CMiscBuffer m_stMisc;
|
CMiscBuffer m_stMisc;
|
||||||
ID3D11Buffer* m_cbMisc;
|
ID3D11Buffer* m_cbMisc;
|
||||||
CShadowLightBuffer m_stShadowMap;
|
CShadowLightBuffer m_stShadowMap;
|
||||||
ID3D11Buffer* m_cbShadowMap;
|
ID3D11Buffer* m_cbShadowMap;
|
||||||
|
|
||||||
// Text and sprites
|
// Text and sprites
|
||||||
SpriteFont* m_gameFont;
|
SpriteFont* m_gameFont;
|
||||||
SpriteBatch* m_spriteBatch;
|
SpriteBatch* m_spriteBatch;
|
||||||
vector<RendererStringToDraw> m_strings;
|
vector<RendererStringToDraw> m_strings;
|
||||||
__int32 m_blinkColorValue;
|
__int32 m_blinkColorValue;
|
||||||
__int32 m_blinkColorDirection;
|
__int32 m_blinkColorDirection;
|
||||||
PrimitiveBatch<RendererVertex>* m_primitiveBatch;
|
PrimitiveBatch<RendererVertex>* m_primitiveBatch;
|
||||||
|
|
||||||
// System resources
|
// System resources
|
||||||
Texture2D* m_caustics[NUM_CAUSTICS_TEXTURES];
|
Texture2D* m_caustics[NUM_CAUSTICS_TEXTURES];
|
||||||
Texture2D* m_binocularsTexture;
|
Texture2D* m_binocularsTexture;
|
||||||
Texture2D* m_whiteTexture;
|
Texture2D* m_whiteTexture;
|
||||||
|
|
||||||
// Level data
|
// Level data
|
||||||
Texture2D* m_titleScreen;
|
Texture2D* m_titleScreen;
|
||||||
|
@ -917,125 +917,124 @@ private:
|
||||||
__int32 m_pickupRotation;
|
__int32 m_pickupRotation;
|
||||||
|
|
||||||
// Private functions
|
// Private functions
|
||||||
bool drawScene(bool dump);
|
bool drawScene(bool dump);
|
||||||
bool drawAllStrings();
|
bool drawAllStrings();
|
||||||
ID3D11VertexShader* compileVertexShader(char* fileName, char* function, char* model, ID3D10Blob** bytecode);
|
ID3D11VertexShader* compileVertexShader(char* fileName, char* function, char* model, ID3D10Blob** bytecode);
|
||||||
ID3D11GeometryShader* compileGeometryShader(char* fileName);
|
ID3D11GeometryShader* compileGeometryShader(char* fileName);
|
||||||
ID3D11PixelShader* compilePixelShader(char* fileName, char* function, char* model, ID3D10Blob** bytecode);
|
ID3D11PixelShader* compilePixelShader(char* fileName, char* function, char* model, ID3D10Blob** bytecode);
|
||||||
ID3D11ComputeShader* compileComputeShader(char* fileName);
|
ID3D11ComputeShader* compileComputeShader(char* fileName);
|
||||||
ID3D11Buffer* createConstantBuffer(__int32 size);
|
ID3D11Buffer* createConstantBuffer(__int32 size);
|
||||||
__int32 getAnimatedTextureInfo(__int16 textureId);
|
__int32 getAnimatedTextureInfo(__int16 textureId);
|
||||||
void initialiseHairRemaps();
|
void initialiseHairRemaps();
|
||||||
RendererMesh* getRendererMeshFromTrMesh(RendererObject* obj, __int16* meshPtr, __int16* refMeshPtr, __int16 boneIndex, __int32 isJoints, __int32 isHairs);
|
RendererMesh* getRendererMeshFromTrMesh(RendererObject* obj, __int16* meshPtr, __int16* refMeshPtr, __int16 boneIndex, __int32 isJoints, __int32 isHairs);
|
||||||
void fromTrAngle(Matrix* matrix, __int16* frameptr, __int32 index);
|
void fromTrAngle(Matrix* matrix, __int16* frameptr, __int32 index);
|
||||||
void buildHierarchy(RendererObject* obj);
|
void buildHierarchy(RendererObject* obj);
|
||||||
void buildHierarchyRecursive(RendererObject* obj, RendererBone* node, RendererBone* parentNode);
|
void buildHierarchyRecursive(RendererObject* obj, RendererBone* node, RendererBone* parentNode);
|
||||||
void updateAnimation(RendererItem* item, RendererObject* obj, __int16** frmptr, __int16 frac, __int16 rate, __int32 mask);
|
void updateAnimation(RendererItem* item, RendererObject* obj, __int16** frmptr, __int16 frac, __int16 rate, __int32 mask);
|
||||||
bool printDebugMessage(__int32 x, __int32 y, __int32 alpha, byte r, byte g, byte b, LPCSTR Message);
|
bool printDebugMessage(__int32 x, __int32 y, __int32 alpha, byte r, byte g, byte b, LPCSTR Message);
|
||||||
bool checkPortal(__int16 roomIndex, __int16* portal, Vector4* viewPort, Vector4* clipPort);
|
bool checkPortal(__int16 roomIndex, __int16* portal, Vector4* viewPort, Vector4* clipPort);
|
||||||
void getVisibleRooms(int from, int to, Vector4* viewPort, bool water, int count);
|
void getVisibleRooms(int from, int to, Vector4* viewPort, bool water, int count);
|
||||||
void collectRooms();
|
void collectRooms();
|
||||||
inline void collectItems(__int16 roomNumber);
|
inline void collectItems(__int16 roomNumber);
|
||||||
inline void collectStatics(__int16 roomNumber);
|
inline void collectStatics(__int16 roomNumber);
|
||||||
inline void collectLightsForRoom(__int16 roomNumber);
|
inline void collectLightsForRoom(__int16 roomNumber);
|
||||||
inline void collectLightsForItem(__int16 roomNumber, RendererItem* item);
|
inline void collectLightsForItem(__int16 roomNumber, RendererItem* item);
|
||||||
inline void collectEffects(__int16 roomNumber);
|
inline void collectEffects(__int16 roomNumber);
|
||||||
void prepareLights();
|
void prepareLights();
|
||||||
void clearSceneItems();
|
void clearSceneItems();
|
||||||
bool updateConstantBuffer(ID3D11Buffer* buffer, void* data, __int32 size);
|
bool updateConstantBuffer(ID3D11Buffer* buffer, void* data, __int32 size);
|
||||||
void updateLaraAnimations();
|
void updateLaraAnimations();
|
||||||
void updateItemsAnimations();
|
void updateItemsAnimations();
|
||||||
void updateEffects();
|
void updateEffects();
|
||||||
__int32 getFrame(__int16 animation, __int16 frame, __int16** framePtr, __int32* rate);
|
__int32 getFrame(__int16 animation, __int16 frame, __int16** framePtr, __int32* rate);
|
||||||
bool drawAmbientCubeMap(__int16 roomNumber);
|
bool drawAmbientCubeMap(__int16 roomNumber);
|
||||||
bool sphereBoxIntersection(Vector3 boxMin, Vector3 boxMax, Vector3 sphereCentre, float sphereRadius);
|
bool sphereBoxIntersection(Vector3 boxMin, Vector3 boxMax, Vector3 sphereCentre, float sphereRadius);
|
||||||
bool drawHorizonAndSky();
|
bool drawHorizonAndSky();
|
||||||
bool drawRooms(bool transparent, bool animated);
|
bool drawRooms(bool transparent, bool animated);
|
||||||
bool drawStatics(bool transparent);
|
bool drawStatics(bool transparent);
|
||||||
bool drawItems(bool transparent, bool animated);
|
bool drawItems(bool transparent, bool animated);
|
||||||
bool drawAnimatingItem(RendererItem* item, bool transparent, bool animated);
|
bool drawAnimatingItem(RendererItem* item, bool transparent, bool animated);
|
||||||
bool drawWaterfalls();
|
bool drawWaterfalls();
|
||||||
bool drawShadowMap();
|
bool drawShadowMap();
|
||||||
bool drawObjectOn2DPosition(__int16 x, __int16 y, __int16 objectNum, __int16 rotX, __int16 rotY, __int16 rotZ);
|
bool drawObjectOn2DPosition(__int16 x, __int16 y, __int16 objectNum, __int16 rotX, __int16 rotY, __int16 rotZ);
|
||||||
bool drawLara(bool transparent, bool shadowMap);
|
bool drawLara(bool transparent, bool shadowMap);
|
||||||
void printDebugMessage(char* message, ...);
|
void printDebugMessage(char* message, ...);
|
||||||
void drawFires();
|
void drawFires();
|
||||||
void drawSparks();
|
void drawSparks();
|
||||||
void drawSmokes();
|
void drawSmokes();
|
||||||
void drawBlood();
|
void drawBlood();
|
||||||
void drawDrips();
|
void drawDrips();
|
||||||
void drawBubbles();
|
void drawBubbles();
|
||||||
void drawSplahes();
|
void drawSplahes();
|
||||||
bool drawSprites();
|
bool drawSprites();
|
||||||
bool drawLines3D();
|
bool drawLines3D();
|
||||||
bool drawLines2D();
|
bool drawLines2D();
|
||||||
bool drawOverlays();
|
bool drawOverlays();
|
||||||
bool drawRopes();
|
bool drawRopes();
|
||||||
bool drawBats();
|
bool drawBats();
|
||||||
bool drawRats();
|
bool drawRats();
|
||||||
bool drawSpiders();
|
bool drawSpiders();
|
||||||
bool drawGunFlashes();
|
bool drawGunFlashes();
|
||||||
bool drawGunShells();
|
bool drawGunShells();
|
||||||
bool drawBar(__int32 x, __int32 y, __int32 w, __int32 h, __int32 percent, __int32 color1, __int32 color2);
|
bool drawBar(__int32 x, __int32 y, __int32 w, __int32 h, __int32 percent, __int32 color1, __int32 color2);
|
||||||
void insertLine2D(__int32 x1, __int32 y1, __int32 x2, __int32 y2, byte r, byte g, byte b, byte a);
|
void insertLine2D(__int32 x1, __int32 y1, __int32 x2, __int32 y2, byte r, byte g, byte b, byte a);
|
||||||
bool drawDebris(bool transparent);
|
bool drawDebris(bool transparent);
|
||||||
__int32 drawInventoryScene();
|
__int32 drawInventoryScene();
|
||||||
__int32 drawFinalPass();
|
__int32 drawFinalPass();
|
||||||
void updateAnimatedTextures();
|
void updateAnimatedTextures();
|
||||||
void createBillboardMatrix(Matrix* out, Vector3* particlePos, Vector3* cameraPos, float rotation);
|
void createBillboardMatrix(Matrix* out, Vector3* particlePos, Vector3* cameraPos, float rotation);
|
||||||
void drawShockwaves();
|
void drawShockwaves();
|
||||||
void drawRipples();
|
void drawRipples();
|
||||||
void drawUnderwaterDust();
|
void drawUnderwaterDust();
|
||||||
bool doRain();
|
bool doRain();
|
||||||
bool doSnow();
|
bool doSnow();
|
||||||
bool drawFullScreenQuad(ID3D11ShaderResourceView* texture, Vector3 color, bool cinematicBars);
|
bool drawFullScreenQuad(ID3D11ShaderResourceView* texture, Vector3 color, bool cinematicBars);
|
||||||
bool isRoomUnderwater(__int16 roomNumber);
|
bool isRoomUnderwater(__int16 roomNumber);
|
||||||
bool isInRoom(__int32 x, __int32 y, __int32 z, __int16 roomNumber);
|
bool isInRoom(__int32 x, __int32 y, __int32 z, __int16 roomNumber);
|
||||||
void addSpriteBillboard(RendererSprite* sprite, float x, float y, float z, byte r, byte g, byte b, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
|
void addSpriteBillboard(RendererSprite* sprite, float x, float y, float z, byte r, byte g, byte b, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
|
||||||
void addSprite3D(RendererSprite* sprite, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, byte r, byte g, byte b, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
|
void addSprite3D(RendererSprite* sprite, float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4, byte r, byte g, byte b, float rotation, float scale, float width, float height, BLEND_MODES blendMode);
|
||||||
void addLine3D(__int32 x1, __int32 y1, __int32 z1, __int32 x2, __int32 y2, __int32 z2, byte r, byte g, byte b);
|
void addLine3D(__int32 x1, __int32 y1, __int32 z1, __int32 x2, __int32 y2, __int32 z2, byte r, byte g, byte b);
|
||||||
bool drawColoredQuad(__int32 x, __int32 y, __int32 w, __int32 h, Vector4 color);
|
bool drawColoredQuad(__int32 x, __int32 y, __int32 w, __int32 h, Vector4 color);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Matrix View;
|
Matrix View;
|
||||||
Matrix Projection;
|
Matrix Projection;
|
||||||
Matrix ViewProjection;
|
Matrix ViewProjection;
|
||||||
float FieldOfView;
|
float FieldOfView;
|
||||||
__int32 ScreenWidth;
|
__int32 ScreenWidth;
|
||||||
__int32 ScreenHeight;
|
__int32 ScreenHeight;
|
||||||
bool Windowed;
|
bool Windowed;
|
||||||
__int32 NumTexturePages;
|
__int32 NumTexturePages;
|
||||||
|
|
||||||
Renderer11();
|
Renderer11();
|
||||||
~Renderer11();
|
~Renderer11();
|
||||||
|
|
||||||
void Test();
|
bool Create();
|
||||||
bool Create();
|
bool EnumerateVideoModes();
|
||||||
bool EnumerateVideoModes();
|
bool Initialise(__int32 w, __int32 h, __int32 refreshRate, bool windowed, HWND handle);
|
||||||
bool Initialise(__int32 w, __int32 h, __int32 refreshRate, bool windowed, HWND handle);
|
__int32 Draw();
|
||||||
__int32 Draw();
|
bool PrepareDataForTheRenderer();
|
||||||
bool PrepareDataForTheRenderer();
|
void UpdateCameraMatrices(float posX, float posY, float posZ, float targetX, float targetY, float targetZ, float roll, float fov);
|
||||||
void UpdateCameraMatrices(float posX, float posY, float posZ, float targetX, float targetY, float targetZ, float roll, float fov);
|
__int32 DumpGameScene();
|
||||||
__int32 DumpGameScene();
|
__int32 DrawInventory();
|
||||||
__int32 DrawInventory();
|
__int32 DrawPickup(__int16 objectNum);
|
||||||
__int32 DrawPickup(__int16 objectNum);
|
__int32 SyncRenderer();
|
||||||
__int32 SyncRenderer();
|
bool PrintString(__int32 x, __int32 y, char* string, D3DCOLOR color, __int32 flags);
|
||||||
bool PrintString(__int32 x, __int32 y, char* string, D3DCOLOR color, __int32 flags);
|
void DrawDashBar();
|
||||||
void DrawDashBar();
|
void DrawHealthBar(__int32 percentual);
|
||||||
void DrawHealthBar(__int32 percentual);
|
void DrawAirBar(__int32 percentual);
|
||||||
void DrawAirBar(__int32 percentual);
|
void ClearDynamicLights();
|
||||||
void ClearDynamicLights();
|
void AddDynamicLight(__int32 x, __int32 y, __int32 z, __int16 falloff, byte r, byte g, byte b);
|
||||||
void AddDynamicLight(__int32 x, __int32 y, __int32 z, __int16 falloff, byte r, byte g, byte b);
|
void FreeRendererData();
|
||||||
void FreeRendererData();
|
void EnableCinematicBars(bool value);
|
||||||
void EnableCinematicBars(bool value);
|
void FadeIn();
|
||||||
void FadeIn();
|
void FadeOut();
|
||||||
void FadeOut();
|
void DrawLoadingScreen(char* fileName);
|
||||||
void DrawLoadingScreen(char* fileName);
|
void UpdateProgress(float value);
|
||||||
void UpdateProgress(float value);
|
bool IsFading();
|
||||||
bool IsFading();
|
void GetLaraBonePosition(Vector3* pos, __int32 bone);
|
||||||
void GetLaraBonePosition(Vector3* pos, __int32 bone);
|
bool ToggleFullScreen();
|
||||||
bool ToggleFullScreen();
|
bool IsFullsScreen();
|
||||||
bool IsFullsScreen();
|
vector<RendererVideoAdapter>* GetAdapters();
|
||||||
vector<RendererVideoAdapter>* GetAdapters();
|
bool ChangeScreenResolution(__int32 width, __int32 height, __int32 frequency, bool windowed);
|
||||||
bool ChangeScreenResolution(__int32 width, __int32 height, __int32 frequency, bool windowed);
|
|
||||||
};
|
};
|
|
@ -402,16 +402,9 @@ bool GameFlow::DoGameflow()
|
||||||
SelectedSaveGame = 0;
|
SelectedSaveGame = 0;
|
||||||
SaveGameHeader header;
|
SaveGameHeader header;
|
||||||
|
|
||||||
// DEBUG: test
|
|
||||||
/*CurrentLevel = 1;
|
|
||||||
SelectedLevelForNewGame = 0;
|
|
||||||
gfInitialiseGame = true;
|
|
||||||
DoLevel(CurrentLevel, 126, false);
|
|
||||||
|
|
||||||
return true;*/
|
|
||||||
|
|
||||||
// We loop indefinitely, looking for return values of DoTitle or DoLevel
|
// We loop indefinitely, looking for return values of DoTitle or DoLevel
|
||||||
bool loadFromSavegame = false;
|
bool loadFromSavegame = false;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
// First we need to fill some legacy variables in PCTomb5.exe
|
// First we need to fill some legacy variables in PCTomb5.exe
|
||||||
|
@ -457,17 +450,17 @@ bool GameFlow::DoGameflow()
|
||||||
|
|
||||||
switch (status)
|
switch (status)
|
||||||
{
|
{
|
||||||
case GAME_STATUS::GAME_STATUS_EXIT_GAME:
|
case GAME_STATUS_EXIT_GAME:
|
||||||
return true;
|
return true;
|
||||||
case GAME_STATUS::GAME_STATUS_EXIT_TO_TITLE:
|
case GAME_STATUS_EXIT_TO_TITLE:
|
||||||
CurrentLevel = 0;
|
CurrentLevel = 0;
|
||||||
break;
|
break;
|
||||||
case GAME_STATUS::GAME_STATUS_NEW_GAME:
|
case GAME_STATUS_NEW_GAME:
|
||||||
CurrentLevel = (SelectedLevelForNewGame != 0 ? SelectedLevelForNewGame : 1);
|
CurrentLevel = (SelectedLevelForNewGame != 0 ? SelectedLevelForNewGame : 1);
|
||||||
SelectedLevelForNewGame = 0;
|
SelectedLevelForNewGame = 0;
|
||||||
gfInitialiseGame = true;
|
gfInitialiseGame = true;
|
||||||
break;
|
break;
|
||||||
case GAME_STATUS::GAME_STATUS_LOAD_GAME:
|
case GAME_STATUS_LOAD_GAME:
|
||||||
// Load the header of the savegame for getting the level to load
|
// Load the header of the savegame for getting the level to load
|
||||||
char fileName[255];
|
char fileName[255];
|
||||||
ZeroMemory(fileName, 255);
|
ZeroMemory(fileName, 255);
|
||||||
|
@ -479,7 +472,7 @@ bool GameFlow::DoGameflow()
|
||||||
loadFromSavegame = true;
|
loadFromSavegame = true;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case GAME_STATUS::GAME_STATUS_LEVEL_COMPLETED:
|
case GAME_STATUS_LEVEL_COMPLETED:
|
||||||
if (LevelComplete == Levels.size())
|
if (LevelComplete == Levels.size())
|
||||||
{
|
{
|
||||||
// TODO: final credits
|
// TODO: final credits
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
#define REGKEY_ROOT "Software\\TR5Main\\TR5Main"
|
#define REGKEY_ROOT "Software\\TR5Main\\TR5Main"
|
||||||
|
|
||||||
|
@ -62,24 +63,7 @@ typedef struct GameConfiguration {
|
||||||
__int32 MaxDrawDistance;
|
__int32 MaxDrawDistance;
|
||||||
__int32 MusicVolume;
|
__int32 MusicVolume;
|
||||||
__int32 SfxVolume;
|
__int32 SfxVolume;
|
||||||
__int32 Key0;
|
byte KeyboardLayout[NUM_CONTROLS];
|
||||||
__int32 Key1;
|
|
||||||
__int32 Key2;
|
|
||||||
__int32 Key3;
|
|
||||||
__int32 Key4;
|
|
||||||
__int32 Key5;
|
|
||||||
__int32 Key6;
|
|
||||||
__int32 Key7;
|
|
||||||
__int32 Key8;
|
|
||||||
__int32 Key9;
|
|
||||||
__int32 Key10;
|
|
||||||
__int32 Key11;
|
|
||||||
__int32 Key12;
|
|
||||||
__int32 Key13;
|
|
||||||
__int32 Key14;
|
|
||||||
__int32 Key15;
|
|
||||||
__int32 Key16;
|
|
||||||
__int32 Key17;
|
|
||||||
bool ControlMethod;
|
bool ControlMethod;
|
||||||
__int32 JoyDuck;
|
__int32 JoyDuck;
|
||||||
__int32 JoyAction;
|
__int32 JoyAction;
|
||||||
|
|
|
@ -43,48 +43,6 @@ char* g_KeyNames[] = {
|
||||||
"JOY9", "JOY10", "JOY11", "JOY12", "JOY13", "JOY14", "JOY15", "JOY16"
|
"JOY9", "JOY10", "JOY11", "JOY12", "JOY13", "JOY14", "JOY15", "JOY16"
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
int keyMapping[] = {
|
|
||||||
-1, VK_ESCAPE, VK_, "2", "3", "4", "5", "6",
|
|
||||||
"7", "8", "9", "0", "-", "+", "BKSP", "TAB",
|
|
||||||
"Q", "W", "E", "R", "T", "Y", "U", "I",
|
|
||||||
"O", "P", "<", ">", "RET", "CTRL", "A", "S",
|
|
||||||
"D", "F", "G", "H", "J", "K", "L", ";",
|
|
||||||
"'", "`", "SHIFT", "#", "Z", "X", "C", "V",
|
|
||||||
"B", "N", "M", ",", ".", "/", "SHIFT", "PADx",
|
|
||||||
"ALT", "SPACE", "CAPS", -1, -1, -1, -1, -1,
|
|
||||||
|
|
||||||
-1, -1, -1, -1, -1, "NMLK", -1, "PAD7",
|
|
||||||
"PAD8", "PAD9", "PAD-", "PAD4", "PAD5", "PAD6", "PAD+", "PAD1",
|
|
||||||
"PAD2", "PAD3", "PAD0", "PAD.", -1, -1, "\\", -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, "ENTER", "CTRL", -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, "SHIFT", -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, "PAD/", -1, -1,
|
|
||||||
"ALT", -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, "HOME",
|
|
||||||
"UP", "PGUP", -1, "LEFT", -1, "RIGHT", -1, "END",
|
|
||||||
"DOWN", "PGDN", "INS", "DEL", -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
-1, -1, -1, -1, -1, -1, -1, -1,
|
|
||||||
|
|
||||||
"JOY1", "JOY2", "JOY3", "JOY4", "JOY5", "JOY6", "JOY7", "JOY8",
|
|
||||||
"JOY9", "JOY10", "JOY11", "JOY12", "JOY13", "JOY14", "JOY15", "JOY16"
|
|
||||||
};*/
|
|
||||||
|
|
||||||
void __cdecl InitialiseDirectInput(HWND handle, HINSTANCE instance)
|
void __cdecl InitialiseDirectInput(HWND handle, HINSTANCE instance)
|
||||||
{
|
{
|
||||||
// Dummy function, we don't need DirectInput anymore
|
// Dummy function, we don't need DirectInput anymore
|
||||||
|
@ -119,6 +77,7 @@ void __cdecl DI_ReadKeyboard(byte* keys)
|
||||||
keys[TR_KEY_HOME] = GetAsyncKeyState(VK_HOME) >> 8;
|
keys[TR_KEY_HOME] = GetAsyncKeyState(VK_HOME) >> 8;
|
||||||
keys[TR_KEY_INSERT] = GetAsyncKeyState(VK_INSERT) >> 8;
|
keys[TR_KEY_INSERT] = GetAsyncKeyState(VK_INSERT) >> 8;
|
||||||
keys[TR_KEY_DELETE] = GetAsyncKeyState(VK_DELETE) >> 8;
|
keys[TR_KEY_DELETE] = GetAsyncKeyState(VK_DELETE) >> 8;
|
||||||
|
keys[TR_KEY_NUMPAD0] = GetAsyncKeyState(VK_NUMPAD0) >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
__int32 __cdecl DD_SpinMessageLoopMaybe()
|
__int32 __cdecl DD_SpinMessageLoopMaybe()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue