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

fix build #197

Merged
merged 1 commit into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions Editors/BackgroundEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ void BackgroundEditor::on_actionLoadImage_triggered() {

if (dialog->exec() && dialog->selectedFiles().size() > 0) {
QString fName = dialog->selectedFiles()[0];
if (fName.endsWith("Background.gmx")) {
Background* bkg = gmx::LoadBackground(fName.toStdString());
if (bkg != nullptr) {
if (fName.endsWith("Background.gmx") || fName.endsWith(".bkg")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these checks case-insensitive? The capital B suggests not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these checks need work but jus tryna fix build here

std::optional<Background> bkg = egm::LoadResource<Background>(fName.toStdString());
if (bkg.has_value()) {
// QString lastData = GetModelData(Background::kImageFieldNumber).toString();
ReplaceBuffer(bkg);
ReplaceBuffer(&bkg.value());
// QString newData = GetModelData(Background::kImageFieldNumber).toString();
// TODO: Copy data into our egm and reset the path
// SetModelData(Background::kImageFieldNumber, lastData);
Expand Down
8 changes: 4 additions & 4 deletions Editors/SoundEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ void SoundEditor::on_loadButton_clicked() {

if (dialog->exec() && dialog->selectedFiles().size() > 0) {
QString fName = dialog->selectedFiles()[0];
if (fName.endsWith("Sound.gmx")) {
Sound* snd = gmx::LoadSound(fName.toStdString());
if (snd != nullptr) {
if (fName.endsWith("Sound.gmx") || fName.endsWith(".spr")) {
std::optional<Sound> snd = egm::LoadResource<Sound>(fName.toStdString());
if (snd.has_value()) {
// QString lastData = GetModelData(Sound::kDataFieldNumber).toString();
ReplaceBuffer(snd);
ReplaceBuffer(&snd.value());
// QString newData = GetModelData(Sound::kDataFieldNumber).toString();
// TODO: Copy data into our egm and reset the path
// SetModelData(Sound::kDataFieldNumber, lastData);
Expand Down
18 changes: 4 additions & 14 deletions MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ QFileInfo MainWindow::getEnigmaRoot() {
return EnigmaRoot;
}

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), _ui(new Ui::MainWindow), egm(nullptr) {
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), _ui(new Ui::MainWindow){

if (!EnigmaRoot.filePath().isEmpty()) {
_event_data = std::make_unique<EventData>(ParseEventFile((EnigmaRoot.absolutePath() + "/events.ey").toStdString()));
Expand All @@ -114,7 +114,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), _ui(new Ui::MainW
_event_data = std::make_unique<EventData>(ParseEventFile(ss));
}

egm = egm::EGM(_event_data.get());
egm::LibEGMInit(_event_data.get());

ArtManager::Init();

Expand Down Expand Up @@ -304,18 +304,8 @@ void MainWindow::updateWindowMenu() {

void MainWindow::openFile(QString fName) {
QFileInfo fileInfo(fName);
const QString suffix = fileInfo.suffix();

std::unique_ptr<buffers::Project> loadedProject = nullptr;
if (suffix == "egm") {
loadedProject = egm.LoadEGM(fName.toStdString());
} else if (suffix == "gm81" || suffix == "gmk" || suffix == "gm6" || suffix == "gmd") {
loadedProject = gmk::LoadGMK(fName.toStdString(), _event_data.get());
} else if (suffix == "gmx") {
loadedProject = gmx::LoadGMX(fName.toStdString(), _event_data.get());
} else if (suffix == "yyp") {
loadedProject = yyp::LoadYYP(fName.toStdString(), _event_data.get());
}

std::unique_ptr<buffers::Project> loadedProject = egm::LoadProject(fName.toStdString());

if (!loadedProject) {
QMessageBox::warning(this, tr("Failed To Open Project"), tr("There was a problem loading the project: ") + fName,
Expand Down
1 change: 0 additions & 1 deletion MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ class MainWindow : public QMainWindow {
QPointer<RecentFiles> _recentFiles;

static std::unique_ptr<EventData> _event_data;
egm::EGM egm;

void openSubWindow(buffers::TreeNode *item);
void readSettings();
Expand Down
2 changes: 1 addition & 1 deletion Submodules/enigma-dev
Submodule enigma-dev updated 41 files
+28 −65 CommandLine/emake/Main.cpp
+4 −21 CommandLine/gm2egm/main.cpp
+5 −0 CommandLine/libEGM/action.h
+97 −90 CommandLine/libEGM/egm-read.cpp
+30 −24 CommandLine/libEGM/egm-write.cpp
+18 −14 CommandLine/libEGM/egm.h
+96 −0 CommandLine/libEGM/file-format.cpp
+87 −0 CommandLine/libEGM/file-format.h
+55 −48 CommandLine/libEGM/gmk.cpp
+12 −15 CommandLine/libEGM/gmk.h
+43 −91 CommandLine/libEGM/gmx.cpp
+16 −25 CommandLine/libEGM/gmx.h
+6 −0 CommandLine/libEGM/serialization-helpers.h
+6 −0 CommandLine/libEGM/svg-d.h
+19 −19 CommandLine/libEGM/yyp.cpp
+12 −15 CommandLine/libEGM/yyp.h
+1 −0 CommandLine/testing/Tests/draw_test.sog/create.edl
+28 −0 CommandLine/testing/Tests/draw_test.sog/draw.edl
+ CommandLine/testing/data/numbers.png
+2 −2 CompilerSource/gcc_interface/gcc_backend.cpp
+6 −2 ENIGMAsystem/SHELL/Graphics_Systems/Direct3D11/DX11d3d.cpp
+20 −15 ENIGMAsystem/SHELL/Graphics_Systems/Direct3D11/DX11textures.cpp
+14 −9 ENIGMAsystem/SHELL/Graphics_Systems/Direct3D9/DX9textures.cpp
+8 −15 ENIGMAsystem/SHELL/Graphics_Systems/General/GSsprite.cpp
+1 −1 ENIGMAsystem/SHELL/Graphics_Systems/General/texture_atlas.cpp
+5 −3 ENIGMAsystem/SHELL/Graphics_Systems/OpenGL-Common/textures.cpp
+1 −1 ENIGMAsystem/SHELL/Universal_System/Extensions/FileDropper/FileDropper.cpp
+ ENIGMAsystem/SHELL/Universal_System/Extensions/FileDropper/FileDropper.png
+8 −6 ENIGMAsystem/SHELL/Universal_System/Instances/instance.cpp
+2 −2 ENIGMAsystem/SHELL/Universal_System/Resources/backgrounds.cpp
+5 −5 ENIGMAsystem/SHELL/Universal_System/Resources/fontinit.cpp
+8 −7 ENIGMAsystem/SHELL/Universal_System/Resources/sprites.cpp
+8 −0 ENIGMAsystem/SHELL/Universal_System/Resources/sprites_internal.cpp
+1 −0 ENIGMAsystem/SHELL/Universal_System/Resources/sprites_internal.h
+1 −1 ENIGMAsystem/SHELL/Universal_System/image_formats.cpp
+6 −0 ENIGMAsystem/SHELL/Universal_System/image_formats.h
+7 −5 ENIGMAsystem/SHELL/Universal_System/nlpo2.h
+6 −27 appveyor.yml
+2 −6 azure-pipelines.yml
+2 −2 events.ey
+5 −0 shared/strings_util.h