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

Poprawki post-merge. Nowy silnik liczb losowych.

Dodane zagubione pliki
This commit is contained in:
firleju
2017-01-25 16:25:25 +01:00
parent 28e85e8dc3
commit 4ad5ac1b51
9 changed files with 21 additions and 15 deletions

View File

@@ -184,6 +184,8 @@ bool Global::bDoubleAmbient = false; // podwójna jasność ambient
double Global::fTimeSpeed = 1.0; // przyspieszenie czasu, zmienna do testów
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
//randomizacja
std::mt19937 Global::random_engine = std::mt19937(std::time(NULL));
// maciek001: konfiguracja wstępna portu COM
bool Global::bMWDdebugEnable = false;
bool Global::bMWDInputDataEnable = false;

View File

@@ -303,6 +303,9 @@ class Global
static TTextSound *tsRadioBusy[10]; // zajętość kanałów radiowych (wskaźnik na odgrywany dźwięk)
static int iPoKeysPWM[7]; // numery wejść dla PWM
//randomizacja
static std::mt19937 random_engine;
// metody
static void TrainDelete(TDynamicObject *d);
static void ConfigParse(cParser &parser);

View File

@@ -37,9 +37,9 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<TargetName>eu07++</TargetName>
<TargetName>eu07++d</TargetName>
<IntDir>$(SolutionDir)tmp\$(PlatformShortName)-$(Configuration)\$(ProjectName)\</IntDir>
<OutDir>E:\Gry\MaSzyna_15_04</OutDir>
<OutDir>E:\Gry\MaSzyna_15_04\</OutDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<TargetName>eu07++</TargetName>

View File

@@ -13,6 +13,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
*/
#include "stdafx.h"
#include "mctools.h"
#include "Globals.h"
/*================================================*/
@@ -133,6 +134,12 @@ bool UnSetFlag(int &Flag, int Value)
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)
{
if ((Test > Threshold) && (!DebugModeFlag))
@@ -458,7 +465,7 @@ void ComputeArc(double X0, double Y0, double Xn, double Yn, double R, double L,
{
double dX;
double dY;
double Xc;
double Xc;
double Yc;
double gamma;
double alfa;

View File

@@ -68,16 +68,11 @@ inline long Round(float f)
//return lround(f);
}
inline int Random()
{
std::srand(std::time(NULL));
return std::rand();
}
extern double Random(double a, double b);
inline double Random(double a, double b)
inline double Random()
{
std::srand(std::time(NULL));
return a + std::rand() / (float)RAND_MAX * (b - a);
return Random(0.0,1.0);
}
inline double Random(double b)

View File

@@ -53,7 +53,7 @@ TPythonInterpreter::killInstance() {
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())
{
FILE *sourceFile = _getFile(lookupPath, className);

View File

@@ -34,7 +34,7 @@ class TPythonInterpreter
static TPythonInterpreter *_instance;
int _screenRendererPriority;
// std::set<const char *, ltstr> _classes;
std::set<std::string const> _classes;
std::set<std::string> _classes;
PyObject *_main;
PyObject *_stdErr;
// FILE *_getFile(const char *lookupPath, const char *className);

View File

@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">

BIN
opengl/glew32.lib Normal file

Binary file not shown.