Fixing sprites
This commit is contained in:
parent
ef0392fb63
commit
b4e5d2a104
@ -93,7 +93,7 @@
|
|||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<AdditionalIncludeDirectories>../../libs/boost-gil-extension;../../tes-engine;../../eigen;../../boost_1_67_0/;../../libs/jpeg-9;../../libs/jpeg-9/vc10;../../libs/lpng1510;..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include;..\opensteer\include;..\replaceLoki</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../../libs/boost-gil-extension;../../tes-engine;../../eigen;../../boost_1_67_0/;../../libs/jpeg-9;../../libs/jpeg-9/vc10;../../libs/lpng1510;..\;..\math;..\coldet\;..\util;..\..\SDL2-2.0.8\include;..\..\physfs-3.0.1\build\install\include;..\opensteer\include;..\replaceLoki</AdditionalIncludeDirectories>
|
||||||
<PreprocessorDefinitions>WIN32;_WINDOWS;TARGET_WIN32;_WIN32_WINNT=0x0501;WIN32_LEAN_AND_MEAN;EIGEN_DONT_ALIGN_STATICALLY;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>DO_SCALE2X;WIN32;_WINDOWS;TARGET_WIN32;_WIN32_WINNT=0x0501;WIN32_LEAN_AND_MEAN;EIGEN_DONT_ALIGN_STATICALLY;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_MBCS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<CompileAsWinRT>false</CompileAsWinRT>
|
<CompileAsWinRT>false</CompileAsWinRT>
|
||||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -166,7 +166,8 @@ namespace OpenGTA {
|
|||||||
speedForces(other.speedForces),
|
speedForces(other.speedForces),
|
||||||
inventory(other.inventory),
|
inventory(other.inventory),
|
||||||
activeWeapon(other.activeWeapon),
|
activeWeapon(other.activeWeapon),
|
||||||
activeAmmo(&inventory.find(activeWeapon)->second),
|
//activeAmmo(&inventory.find(activeWeapon)->second),
|
||||||
|
activeAmmo(other.activeAmmo),
|
||||||
aiData(other.aiData) {
|
aiData(other.aiData) {
|
||||||
lastUpdateAt = other.lastUpdateAt;
|
lastUpdateAt = other.lastUpdateAt;
|
||||||
inGroundContact = other.inGroundContact;
|
inGroundContact = other.inGroundContact;
|
||||||
@ -183,12 +184,17 @@ namespace OpenGTA {
|
|||||||
lastUpdateAt = ticks;
|
lastUpdateAt = ticks;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (pedId < 0xffffffff)
|
if (pedId < 0xffffffff)
|
||||||
ai_step_fake(this);
|
ai_step_fake(this);
|
||||||
//AI::Pedestrian::walk_pavement(this);
|
//AI::Pedestrian::walk_pavement(this);
|
||||||
if (aiMode) {
|
|
||||||
|
|
||||||
|
//Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
|
||||||
|
/*if (aiMode) {
|
||||||
AI::Pedestrian::moveto_shortrange(this);
|
AI::Pedestrian::moveto_shortrange(this);
|
||||||
}
|
}*/
|
||||||
uint8_t chooseWeapon = m_control.getActiveWeapon();
|
uint8_t chooseWeapon = m_control.getActiveWeapon();
|
||||||
if (chooseWeapon != activeWeapon) {
|
if (chooseWeapon != activeWeapon) {
|
||||||
if (chooseWeapon == 0) {
|
if (chooseWeapon == 0) {
|
||||||
|
9
math/weighted_set.cpp
Normal file → Executable file
9
math/weighted_set.cpp
Normal file → Executable file
@ -1,9 +1,12 @@
|
|||||||
#include "weighted_set.h"
|
#include "weighted_set.h"
|
||||||
|
#include <cassert>
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
namespace Math {
|
namespace Math {
|
||||||
WeightedSet::WeightedSet(unsigned int seed) :
|
WeightedSet::WeightedSet(unsigned int seed) :
|
||||||
elements(),
|
elements()
|
||||||
rng(seed) {
|
{
|
||||||
|
std::srand(unsigned(std::time(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WeightedSet::add(unsigned int w, unsigned int e) {
|
void WeightedSet::add(unsigned int w, unsigned int e) {
|
||||||
@ -15,7 +18,7 @@ namespace Math {
|
|||||||
|
|
||||||
unsigned int WeightedSet::getRandom() {
|
unsigned int WeightedSet::getRandom() {
|
||||||
//unsigned int rnd = (int) (totalWeight * (rand() / (RAND_MAX + 1.0)));
|
//unsigned int rnd = (int) (totalWeight * (rand() / (RAND_MAX + 1.0)));
|
||||||
unsigned int rnd = rng.nextUint(elements.size());
|
unsigned int rnd = std::rand() % (elements.size());
|
||||||
return elements[rnd];
|
return elements[rnd];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2
math/weighted_set.h
Normal file → Executable file
2
math/weighted_set.h
Normal file → Executable file
@ -2,7 +2,6 @@
|
|||||||
#define WEIGHTED_SET_H
|
#define WEIGHTED_SET_H
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "yasli/random.h"
|
|
||||||
|
|
||||||
namespace Math {
|
namespace Math {
|
||||||
|
|
||||||
@ -13,7 +12,6 @@ namespace Math {
|
|||||||
unsigned int getRandom();
|
unsigned int getRandom();
|
||||||
private:
|
private:
|
||||||
std::vector<unsigned int> elements;
|
std::vector<unsigned int> elements;
|
||||||
Random rng;
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -815,11 +815,11 @@ void handleKeyPress( SDL_Keysym *keysym ) {
|
|||||||
|
|
||||||
|
|
||||||
//Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
|
//Xperimental -- Vladislav Khorev vladislav.khorev@fishrungames.com
|
||||||
/*
|
|
||||||
case SDLK_F4:
|
case SDLK_F4:
|
||||||
follow_toggle = (follow_toggle ? 0 : 1);
|
follow_toggle = (follow_toggle ? 0 : 1);
|
||||||
if (follow_toggle) {
|
if (follow_toggle) {
|
||||||
SDL_EnableKeyRepeat( 0, SDL_DEFAULT_REPEAT_INTERVAL );
|
//SDL_EnableKeyRepeat( 0, SDL_DEFAULT_REPEAT_INTERVAL );
|
||||||
city->setViewMode(false);
|
city->setViewMode(false);
|
||||||
Vector3D p(cam.getEye());
|
Vector3D p(cam.getEye());
|
||||||
create_ped_at(p);
|
create_ped_at(p);
|
||||||
@ -828,7 +828,7 @@ void handleKeyPress( SDL_Keysym *keysym ) {
|
|||||||
cam.setCamGravity(true);
|
cam.setCamGravity(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SDL_EnableKeyRepeat( 100, SDL_DEFAULT_REPEAT_INTERVAL );
|
//SDL_EnableKeyRepeat( 100, SDL_DEFAULT_REPEAT_INTERVAL );
|
||||||
cam.setVectors(cam.getEye(),
|
cam.setVectors(cam.getEye(),
|
||||||
Vector3D(cam.getEye() + Vector3D(1, -1, 1)), Vector3D(0, 1, 0));
|
Vector3D(cam.getEye() + Vector3D(1, -1, 1)), Vector3D(0, 1, 0));
|
||||||
cam.setCamGravity(false);
|
cam.setCamGravity(false);
|
||||||
@ -837,7 +837,7 @@ void handleKeyPress( SDL_Keysym *keysym ) {
|
|||||||
OpenGTA::SpriteManagerHolder::Instance().removeDeadStuff();
|
OpenGTA::SpriteManagerHolder::Instance().removeDeadStuff();
|
||||||
GUI::remove_ingame_gui();
|
GUI::remove_ingame_gui();
|
||||||
}
|
}
|
||||||
break;*/
|
break;
|
||||||
case SDLK_RETURN:
|
case SDLK_RETURN:
|
||||||
car_toggle();
|
car_toggle();
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user