Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Is-Daouda committed Feb 22, 2022
1 parent be59b6b commit 567208e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ mkdir bin-web
cd bin-web
emsdk activate latest
emcmake cmake ..
make
make -j3
python -m http.server
```
7. Visit this url **localhost:8000** in your **Web Browser**.
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/cpp/SDL_android_main.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if !defined(IS_ENGINE_VS_CODE)
/*
SDL_android_main.c, placed in the public domain by Sam Lantinga 3/13/14
*/
Expand Down Expand Up @@ -81,3 +82,4 @@ JNIEXPORT int JNICALL Java_com_author_isengine_SDLActivity_nativeInit(JNIEnv* en
#endif /* __ANDROID__ */

/* vi: set ts=4 sw=4 expandtab: */
#endif /* IS_ENGINE_VS_CODE */
4 changes: 4 additions & 0 deletions app/src/main/cpp/isEngine/system/function/GameFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ float degToRad(float x)

float lengthDirX(float dir, float angle, bool useScreenScale)
{
#if defined(IS_ENGINE_SDL_2)
if (useScreenScale)
{
if (static_cast<int>(is::IS_ENGINE_SDL_screenXScale) != 1)
Expand All @@ -132,11 +133,13 @@ float lengthDirX(float dir, float angle, bool useScreenScale)
}
return (dir * std::cos(degToRad(angle))) / is::IS_ENGINE_SDL_screenXScale;
}
#endif
return dir * std::cos(degToRad(angle));
}

float lengthDirY(float dir, float angle, bool useScreenScale)
{
#if defined(IS_ENGINE_SDL_2)
if (useScreenScale)
{
if (static_cast<int>(is::IS_ENGINE_SDL_screenXScale) != 1)
Expand All @@ -146,6 +149,7 @@ float lengthDirY(float dir, float angle, bool useScreenScale)
return (dir * std::sin(degToRad(angle))) / is::IS_ENGINE_SDL_screenYScale;
}
}
#endif
return dir * std::sin(degToRad(angle));
}

Expand Down
11 changes: 0 additions & 11 deletions app/src/main/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@
#if defined(IS_ENGINE_VS_CODE)
#include "Main.hpp"
#endif
#if defined(IS_ENGINE_HTML_5)
#include <emscripten.h>
#include <emscripten/bind.h>

inline std::vector<std::string> *vectorFromIntPointer(uintptr_t vec) {
return reinterpret_cast<std::vector<std::string> *>(vec);
}
EMSCRIPTEN_BINDINGS(Wrappers) {
emscripten::register_vector<std::string>("VectorString").constructor(&vectorFromIntPointer, emscripten::allow_raw_pointers());
};
#endif
#include "isEngine/core/GameEngine.h"

////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 567208e

Please sign in to comment.