Skip to content

Commit

Permalink
Fix issue building game when Super GB Mode was enabled before setting…
Browse files Browse the repository at this point in the history
… Color Mode to "Color Only"
  • Loading branch information
chrismaltby committed May 24, 2024
1 parent db703c3 commit c65c1cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix issue where empty project message would be positioned incorrectly if World view was scrolled or zoomed
- Fix issue where World view minimum size wasn't taking into account navigator sidebar or debugger pane causing unnecessary scroll bars
- Fix issue where Math Expression editor would incorrectly show spellcheck errors in function names
- Fix issue building game when Super GB Mode was enabled before setting Color Mode to "Color Only"

## [4.0.0-beta2]

Expand Down
7 changes: 4 additions & 3 deletions src/lib/compiler/makeBuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ const makeBuild = async ({
const env = Object.create(process.env);
const { settings } = data;
const colorEnabled = settings.colorMode !== "mono";
const sgbEnabled = settings.sgbEnabled && settings.colorMode !== "color";
const targetPlatform = buildType === "pocket" ? "pocket" : "gb";

const buildToolsPath = await ensureBuildTools(tmpPath);
Expand All @@ -56,7 +57,7 @@ const makeBuild = async ({
if (colorEnabled) {
env.COLOR = true;
}
if (settings.sgbEnabled && settings.colorMode !== "color") {
if (sgbEnabled) {
env.SGB = true;
}
if (settings.batterylessEnabled) {
Expand Down Expand Up @@ -84,7 +85,7 @@ const makeBuild = async ({
// Compile Source Files
const makeCommands = await getBuildCommands(buildRoot, {
colorEnabled,
sgb: settings.sgbEnabled,
sgb: sgbEnabled,
musicDriver: settings.musicDriver,
batteryless: settings.batterylessEnabled,
debug,
Expand Down Expand Up @@ -164,7 +165,7 @@ const makeBuild = async ({
data.name || "GBStudio",
settings.cartType,
colorEnabled,
settings.sgbEnabled,
sgbEnabled,
settings.musicDriver,
debug,
targetPlatform
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,8 @@ ipcMain.handle(
const projectRoot = Path.dirname(projectPath);
const outputRoot = Path.normalize(`${getTmp()}/${buildUUID}`);
const colorMode = project.settings.colorMode;
const sgbEnabled = project.settings.sgbEnabled;
const sgbEnabled =
project.settings.sgbEnabled && project.settings.colorMode !== "color";
const debuggerEnabled =
options.debugEnabled || project.settings.debuggerEnabled;

Expand Down

0 comments on commit c65c1cc

Please sign in to comment.