Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Big CMake + MinGW + Sound PR #127

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix macOS Build (Again)
  • Loading branch information
TheBrokenRail committed Jun 18, 2024
commit fade654710df8f65807c1ad4308d3ad00871cacf
5 changes: 1 addition & 4 deletions platforms/android/AppPlatform_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,5 @@ AssetFile AppPlatform_android::readAssetFile(const std::string& str) const
unsigned char* buffer = new unsigned char[cnt];
AAsset_read(asset, (void*)buffer, cnt);
AAsset_close(asset);
return {
.size = ssize_t(cnt),
.data = buffer
};
return AssetFile(ssize_t(cnt), buffer);
}
5 changes: 1 addition & 4 deletions platforms/sdl/base/AppPlatform_sdl_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,5 @@ AssetFile AppPlatform_sdl_base::readAssetFile(const std::string& str) const
// Close File
SDL_RWclose(io);
// Return
return {
.size = size,
.data = buf
};
return AssetFile(size, buf);
}
5 changes: 1 addition & 4 deletions platforms/windows/AppPlatform_win32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,7 @@ AssetFile AppPlatform_win32::readAssetFile(const std::string& str) const
unsigned char* buffer = new unsigned char[size];
ifs.read((char*) buffer, size);

return {
.size = size,
.data = buffer
};
return AssetFile(size, buffer);
}

void AppPlatform_win32::setScreenSize(int width, int height)
Expand Down
7 changes: 5 additions & 2 deletions source/client/app/AppPlatform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
#include "client/sound/SoundSystem.hpp"

struct AssetFile {
ssize_t size = -1;
unsigned char *data = nullptr;
ssize_t size;
unsigned char *data;

AssetFile(): size(-1), data(nullptr) {}
AssetFile(ssize_t size, unsigned char *data): size(size), data(data) {}
};

class AppPlatform
Expand Down