Skip to content

Commit

Permalink
windowed mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Dec 19, 2023
1 parent 8661454 commit f09c210
Show file tree
Hide file tree
Showing 29 changed files with 3,176 additions and 317 deletions.
20 changes: 20 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "gitsubmodule"
directory: "/"
schedule:
interval: "daily"
groups:
submodules:
patterns:
- "*"
6 changes: 6 additions & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# These are supported funding model platforms

github: [ThirteenAG]
ko_fi: thirteenag
patreon: ThirteenAG
custom: [https://paypal.me/SergeyP13, https://boosty.to/thirteenag/donate]
120 changes: 80 additions & 40 deletions .github/workflows/msvc_x86.yml
Original file line number Diff line number Diff line change
@@ -1,57 +1,97 @@
name: Build
name: GitHub Actions Build

on:
pull_request:
push:
release:
types: published
paths-ignore:
- "**/*.md"
- '**/*.txt'
branches:
- '**'
pull_request:
paths-ignore:
- "**/*.md"
- '**/*.txt'
workflow_dispatch:
inputs:
release:
description: "Create a release"
type: choice
required: false
default: 'false'
options:
- 'true'
- 'false'

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write

jobs:
build:
runs-on: windows-2022
strategy:
matrix:
platform: [Win32]
buildtype: [Release]
runs-on: windows-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- uses: actions/checkout@v2
uses: microsoft/setup-msbuild@main

- name: Auto Increment Version
uses: MCKanpolat/auto-semver-action@v1
id: versioning
with:
submodules: 'true'
releaseType: minor
incrementPerCommit: false
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure build
run: |
./premake5 vs2022
run: ./premake5 vs2022 --with-version=${{ steps.versioning.outputs.version }}

- name: Build
run: |
msbuild -m build/MaxPayne3.FusionFix.sln /property:Configuration=${{matrix.buildtype}} /property:Platform=${{matrix.platform}}
- name: Move binaries to data
msbuild -m build/MaxPayne3.FusionFix.sln /property:Configuration=Release /property:Platform=Win32
- name: Download Ultimate ASI Loader x86
uses: robinraju/release-downloader@v1.8
with:
repository: "ThirteenAG/Ultimate-ASI-Loader"
tag: "Win32-latest"
fileName: "dinput8-Win32.zip"

- name: Unpack dependencies
run: |
7z x dinput8-Win32.zip -odata/ -y
del dinput8-Win32.zip
del data\dinput8-Win32.SHA512
- name: Pack binaries
run: |
cp "./bin/MaxPayne3.FusionFix.asi" "./data/plugins/MaxPayne3.FusionFix.asi"
7z a MaxPayne3.FusionFix.zip ./data/*
- name: Upload artifact to actions
uses: actions/upload-artifact@v2
./release.bat
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: MaxPayne3.FusionFix.zip
path: ./data/*
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v1.${{ github.run_number }}
release_name: MaxPayne3.FusionFix v1.${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
path: data/*

- name: Upload Release
if: |
github.event.inputs.release == 'true' &&
github.ref_name == 'main' &&
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') &&
github.repository == 'ThirteenAG/MaxPayne3.FusionFix'
uses: ncipollo/release-action@main
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./MaxPayne3.FusionFix.zip
asset_name: MaxPayne3.FusionFix.zip
asset_content_type: application/zip
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: false
name: MaxPayne3.FusionFix v${{ steps.versioning.outputs.version }}
bodyFile: "release.md"
tag: v${{ steps.versioning.outputs.version }}
artifacts: MaxPayne3.FusionFix.zip

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,9 @@ ASALocalRun/

# MFractors (Xamarin productivity tool) working folder
.mfractor/

data/**/*.img
data/update/common/shaders/**/*.fxc

data/plugins/MaxPayne3.FusionFix.asi
MaxPayne3.FusionFix.zip
9 changes: 9 additions & 0 deletions data/plugins/MaxPayne3.FusionFix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@
HideSkipButton = 1
DisableGlobalLeaderboards = 1 // Fixes Hoboken Alleys map crash in coop
OutlinesSizeMultiplier = 1.0f
BorderlessWindowed = 1
GamepadIcons = 0
; 0 - Xbox 360
; 1 - Xbox One
; 2 - Playstation 3
; 3 - Playstation 4
; 4 - Playstation 5
; 5 - Nintendo Switch
; 6 - Steam Deck
Binary file added data/update/platform/textures/buttons_pc.wtd
Binary file not shown.
Binary file added data/update/platform/textures/controller_360.wtd
Binary file not shown.
Binary file modified premake5.exe
Binary file not shown.
47 changes: 42 additions & 5 deletions premake5.lua
Original file line number Diff line number Diff line change
@@ -1,23 +1,60 @@
newoption {
trigger = "with-version",
value = "STRING",
description = "Current version",
default = "1.0",
}

workspace "MaxPayne3.FusionFix"
configurations { "Release", "Debug" }
architecture "x86"
location "build"
buildoptions {"-std:c++latest"}
cppdialect "C++latest"
kind "SharedLib"
language "C++"
targetdir "bin/%{cfg.buildcfg}"
targetextension ".asi"
buildoptions { "/dxifcInlineFunctions-" }

defines { "rsc_CompanyName=\"MaxPayne3.FusionFix\"" }
defines { "rsc_LegalCopyright=\"MaxPayne3.FusionFix\""}
defines { "rsc_FileVersion=\"1.0.0.0\"", "rsc_ProductVersion=\"1.0.0.0\"" }
defines { "rsc_InternalName=\"%{prj.name}\"", "rsc_ProductName=\"%{prj.name}\"", "rsc_OriginalFilename=\"%{prj.name}.dll\"" }
defines { "rsc_FileDescription=\"MaxPayne3.FusionFix\"" }
defines { "rsc_UpdateUrl=\"https://github.com/ThirteenAG/MaxPayne3.FusionFix\"" }

local major = 1
local minor = 0
local build = 0
local revision = 0
if(_OPTIONS["with-version"]) then
local t = {}
for i in _OPTIONS["with-version"]:gmatch("([^.]+)") do
t[#t + 1], _ = i:gsub("%D+", "")
end
while #t < 4 do t[#t + 1] = 0 end
major = math.min(tonumber(t[1]), 255)
minor = math.min(tonumber(t[2]), 255)
build = math.min(tonumber(t[3]), 65535)
revision = math.min(tonumber(t[4]), 65535)
end
defines { "rsc_FileVersion_MAJOR=" .. major }
defines { "rsc_FileVersion_MINOR=" .. minor }
defines { "rsc_FileVersion_BUILD=" .. build }
defines { "rsc_FileVersion_REVISION=" .. revision }
defines { "rsc_FileVersion=\"" .. major .. "." .. minor .. "." .. build .. "\"" }
defines { "rsc_ProductVersion=\"" .. major .. "." .. minor .. "." .. build .. "\"" }

defines { "_CRT_SECURE_NO_WARNINGS" }

includedirs { "source" }
files { "source/dllmain.cpp" }
includedirs { "source/includes" }
includedirs { "source/ledsdk" }
includedirs { "source/dxsdk" }
libdirs { "source/ledsdk" }
libdirs { "source/dxsdk" }
files { "source/*.h", "source/*.hpp", "source/*.cpp", "source/*.hxx", "source/*.ixx" }
files { "source/resources/Versioninfo.rc" }
links { "LogitechLEDLib.lib" }

includedirs { "external/hooking" }
includedirs { "external/injector/include" }
Expand Down Expand Up @@ -61,6 +98,6 @@ workspace "MaxPayne3.FusionFix"
defines { "NDEBUG" }
optimize "On"
staticruntime "On"
project "MaxPayne3.FusionFix"
setpaths("E:/Games/Steam/steamapps/common/Max Payne 3/Max Payne 3/", "MaxPayne3.exe", "plugins/")
setpaths("Z:/WFP/Games/Max Payne/Max Payne 3/", "MaxPayne3.exe", "plugins/")
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Actions Status: Release](https://github.com/ThirteenAG/MaxPayne3.FusionFix/actions/workflows/msvc_x86.yml/badge.svg)](https://github.com/ThirteenAG/MaxPayne3.FusionFix/actions) [![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?logo=discord)](https://discord.gg/RaZXpKExNj)
[![Actions Status: Release](https://github.com/ThirteenAG/MaxPayne3.FusionFix/actions/workflows/msvc_x86.yml/badge.svg)](https://github.com/ThirteenAG/MaxPayne3.FusionFix/actions)

<p align="center">
<img src="https://user-images.githubusercontent.com/4904157/108633054-2ed23d00-7483-11eb-8b6a-2d04e1ac138d.png">
Expand Down
3 changes: 3 additions & 0 deletions release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
copy bin\MaxPayne3.FusionFix.asi data\plugins\MaxPayne3.FusionFix.asi

7z a "MaxPayne3.FusionFix.zip" ".\data\*"
1 change: 1 addition & 0 deletions release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[README](https://github.com/ThirteenAG/MaxPayne3.FusionFix#readme)
Loading

0 comments on commit f09c210

Please sign in to comment.