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

This commit is contained in:
2023-11-27 00:01:19 -06:00
parent 3f9543d93b
commit cfd5586d63
16 changed files with 16 additions and 19 deletions
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
+4 -2
View File
@@ -1110,7 +1110,7 @@ void Crawler::RenderWorld(float fElapsedTime){
if(dn->lifeTime<=1){
if(dn->lifeTime<DamageNumber::MOVE_UP_TIME){
if(dn->invertedDirection){
dn->pos.y+=20*fElapsedTime;
dn->pos.y+=40*fElapsedTime;
}else{
dn->pos.y-=20*fElapsedTime;
}
@@ -2129,7 +2129,9 @@ void Crawler::SetLoadoutItem(int slot,std::string itemName){
switch(slot){
case 0:{
itemAbility.action=[&](Player*p,vf2d pos={}){
return game->UseLoadoutItem(0);
bool itemUsed=game->UseLoadoutItem(0);
return itemUsed;
};
game->GetPlayer()->SetItem1UseFunc(itemAbility);
}break;
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "olcPixelGameEngine.h"
#include "safemap.h"
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
+5 -5
View File
@@ -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{
friend class Crawler;
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.
};
template<typename T>
T*Component(MenuType menu,std::string componentName){
return (T*)Menu::menus[menu]->components[componentName];
}
struct MenuFuncData{
Menu&menu;
Crawler*game;
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"
-1
View File
@@ -31,7 +31,6 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
*/
#pragma endregion
#pragma once
#include "State_OverworldMap.h"
#include "Crawler.h"
#include "DEFINES.h"
+1 -1
View File
@@ -35,7 +35,7 @@ SUCH DAMAGE.
#define VERSION_MAJOR 0
#define VERSION_MINOR 2
#define VERSION_PATCH 1
#define VERSION_BUILD 3137
#define VERSION_BUILD 3146
#define stringify(a) stringify_(a)
#define stringify_(a) #a
+2
View File
@@ -0,0 +1,2 @@
~\Documents\emsdk\emsdk_env.ps1 activate latest
emrun play.html
+3 -3
View File
@@ -6607,13 +6607,13 @@ namespace olc
// Move
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
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);
}
@@ -6631,7 +6631,7 @@ namespace olc
{
//Mouse Movement
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
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 MiB

After

Width:  |  Height:  |  Size: 8.4 MiB

+1 -1
View File
File diff suppressed because one or more lines are too long
BIN
View File
Binary file not shown.
Binary file not shown.