Remove stray #pragma once lines, update PGE emscripten build so it handles mouse scrolling proper. Add emscripten run script. Build 3146.

pull/28/head
sigonasr2 1 year ago
parent 3f9543d93b
commit cfd5586d63
  1. 1
      Crawler/CharacterInfoWindow.cpp
  2. 1
      Crawler/ClassSelectionWindow.cpp
  3. 6
      Crawler/Crawler.cpp
  4. 1
      Crawler/InventoryConsumableWindow.cpp
  5. 1
      Crawler/ItemLoadoutWindow.cpp
  6. 1
      Crawler/MainMenuWindow.cpp
  7. 10
      Crawler/Menu.h
  8. 1
      Crawler/OverworldMapLevelWindow.cpp
  9. 1
      Crawler/State_OverworldMap.cpp
  10. 2
      Crawler/Version.h
  11. 2
      Crawler/emscripten_run.ps1
  12. 6
      Crawler/olcPixelGameEngine.h
  13. BIN
      Crawler/pge.data
  14. 2
      Crawler/pge.js
  15. BIN
      Crawler/pge.wasm
  16. BIN
      x64/Release/Crawler.exe

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"
#include "Menu.h" #include "Menu.h"

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"
#include "Menu.h" #include "Menu.h"

@ -1110,7 +1110,7 @@ void Crawler::RenderWorld(float fElapsedTime){
if(dn->lifeTime<=1){ if(dn->lifeTime<=1){
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){ if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){
if(dn->invertedDirection){ if(dn->invertedDirection){
dn->pos.y+=20*fElapsedTime; dn->pos.y+=40*fElapsedTime;
}else{ }else{
dn->pos.y-=20*fElapsedTime; dn->pos.y-=20*fElapsedTime;
} }
@ -2129,7 +2129,9 @@ void Crawler::SetLoadoutItem(int slot,std::string itemName){
switch(slot){ switch(slot){
case 0:{ case 0:{
itemAbility.action=[&](Player*p,vf2d pos={}){ itemAbility.action=[&](Player*p,vf2d pos={}){
return game->UseLoadoutItem(0); bool itemUsed=game->UseLoadoutItem(0);
return itemUsed;
}; };
game->GetPlayer()->SetItem1UseFunc(itemAbility); game->GetPlayer()->SetItem1UseFunc(itemAbility);
}break; }break;

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "olcPixelGameEngine.h" #include "olcPixelGameEngine.h"
#include "safemap.h" #include "safemap.h"

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"
#include "Menu.h" #include "Menu.h"

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"
#include "Menu.h" #include "Menu.h"

@ -58,11 +58,6 @@ enum MenuType{
/////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////
}; };
template<typename T>
T*Component(MenuType menu,std::string componentName){
return (T*)Menu::menus[menu]->components[componentName];
}
class Menu:public IAttributable{ class Menu:public IAttributable{
friend class Crawler; friend class Crawler;
friend class Player; friend class Player;
@ -146,6 +141,11 @@ private:
static bool cover; //A black cover for when a menu pops up to fade out the stuff behind it. static bool cover; //A black cover for when a menu pops up to fade out the stuff behind it.
}; };
template<typename T>
T*Component(MenuType menu,std::string componentName){
return (T*)Menu::menus[menu]->components[componentName];
}
struct MenuFuncData{ struct MenuFuncData{
Menu&menu; Menu&menu;
Crawler*game; Crawler*game;

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"
#include "Menu.h" #include "Menu.h"

@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE. SUCH DAMAGE.
*/ */
#pragma endregion #pragma endregion
#pragma once
#include "State_OverworldMap.h" #include "State_OverworldMap.h"
#include "Crawler.h" #include "Crawler.h"
#include "DEFINES.h" #include "DEFINES.h"

@ -35,7 +35,7 @@ SUCH DAMAGE.
#define VERSION_MAJOR 0 #define VERSION_MAJOR 0
#define VERSION_MINOR 2 #define VERSION_MINOR 2
#define VERSION_PATCH 1 #define VERSION_PATCH 1
#define VERSION_BUILD 3137 #define VERSION_BUILD 3146
#define stringify(a) stringify_(a) #define stringify(a) stringify_(a)
#define stringify_(a) #a #define stringify_(a) #a

@ -0,0 +1,2 @@
~\Documents\emsdk\emsdk_env.ps1 activate latest
emrun play.html

@ -6607,13 +6607,13 @@ namespace olc
// Move // Move
if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE) if (eventType == EMSCRIPTEN_EVENT_TOUCHMOVE)
{ {
ptrPGE->olc_UpdateMouse(e->touches->targetX-ptrPGE->GetWindowPos().x, e->touches->targetY-ptrPGE->GetWindowPos().y); ptrPGE->olc_UpdateMouse(e->touches->targetX-ptrPGE->GetWindowPos().x-EM_ASM_INT({return window.scrollX}), e->touches->targetY-ptrPGE->GetWindowPos().y-EM_ASM_INT({return window.scrollY}));
} }
// Start // Start
if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART) if (eventType == EMSCRIPTEN_EVENT_TOUCHSTART)
{ {
ptrPGE->olc_UpdateMouse(e->touches->targetX-ptrPGE->GetWindowPos().x, e->touches->targetY-ptrPGE->GetWindowPos().y); ptrPGE->olc_UpdateMouse(e->touches->targetX-ptrPGE->GetWindowPos().x-EM_ASM_INT({return window.scrollX}), e->touches->targetY-ptrPGE->GetWindowPos().y-EM_ASM_INT({return window.scrollY}));
ptrPGE->olc_UpdateMouseState(0, true); ptrPGE->olc_UpdateMouseState(0, true);
} }
@ -6631,7 +6631,7 @@ namespace olc
{ {
//Mouse Movement //Mouse Movement
if (eventType == EMSCRIPTEN_EVENT_MOUSEMOVE) if (eventType == EMSCRIPTEN_EVENT_MOUSEMOVE)
ptrPGE->olc_UpdateMouse(e->targetX-ptrPGE->GetWindowPos().x, e->targetY-ptrPGE->GetWindowPos().y); ptrPGE->olc_UpdateMouse(e->targetX-ptrPGE->GetWindowPos().x-EM_ASM_INT({return window.scrollX}), e->targetY-ptrPGE->GetWindowPos().y-EM_ASM_INT({return window.scrollY}));
//Mouse button press //Mouse button press

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 MiB

After

Width:  |  Height:  |  Size: 8.4 MiB

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save