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

Python: logowanie priorytetu wątku pythona

Smuga: wzmocnienie smugi zależne od oświetlenia amtosferycznego
This commit is contained in:
antonisauren
2016-06-10 22:15:09 +02:00
parent da2bf75464
commit c570578507
5 changed files with 28 additions and 32 deletions

View File

@@ -3,7 +3,7 @@
<PROJECT> <PROJECT>
<MACROS> <MACROS>
<VERSION value="BCB.05.03"/> <VERSION value="BCB.05.03"/>
<PROJECT value="E:\Gry\MaSzyna_15_04\EU07.exe"/> <PROJECT value="EU07.exe"/>
<OBJFILES value="QueryParserComp.obj McZapkie\mtable.obj McZapkie\_mover.obj <OBJFILES value="QueryParserComp.obj McZapkie\mtable.obj McZapkie\_mover.obj
McZapkie\hamulce.obj McZapkie\Oerlikon_ESt.obj EU07.obj dumb3d.obj McZapkie\hamulce.obj McZapkie\Oerlikon_ESt.obj EU07.obj dumb3d.obj
Camera.obj Texture.obj World.obj Model3d.obj MdlMngr.obj Train.obj Camera.obj Texture.obj World.obj Model3d.obj MdlMngr.obj Train.obj
@@ -60,7 +60,7 @@ AutoIncBuild=0
MajorVer=16 MajorVer=16
MinorVer=0 MinorVer=0
Release=1173 Release=1173
Build=475 Build=477
Debug=1 Debug=1
PreRelease=0 PreRelease=0
Special=0 Special=0
@@ -72,7 +72,7 @@ CodePage=1250
[Version Info Keys] [Version Info Keys]
CompanyName=EU07 Team CompanyName=EU07 Team
FileDescription=MaSzyna EU07-424 FileDescription=MaSzyna EU07-424
FileVersion=16.0.1173.475 FileVersion=16.0.1173.477
InternalName=DP+SPKS+asynch+python InternalName=DP+SPKS+asynch+python
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=
@@ -84,7 +84,7 @@ Comments=
[Excluded Packages] [Excluded Packages]
$(BCB)\Bin\bcbsmp50.bpl=Borland C++ Sample Components $(BCB)\Bin\bcbsmp50.bpl=Borland C++ Sample Components
$(BCB)\Bin\dclqrt50.bpl=QuickReport Components $(BCB)\Bin\dclqrt50.bpl=QuickReport Components
C:\Windows\system32\ibsmp50.bpl=Borland C++ InterBase Alerter Component C:\WINDOWS\system32\ibsmp50.bpl=Borland C++ InterBase Alerter Component
$(BCB)\Bin\dcltee50.bpl=TeeChart 5.0 Components $(BCB)\Bin\dcltee50.bpl=TeeChart 5.0 Components
$(BCB)\Bin\applet50.bpl=Borland Control Panel Applet Package $(BCB)\Bin\applet50.bpl=Borland Control Panel Applet Package
@@ -115,11 +115,12 @@ Item6=GLEW_STATIC;_DEBUG;USE_VERTEX_ARRAYS
Item7=_DEBUG Item7=_DEBUG
[HistoryLists\hlFinalOutputDir] [HistoryLists\hlFinalOutputDir]
Count=4 Count=5
Item0=E:\Gry\MaSzyna_15_04\ Item0=D:\Maszyna
Item1=E:\Gry\MaSzyna_15_04 Item1=E:\Gry\MaSzyna_15_04\
Item2=D:\EU07\ Item2=E:\Gry\MaSzyna_15_04
Item3=E:\EU07\ Item3=D:\EU07\
Item4=E:\EU07\
[Debugging] [Debugging]
DebugSourceDirs=McZapkie\ DebugSourceDirs=McZapkie\

BIN
EU07.res

Binary file not shown.

View File

