1
0
Fork 0
mirror of https://github.com/k4zmu2a/SpaceCadetPinball.git synced 2024-11-22 08:50:18 +01:00

Compare commits

..

No commits in common. "4e8dbd0b86a6430e7939c6d9f2b10a5f6fd9abfe" and "95007c92539ead46102f2494cfc00f3a1cdff10c" have entirely different histories.

8 changed files with 17 additions and 35 deletions

View file

@ -34,12 +34,9 @@ TBall::TBall(TPinballTable* table) : TPinballComponent(table, -1, false)
ListBitmap = new std::vector<gdrv_bitmap8*>(); ListBitmap = new std::vector<gdrv_bitmap8*>();
/*Full tilt: ball is ballN, where N[0,2] resolution*/ /*Full tilt: ball is ballN, where N[0,2] resolution*/
auto groupIndex = loader::query_handle(ballGroupName); if (pb::FullTiltMode)
if (groupIndex < 0)
{
ballGroupName[4] = '0' + fullscrn::GetResolution(); ballGroupName[4] = '0' + fullscrn::GetResolution();
groupIndex = loader::query_handle(ballGroupName); auto groupIndex = loader::query_handle(ballGroupName);
}
Offset = *loader::query_float_attribute(groupIndex, 0, 500); Offset = *loader::query_float_attribute(groupIndex, 0, 500);

View file

@ -45,7 +45,7 @@ TKickout::TKickout(TPinballTable* table, int groupIndex, bool someFlag): TCollis
Circle.RadiusSq = visual.FloatArr[2] * visual.FloatArr[2]; Circle.RadiusSq = visual.FloatArr[2] * visual.FloatArr[2];
auto zAttr = loader::query_float_attribute(groupIndex, 0, 408); auto zAttr = loader::query_float_attribute(groupIndex, 0, 408);
CollisionBallSetZ = pb::FullTiltMode && !pb::FullTiltDemoMode ? zAttr[3] : zAttr[2]; CollisionBallSetZ = pb::FullTiltMode ? zAttr[3] : zAttr[2];
ThrowSpeedMult2 = visual.Kicker.ThrowBallMult * 0.01f; ThrowSpeedMult2 = visual.Kicker.ThrowBallMult * 0.01f;
BallAcceleration = visual.Kicker.ThrowBallAcceleration; BallAcceleration = visual.Kicker.ThrowBallAcceleration;
ThrowAngleMult = visual.Kicker.ThrowBallAngleMult; ThrowAngleMult = visual.Kicker.ThrowBallAngleMult;

View file

