mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 17:29:18 +02:00
Poprawki post-merge. Nowy silnik liczb losowych.
Dodane zagubione pliki
This commit is contained in:
@@ -184,6 +184,8 @@ bool Global::bDoubleAmbient = false; // podwójna jasność ambient
|
|||||||
double Global::fTimeSpeed = 1.0; // przyspieszenie czasu, zmienna do testów
|
double Global::fTimeSpeed = 1.0; // przyspieszenie czasu, zmienna do testów
|
||||||
bool Global::bHideConsole = false; // hunter-271211: ukrywanie konsoli
|
bool Global::bHideConsole = false; // hunter-271211: ukrywanie konsoli
|
||||||
int Global::iBpp = 32; // chyba już nie używa się kart, na których 16bpp coś poprawi
|
int Global::iBpp = 32; // chyba już nie używa się kart, na których 16bpp coś poprawi
|
||||||
|
//randomizacja
|
||||||
|
std::mt19937 Global::random_engine = std::mt19937(std::time(NULL));
|
||||||
// maciek001: konfiguracja wstępna portu COM
|
// maciek001: konfiguracja wstępna portu COM
|
||||||
bool Global::bMWDdebugEnable = false;
|
bool Global::bMWDdebugEnable = false;
|
||||||
bool Global::bMWDInputDataEnable = false;
|
bool Global::bMWDInputDataEnable = false;
|
||||||
|
|||||||
@@ -303,6 +303,9 @@ class Global
|
|||||||
static TTextSound *tsRadioBusy[10]; // zajętość kanałów radiowych (wskaźnik na odgrywany dźwięk)
|
static TTextSound *tsRadioBusy[10]; // zajętość kanałów radiowych (wskaźnik na odgrywany dźwięk)
|
||||||
static int iPoKeysPWM[7]; // numery wejść dla PWM
|
static int iPoKeysPWM[7]; // numery wejść dla PWM
|
||||||
|
|
||||||
|
//randomizacja
|
||||||
|
static std::mt19937 random_engine;
|
||||||
|
|
||||||
// metody
|
// metody
|
||||||
static void TrainDelete(TDynamicObject *d);
|
static void TrainDelete(TDynamicObject *d);
|
||||||
static void ConfigParse(cParser &parser);
|
static void ConfigParse(cParser &parser);
|
||||||
|
|||||||
@@ -37,9 +37,9 @@
|
|||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<TargetName>eu07++</TargetName>
|
<TargetName>eu07++d</TargetName>
|
||||||
<IntDir>$(SolutionDir)tmp\$(PlatformShortName)-$(Configuration)\$(ProjectName)\</IntDir>
|
<IntDir>$(SolutionDir)tmp\$(PlatformShortName)-$(Configuration)\$(ProjectName)\</IntDir>
|
||||||
<OutDir>E:\Gry\MaSzyna_15_04</OutDir>
|
<OutDir>E:\Gry\MaSzyna_15_04\</OutDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<TargetName>eu07++</TargetName>
|
<TargetName>eu07++</TargetName>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
|||||||
*/
|
*/
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "mctools.h"
|
#include "mctools.h"
|
||||||
|
#include "Globals.h"
|
||||||
|
|
||||||
/*================================================*/
|
/*================================================*/
|
||||||
|
|
||||||
@@ -133,6 +134,12 @@ bool UnSetFlag(int &Flag, int Value)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline double Random(double a, double b)
|
||||||
|
{
|
||||||
|
std::uniform_real_distribution<> dis(a, b);
|
||||||
|
return dis(Global::random_engine);
|
||||||
|
}
|
||||||
|
|
||||||
bool FuzzyLogic(double Test, double Threshold, double Probability)
|
bool FuzzyLogic(double Test, double Threshold, double Probability)
|
||||||
{
|
{
|
||||||
if ((Test > Threshold) && (!DebugModeFlag))
|
if ((Test > Threshold) && (!DebugModeFlag))
|
||||||
|
|||||||
@@ -68,16 +68,11 @@ inline long Round(float f)
|
|||||||
//return lround(f);
|
//return lround(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int Random()
|
extern double Random(double a, double b);
|
||||||
{
|
|
||||||
std::srand(std::time(NULL));
|
|
||||||
return std::rand();
|
|
||||||
}
|
|
||||||
|
|
||||||
inline double Random(double a, double b)
|
inline double Random()
|
||||||
{
|
{
|
||||||
std::srand(std::time(NULL));
|
return Random(0.0,1.0);
|
||||||
return a + std::rand() / (float)RAND_MAX * (b - a);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double Random(double b)
|
inline double Random(double b)
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ TPythonInterpreter::killInstance() {
|
|||||||
|
|
||||||
bool TPythonInterpreter::loadClassFile( std::string const &lookupPath, std::string const &className )
|
bool TPythonInterpreter::loadClassFile( std::string const &lookupPath, std::string const &className )
|
||||||
{
|
{
|
||||||
std::set<std::string const>::const_iterator it = _classes.find(className);
|
std::set<std::string>::const_iterator it = _classes.find(className);
|
||||||
if (it == _classes.end())
|
if (it == _classes.end())
|
||||||
{
|
{
|
||||||
FILE *sourceFile = _getFile(lookupPath, className);
|
FILE *sourceFile = _getFile(lookupPath, className);
|
||||||
|
|||||||
2
PyInt.h
2
PyInt.h
@@ -34,7 +34,7 @@ class TPythonInterpreter
|
|||||||
static TPythonInterpreter *_instance;
|
static TPythonInterpreter *_instance;
|
||||||
int _screenRendererPriority;
|
int _screenRendererPriority;
|
||||||
// std::set<const char *, ltstr> _classes;
|
// std::set<const char *, ltstr> _classes;
|
||||||
std::set<std::string const> _classes;
|
std::set<std::string> _classes;
|
||||||
PyObject *_main;
|
PyObject *_main;
|
||||||
PyObject *_stdErr;
|
PyObject *_stdErr;
|
||||||
// FILE *_getFile(const char *lookupPath, const char *className);
|
// FILE *_getFile(const char *lookupPath, const char *className);
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LocalDebuggerCommand>E:\Gry\MaSzyna_15_04\eu07++.exe</LocalDebuggerCommand>
|
<LocalDebuggerWorkingDirectory>E:\Gry\MaSzyna_15_04\</LocalDebuggerWorkingDirectory>
|
||||||
<LocalDebuggerWorkingDirectory>E:\Gry\MaSzyna_15_04</LocalDebuggerWorkingDirectory>
|
|
||||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
|||||||
BIN
opengl/glew32.lib
Normal file
BIN
opengl/glew32.lib
Normal file
Binary file not shown.
Reference in New Issue
Block a user