16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

removed dependencies on the old parser. The code can now be compiled outside of Borland C++

This commit is contained in:
tmj-fstate
2017-01-15 15:04:17 +01:00
parent 7df7c8b76e
commit 15cf3d73a8
87 changed files with 3395 additions and 3232 deletions

View File

@@ -7,17 +7,12 @@ obtain one at
http://mozilla.org/MPL/2.0/.
*/
#include "system.hpp"
#include "classes.hpp"
#pragma hdrstop
#include "stdafx.h"
#include "Button.h"
#include "Console.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
TButton::TButton()
{
iFeedbackBit = 0;
@@ -37,25 +32,25 @@ void TButton::Clear(int i)
Update(); // kasowanie bitu Feedback, o ile jakiœ ustawiony
};
void TButton::Init(AnsiString asName, TModel3d *pModel, bool bNewOn)
void TButton::Init(std::string const &asName, TModel3d *pModel, bool bNewOn)
{
if (!pModel)
return; // nie ma w czym szukaæ
pModelOn = pModel->GetFromName(AnsiString(asName + "_on").c_str());
pModelOff = pModel->GetFromName(AnsiString(asName + "_off").c_str());
pModelOn = pModel->GetFromName( (asName + "_on").c_str() );
pModelOff = pModel->GetFromName( (asName + "_off").c_str() );
bOn = bNewOn;
Update();
};
void TButton::Load(TQueryParserComp *Parser, TModel3d *pModel1, TModel3d *pModel2)
void TButton::Load(cParser &Parser, TModel3d *pModel1, TModel3d *pModel2)
{
AnsiString str = Parser->GetNextSymbol().LowerCase();
std::string const token = Parser.getToken<std::string>();
if (pModel1)
{ // poszukiwanie submodeli w modelu
Init(str, pModel1, false);
Init(token, pModel1, false);
if (pModel2)
if (!pModelOn && !pModelOff)
Init(str, pModel2, false); // mo¿e w drugim bêdzie (jak nie w kabinie,
Init(token, pModel2, false); // mo¿e w drugim bêdzie (jak nie w kabinie,
// to w zewnêtrznym)
}
else