@ -54,13 +54,11 @@ TTableLayer::TTableLayer(TPinballTable* table): TCollisionComponent(table, -1, f
GraityDirX = cos(PinballTable->GravityAnglY) * sin(PinballTable->GravityAngleX) * PinballTable->GravityDirVectMult; GraityDirX = cos(PinballTable->GravityAnglY) * sin(PinballTable->GravityAngleX) * PinballTable->GravityDirVectMult;
GraityDirY = sin(PinballTable->GravityAnglY) * sin(PinballTable->GravityAngleX) * PinballTable->GravityDirVectMult; GraityDirY = sin(PinballTable->GravityAnglY) * sin(PinballTable->GravityAngleX) * PinballTable->GravityDirVectMult;
auto angleMultArr = loader::query_float_attribute(groupIndex, 0, 701);
/*Full tilt hack - GraityMult should be 0.2*/ /*Full tilt hack - GraityMult should be 0.2*/
if (!pb::FullTiltMode && !pb::FullTiltDemoMode) if (angleMultArr && !pb::FullTiltMode)
{
auto angleMultArr = loader::query_float_attribute(groupIndex, 0, 701);
GraityMult = *angleMultArr; GraityMult = *angleMultArr;
}
else else
GraityMult = 0.2f; GraityMult = 0.2f;

View file

@ -95,7 +95,7 @@ int fullscrn::GetResolution()
void fullscrn::SetResolution(int value) void fullscrn::SetResolution(int value)
{ {
if (!pb::FullTiltMode || pb::FullTiltDemoMode) if (!pb::FullTiltMode)
value = 0; value = 0;
assertm(value >= 0 && value <= 2, "Resolution value out of bounds"); assertm(value >= 0 && value <= 2, "Resolution value out of bounds");
resolution = value; resolution = value;
@ -103,7 +103,7 @@ void fullscrn::SetResolution(int value)
int fullscrn::GetMaxResolution() int fullscrn::GetMaxResolution()
{ {
return pb::FullTiltMode && !pb::FullTiltDemoMode ? 2 : 0; return pb::FullTiltMode ? 2 : 0;
} }
void fullscrn::window_size_changed() void fullscrn::window_size_changed()

View file

@ -56,10 +56,6 @@ int midi::music_init()
track1 = load_track("TABA1"); track1 = load_track("TABA1");
track2 = load_track("TABA2"); track2 = load_track("TABA2");
track3 = load_track("TABA3"); track3 = load_track("TABA3");
// FT demo .006 has only one music track, but it is nearly 9 min. long
if (!track1 && pb::FullTiltDemoMode)
track1 = load_track("DEMO");
} }
else else
{ {
@ -275,7 +271,8 @@ std::vector<uint8_t>* midi::MdsToMidi(std::string file)
// Delta time is in variable quantity, Big Endian // Delta time is in variable quantity, Big Endian
uint32_t deltaVarLen; uint32_t deltaVarLen;
auto count = ToVariableLen(delta, deltaVarLen); auto count = ToVariableLen(delta, deltaVarLen);
auto deltaData = reinterpret_cast<const uint8_t*>(&deltaVarLen); deltaVarLen = SwapByteOrderInt(deltaVarLen);
auto deltaData = reinterpret_cast<const uint8_t*>(&deltaVarLen) + 4 - count;
midiBytes.insert(midiBytes.end(), deltaData, deltaData + count); midiBytes.insert(midiBytes.end(), deltaData, deltaData + count);
switch (event.iEvent >> 24) switch (event.iEvent >> 24)

View file

@ -86,11 +86,6 @@ DatFile* partman::load_records(LPCSTR lpFileName, bool fullTiltMode)
{ {
zMapResolution = LRead<uint8_t>(fileHandle); zMapResolution = LRead<uint8_t>(fileHandle);
fieldSize--; fieldSize--;
// -1 means universal resolution, maybe. FT demo .006 is the only known user.
if (zMapResolution == 0xff)
zMapResolution = 0;
assertm(zMapResolution <= 2, "partman: zMap resolution out of bounds"); assertm(zMapResolution <= 2, "partman: zMap resolution out of bounds");
} }

View file

@ -32,7 +32,7 @@ DatFile* pb::record_table = nullptr;
int pb::time_ticks = 0, pb::demo_mode = 0, pb::game_mode = 2; int pb::time_ticks = 0, pb::demo_mode = 0, pb::game_mode = 2;
float pb::mode_countdown_, pb::time_now = 0, pb::time_next = 0, pb::ball_speed_limit, pb::time_ticks_remainder = 0; float pb::mode_countdown_, pb::time_now = 0, pb::time_next = 0, pb::ball_speed_limit, pb::time_ticks_remainder = 0;
high_score_struct pb::highscore_table[5]; high_score_struct pb::highscore_table[5];
bool pb::FullTiltMode = false, pb::FullTiltDemoMode = false, pb::cheat_mode = false; bool pb::FullTiltMode = false, pb::cheat_mode = false;
std::string pb::DatFileName; std::string pb::DatFileName;
@ -121,16 +121,14 @@ int pb::uninit()
void pb::SelectDatFile(std::array<char*, 2> dataSearchPaths) void pb::SelectDatFile(std::array<char*, 2> dataSearchPaths)
{ {
DatFileName.clear(); DatFileName.clear();
FullTiltDemoMode = FullTiltMode = false;
std::string datFileNames[3] std::string datFileNames[2]
{ {
"CADET.DAT", "CADET.DAT",
options::get_string("Pinball Data", pinball::get_rc_string(168, 0)), options::get_string("Pinball Data", pinball::get_rc_string(168, 0))
"DEMO.DAT",
}; };
// Default game data test order: CADET.DAT, PINBALL.DAT, DEMO.DAT // Default game data test order: CADET.DAT, PINBALL.DAT
if (options::Options.Prefer3DPBGameData) if (options::Options.Prefer3DPBGameData)
std::swap(datFileNames[0], datFileNames[1]); std::swap(datFileNames[0], datFileNames[1]);
for (auto path : dataSearchPaths) for (auto path : dataSearchPaths)
@ -138,19 +136,16 @@ void pb::SelectDatFile(std::array<char*, 2> dataSearchPaths)
if (DatFileName.empty() && path) if (DatFileName.empty() && path)
{ {
pinball::BasePath = path; pinball::BasePath = path;
for (auto datFileName : datFileNames) for (int i = 0; i < 2; i++)
{ {
auto datFileName = datFileNames[i];
auto datFilePath = pinball::make_path_name(datFileName); auto datFilePath = pinball::make_path_name(datFileName);
auto datFile = fopenu(datFilePath.c_str(), "r"); auto datFile = fopenu(datFilePath.c_str(), "r");
if (datFile) if (datFile)
{ {
fclose(datFile); fclose(datFile);
DatFileName = datFileName; DatFileName = datFileName;
if (datFileName == "CADET.DAT") FullTiltMode = datFileName == "CADET.DAT";
FullTiltMode = true;
if (datFileName == "DEMO.DAT")
FullTiltDemoMode = FullTiltMode = true;
printf("Loading game from: %s\n", datFilePath.c_str()); printf("Loading game from: %s\n", datFilePath.c_str());
break; break;
} }

View file

@ -40,7 +40,7 @@ public:
static DatFile* record_table; static DatFile* record_table;
static TPinballTable* MainTable; static TPinballTable* MainTable;
static high_score_struct highscore_table[5]; static high_score_struct highscore_table[5];
static bool FullTiltMode, FullTiltDemoMode; static bool FullTiltMode;
static std::string DatFileName; static std::string DatFileName;
static int init(); static int init();