aboutsummaryrefslogtreecommitdiff
path: root/src/libjin
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-27 08:31:00 +0800
committerchai <chaifix@163.com>2018-10-27 08:31:00 +0800
commit73c42ddcc4eeb6ac3f0282d2c08ae8e632f3355f (patch)
treeeeddce1725b9d6f81693d2ae99f665226d7a9d24 /src/libjin
parente21485a60da2b304a0d529d72e9a47061a3f9502 (diff)
*修改boot.lua
Diffstat (limited to 'src/libjin')
-rw-r--r--src/libjin/Audio/SDL/je_sdl_audio.cpp1
-rw-r--r--src/libjin/Core/je_configuration.h2
-rw-r--r--src/libjin/Graphics/Font/je_texture_font.h2
-rw-r--r--src/libjin/Graphics/je_window.cpp2
-rw-r--r--src/libjin/ai/je_state_machine.h81
5 files changed, 46 insertions, 42 deletions
diff --git a/src/libjin/Audio/SDL/je_sdl_audio.cpp b/src/libjin/Audio/SDL/je_sdl_audio.cpp
index 96df17f..4ce02f7 100644
--- a/src/libjin/Audio/SDL/je_sdl_audio.cpp
+++ b/src/libjin/Audio/SDL/je_sdl_audio.cpp
@@ -37,6 +37,7 @@ namespace JinEngine
if (SDL_Init(SDL_INIT_AUDIO) < 0)
return false;
+
SDL_AudioSpec spec;
Setting* setting = (Setting*)s;
if (setting == nullptr)
diff --git a/src/libjin/Core/je_configuration.h b/src/libjin/Core/je_configuration.h
index 065fbae..d96d5b9 100644
--- a/src/libjin/Core/je_configuration.h
+++ b/src/libjin/Core/je_configuration.h
@@ -6,7 +6,7 @@
///
/// Debug output
///
-#define jin_debug
+//#define jin_debug
#define jin_os_windows 0x01
#define jin_os_mac 0x02
diff --git a/src/libjin/Graphics/Font/je_texture_font.h b/src/libjin/Graphics/Font/je_texture_font.h
index d61991a..fb74eca 100644
--- a/src/libjin/Graphics/Font/je_texture_font.h
+++ b/src/libjin/Graphics/Font/je_texture_font.h
@@ -39,7 +39,7 @@ namespace JinEngine
///
///
static TextureFont* createTextureFont(const Bitmap* bitmap, const Content& codepoints, Color mask, int cellh);
-
+
///
///
///
diff --git a/src/libjin/Graphics/je_window.cpp b/src/libjin/Graphics/je_window.cpp
index f0b789e..b36a2a3 100644
--- a/src/libjin/Graphics/je_window.cpp
+++ b/src/libjin/Graphics/je_window.cpp
@@ -76,8 +76,6 @@ namespace JinEngine
gl.enable(GL_BLEND);
gl.enable(GL_TEXTURE_2D);
gl.setBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- // avoid white screen blink on windows
- swapBuffers();
// bind to default canvas
Canvas::unbind();
Shader::unuse();
diff --git a/src/libjin/ai/je_state_machine.h b/src/libjin/ai/je_state_machine.h
index 71bf7ba..7b199ac 100644
--- a/src/libjin/ai/je_state_machine.h
+++ b/src/libjin/ai/je_state_machine.h
@@ -23,31 +23,6 @@ namespace JinEngine
{
public:
- union ParameterValue
- {
- int _int;
- float _float;
- bool _bool;
- byte _trigger;
- };
-
- enum ParameterType
- {
- Int, ///< A integer value.
- FLoat, ///< A float value.
- Bool, ///< A bool value.
- Trigger ///< A trigger will be reset to false after activated.
- };
-
- ///
- /// Traslation's condition.
- ///
- struct Condition
- {
- std::string parameter;
- ParameterValue value;
- };
-
///
///
///
@@ -81,17 +56,27 @@ namespace JinEngine
///
///
///
- void addParameter(ParameterType type, const std::string& name);
+ void addParameteri(const std::string& name);
- ///
- /// Add a state.
- ///
- void addState(const std::string& name);
+ ///
+ ///
+ ///
+ void addParameterf(const std::string& name);
///
///
///
- void addTransition(const std::string& stateFrom, const std::string& stateTo, const std::string& name, const ParameterValue& value);
+ void addParameterb(const std::string& name);
+
+ ///
+ ///
+ ///
+ void addParametert(const std::string& name);
+
+ ///
+ /// Add a state.
+ ///
+ void addState(const std::string& name);
///
///
@@ -116,11 +101,6 @@ namespace JinEngine
///
/// Set parameter value.
///
- void setParameter(const std::string& name, const ParameterValue& value);
-
- ///
- /// Set parameter value.
- ///
void setParameteri(const std::string& name, int value);
///
@@ -151,7 +131,7 @@ namespace JinEngine
///
/// Reset state machine.
///
- void resetState();
+ void reset();
///
///
@@ -170,19 +150,44 @@ namespace JinEngine
private:
+ enum ParameterType
+ {
+ Int, ///< A integer value.
+ FLoat, ///< A float value.
+ Bool, ///< A bool value.
+ Trigger ///< A trigger will be reset to false after activated.
+ };
+
+ union ParameterValue
+ {
+ int _int;
+ float _float;
+ bool _bool;
+ byte _trigger;
+ };
+
struct Parameter
{
ParameterType type;
ParameterValue value;
};
+ ///
+ /// Traslation's condition.
+ ///
+ struct Condition
+ {
+ std::string parameter;
+ ParameterValue value;
+ };
+
///
/// Translate to another state.
///
struct Transition
{
Condition condition; ///< Condition to active transition.
- std::string& state; ///<
+ std::string state; ///<
};
///