ADD: WebASM port (no sound/no network)

This commit is contained in:
Kolyah35
2026-03-19 02:26:34 +03:00
parent 4769d4ae72
commit e9914e3fbd
13 changed files with 408 additions and 119 deletions

View File

@@ -31,7 +31,7 @@ public:
{
}
BinaryBlob readAssetFile(const std::string& filename) {
BinaryBlob readAssetFile(const std::string& filename) override {
FILE* fp = fopen(("data/" + filename).c_str(), "r");
if (!fp)
return BinaryBlob();
@@ -48,7 +48,7 @@ public:
return blob;
}
void saveScreenshot(const std::string& filename, int glWidth, int glHeight) {
void saveScreenshot(const std::string& filename, int glWidth, int glHeight) override {
//@todo
}
@@ -56,7 +56,7 @@ public:
return (p & 0xff00ff00) | ((p >> 16) & 0xff) | ((p << 16) & 0xff0000);
}
TextureData loadTexture(const std::string& filename_, bool textureFolder)
TextureData loadTexture(const std::string& filename_, bool textureFolder) override
{
// Support fetching PNG textures via HTTP/HTTPS (for skins, etc)
if (Util::startsWith(filename_, "http://") || Util::startsWith(filename_, "https://")) {
@@ -132,10 +132,10 @@ public:
return std::string(mbstr);
}
virtual int getScreenWidth() { return 854; };
virtual int getScreenHeight() { return 480; };
virtual int getScreenWidth() override { return 854; };
virtual int getScreenHeight() override { return 480; };
virtual float getPixelsPerMillimeter();
virtual float getPixelsPerMillimeter() override;
virtual bool supportsTouchscreen() override { return true; }
@@ -148,6 +148,8 @@ public:
#endif
}
GLFWwindow* window;
private:
};
#endif /*APPPLATFORM_GLFW_H__*/