@@ -49,9 +49,9 @@ double Global::fLuminance = 1.0; // jasno
int Global::iReCompile = 0; // zwiêkszany, gdy trzeba odœwie¿yæ siatki int Global::iReCompile = 0; // zwiêkszany, gdy trzeba odœwie¿yæ siatki
HWND Global::hWnd = NULL; // uchwyt okna HWND Global::hWnd = NULL; // uchwyt okna
int Global::iCameraLast = -1; int Global::iCameraLast = -1;
AnsiString Global::asRelease = "16.0.1172.476"; AnsiString Global::asRelease = "16.0.1172.477";
AnsiString Global::asVersion = AnsiString Global::asVersion =
"Compilation 2016-05-25, release " + Global::asRelease + "."; // tutaj, bo wysy³any "Compilation 2016-06-10, release " + Global::asRelease + "."; // tutaj, bo wysy³any
int Global::iViewMode = 0; // co aktualnie widaæ: 0-kabina, 1-latanie, 2-sprzêgi, 3-dokumenty int Global::iViewMode = 0; // co aktualnie widaæ: 0-kabina, 1-latanie, 2-sprzêgi, 3-dokumenty
int Global::iTextMode = 0; // tryb pracy wyœwietlacza tekstowego int Global::iTextMode = 0; // tryb pracy wyœwietlacza tekstowego
int Global::iScreenMode[12] = {0, 0, 0, 0, 0, 0, int Global::iScreenMode[12] = {0, 0, 0, 0, 0, 0,
@@ -514,10 +514,8 @@ void Global::ConfigParse(TQueryParserComp *qp, cParser *cp)
asLang = GetNextSymbol(); // domyœlny jêzyk - http://tools.ietf.org/html/bcp47 asLang = GetNextSymbol(); // domyœlny jêzyk - http://tools.ietf.org/html/bcp47
else if (str == AnsiString("opengl")) // deklarowana wersja OpenGL, ¿eby powstrzymaæ b³êdy else if (str == AnsiString("opengl")) // deklarowana wersja OpenGL, ¿eby powstrzymaæ b³êdy
fOpenGL = GetNextSymbol().ToDouble(); // wymuszenie wersji OpenGL fOpenGL = GetNextSymbol().ToDouble(); // wymuszenie wersji OpenGL
else if (str == AnsiString("pyscreenrendererpriority")) // priority of python screen else if (str == AnsiString("pyscreenrendererpriority")) // priority of python screen renderer
// renderer TPythonInterpreter::getInstance()->setScreenRendererPriority(GetNextSymbol().LowerCase().c_str());
TPythonInterpreter::getInstance()->setScreenRendererPriority(
GetNextSymbol().LowerCase().c_str());
else if (str == AnsiString("background")) else if (str == AnsiString("background"))
{ {
Background[0] = GetNextSymbol().ToDouble(); // r Background[0] = GetNextSymbol().ToDouble(); // r

View File

@@ -208,30 +208,30 @@ void TPythonInterpreter::setScreenRendererPriority(const char *priority)
if (strncmp(priority, "normal", 6) == 0) if (strncmp(priority, "normal", 6) == 0)
{ {
_screenRendererPriority = THREAD_PRIORITY_NORMAL; _screenRendererPriority = THREAD_PRIORITY_NORMAL;
#ifdef _PY_INT_MORE_LOG //#ifdef _PY_INT_MORE_LOG
WriteLog("Python screen renderer priority: Normal"); WriteLog("Python screen renderer priority: Normal");
#endif // _PY_INT_MORE_LOG //#endif // _PY_INT_MORE_LOG
} }
else if (strncmp(priority, "lower", 5) == 0) else if (strncmp(priority, "lower", 5) == 0)
{ {
_screenRendererPriority = THREAD_PRIORITY_BELOW_NORMAL; _screenRendererPriority = THREAD_PRIORITY_BELOW_NORMAL;
#ifdef _PY_INT_MORE_LOG //#ifdef _PY_INT_MORE_LOG
WriteLog("Python screen renderer priority: Lower"); WriteLog("Python screen renderer priority: Lower");
#endif // _PY_INT_MORE_LOG //#endif // _PY_INT_MORE_LOG
} }
else if (strncmp(priority, "lowest", 6) == 0) else if (strncmp(priority, "lowest", 6) == 0)
{ {
_screenRendererPriority = THREAD_PRIORITY_LOWEST; _screenRendererPriority = THREAD_PRIORITY_LOWEST;
#ifdef _PY_INT_MORE_LOG //#ifdef _PY_INT_MORE_LOG
WriteLog("Python screen renderer priority: Lowest"); WriteLog("Python screen renderer priority: Lowest");
#endif // _PY_INT_MORE_LOG //#endif // _PY_INT_MORE_LOG
} }
else if (strncmp(priority, "idle", 4) == 0) else if (strncmp(priority, "idle", 4) == 0)
{ {
_screenRendererPriority = THREAD_PRIORITY_IDLE; _screenRendererPriority = THREAD_PRIORITY_IDLE;
#ifdef _PY_INT_MORE_LOG //#ifdef _PY_INT_MORE_LOG
WriteLog("Python screen renderer priority: Idle"); WriteLog("Python screen renderer priority: Idle");
#endif // _PY_INT_MORE_LOG //#endif // _PY_INT_MORE_LOG
} }
} }

View File

@@ -1545,26 +1545,23 @@ bool TWorld::Update()
else else
{ {
glBlendFunc(GL_DST_COLOR, GL_ONE); glBlendFunc(GL_DST_COLOR, GL_ONE);
// glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE);
// glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_ONE);
// glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_DST_COLOR);
// glBlendFunc(GL_SRC_ALPHA_SATURATE,GL_ONE);
glDepthFunc(GL_GEQUAL); glDepthFunc(GL_GEQUAL);
glAlphaFunc(GL_GREATER, 0.004); glAlphaFunc(GL_GREATER, 0.004);
// glDisable(GL_DEPTH_TEST); // glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING); glDisable(GL_LIGHTING);
glDisable(GL_FOG); glDisable(GL_FOG);
glColor4f(0.15f, 0.15f, 0.15f, 0.25f); //glColor4f(0.15f, 0.15f, 0.15f, 0.25f);
glBindTexture(GL_TEXTURE_2D, light); // Select our texture glBindTexture(GL_TEXTURE_2D, light); // Select our texture
float ddl = (0.15*Global::diffuseDayLight[0]+0.295*Global::diffuseDayLight[1]+0.055*Global::diffuseDayLight[2]); //0.24:0
glBegin(GL_QUADS); glBegin(GL_QUADS);
float fSmudge = float fSmudge = Train->Dynamic()->MoverParameters->DimHalf.y + 7; // gdzie zaczynaæ smugê
Train->Dynamic()->MoverParameters->DimHalf.y + 7; // gdzie zaczynaæ smugê
if (Train->Controlled()->iLights[0] & 21) if (Train->Controlled()->iLights[0] & 21)
{ // wystarczy jeden zapalony z przodu { // wystarczy jeden zapalony z przodu
for (int i = 15; i <= 35; i++) for (int i = 15; i <= 35; i++)
{ {
float z = i * i * i * 0.01f;//25/4; float z = i * i * i * 0.01f;//25/4;
float C = (36 - i*0.5)*0.05*0.1; //float C = (36 - i*0.5)*0.005*(1.5 - sqrt(ddl));
float C = (36 - i*0.5)*0.005*sqrt((1/sqrt(ddl+0.015))-1);
glColor4f(C, C, C, 0.25f); glColor4f(C, C, C, 0.25f);
glTexCoord2f(0, 0); glVertex3f(-10 / 2 - 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3); glTexCoord2f(0, 0); glVertex3f(-10 / 2 - 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3);
glTexCoord2f(1, 0); glVertex3f(10 / 2 + 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3); glTexCoord2f(1, 0); glVertex3f(10 / 2 + 2 * i / 4, 6.0 + 0.3*z, 13 + 1.7*z / 3);
@@ -1577,7 +1574,7 @@ bool TWorld::Update()
for (int i = 15; i <= 35; i++) for (int i = 15; i <= 35; i++)
{ {
float z = i * i * i * 0.01f;//25/4; float z = i * i * i * 0.01f;//25/4;
float C = (36 - i*0.5)*0.05*0.1; float C = (36 - i*0.5)*0.005*sqrt((1/sqrt(ddl+0.015))-1);
glColor4f(C, C, C, 0.25f); glColor4f(C, C, C, 0.25f);
glTexCoord2f(0, 0); glVertex3f(10 / 2 + 2 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3); glTexCoord2f(0, 0); glVertex3f(10 / 2 + 2 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3);
glTexCoord2f(1, 0); glVertex3f(-10 / 2 - 2 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3); glTexCoord2f(1, 0); glVertex3f(-10 / 2 - 2 * i / 4, 6.0 + 0.3*z, -13 - 1.7*z / 3);