Skip to content

Commit

Permalink
Merge branch 'main' into RIFT-labels
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 20, 2024
2 parents 8d9fc69 + e5e8e4b commit 2f4ed50
Show file tree
Hide file tree
Showing 70 changed files with 1,216 additions and 203 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: geode-sdk/build-geode-mod@main
with:
bindings: 'TheSillyDoggo/bindings'
build-config: RelWithDebInfo
build-config: 'RelWithDebInfo'
export-pdb: true
combine: true
sdk: 'nightly'
Expand Down
24 changes: 16 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if ("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS" OR IOS)
set(CMAKE_OSX_ARCHITECTURES "arm64")
add_definitions(-DGLES_SILENCE_DEPRECATION)
else()
set(CMAKE_OSX_ARCHITECTURES "arm64")
set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64")
endif()

set(CMAKE_CXX_VISIBILITY_PRESET hidden)
Expand All @@ -17,16 +18,23 @@ file(GLOB SOURCES
src/*/*/*.cpp
)

if ("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS" OR IOS)
file(
src/*.mm
src/*/*.mm
src/*/*/*.mm
)
endif()
#if ("${GEODE_TARGET_PLATFORM}" STREQUAL "iOS" OR IOS)
# src/*.mm
# src/*/*.mm
# src/*/*/*.mm
#endif()

add_library(${PROJECT_NAME} SHARED ${SOURCES})

# Windows specific settings
if (WIN32)
# Disable annoying warnings
target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS)

# Export all symbols for better debugging
set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

if (NOT DEFINED ENV{GEODE_SDK})
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
else()
Expand Down
57 changes: 57 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,60 @@
# 1.6.0

- Fixed Transparent BG not working on apple devices
- Added **Ball Rotation Bug**

# 1.5.9

- Added **Gold User Coins**
- Added **No Ship Fire**
- Added **24 Hour Time** for clock label

# 1.5.8

- Fixed not being able to use checkpoints in platformer with all modes platformer enabled
- Fixed crash when playtesting with **Force Ghost On** enabled
- Coins are now collected if you complete a level with 1 attempt practice complete

# 1.5.7

- Fixed Mouse Cursor not disappearing when closing the menu while in a level
- Fixed not being able to move in platformer mode on arm / m1 macOS
- Added **Force Ghost Trail On and Off**

# 1.5.6

- Fixed Force Platformer not showing platformer UI on mobile
- Fixed All Modes Platformer causing crash playtesting
- Fixed Crash With All Modes Platformer
- Fixed Crash when tapping really early on the loading screen with Show Touches enabled
- Made Pause Countdown have a minimum countdown of 1 second
- Added The Pause Button to the Pause Countdown menu to repause the game on mobile
- Added **Clock Label**

# 1.5.5

- Fixed Crashing almost all the time on macOS / iOS
- Fixed mouse cursor not appearing when opening up the mod menu while in a level on macOS

# 1.5.4

- Fixed Dropdown's not being clickable
- Fixed not being able to search for module options
- Added **Customizable Noclip Tint Colour**
- Added **CPS Counter instant colour fade**
- Added **Customizable Pause Countdown Time**
- **Added [EXPERIMENTAL] Intel macOS support**

# 1.5.3

- Fixed Crash pressing Q or E in the editor with startpos switcher enabled
- Fixed the Button disappearing when switching scenes
- Fixed Noclip not working in the editor
- Changed the Button to use textures instead of labels
- Changed Windows to export function symbols for easier crash fixing
- Added **Labels In Editor**
- **Added [EXPERIMENTAL] ARM / M1 macOS support**

# 1.5.2

- Fixed Crash removing checkpoints with checkpoint limit bypass enabled (thanks @hiimjustin000)
Expand Down
7 changes: 4 additions & 3 deletions mod.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"geode": "3.3.1",
"version": "v1.5.2",
"geode": "3.4.0",
"version": "v1.6.0",
"gd": {
"win": "2.206",
"android": "2.206",
"mac": "2.206"
"mac": "2.206",
"ios": "2.206"
},
"early-load": true,
"id": "thesillydoggo.qolmod",
Expand Down
81 changes: 36 additions & 45 deletions resources/pp-frag.glsl
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#version 120
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif

varying vec2 TexCoords;
#if __VERSION__ == 300
#version 300 es
in vec2 TexCoords;
out vec4 FragColor;
#else
varying vec2 TexCoords;
#endif

uniform sampler2D screen;
uniform vec2 screenSize;
Expand All @@ -10,53 +22,32 @@ uniform float radius;

void main() {
float scaledRadius = radius * screenSize.y * 0.5;
vec2 texOffset = 1.0 / screenSize; // gets size of single texel
vec2 texOffset = 1.0 / screenSize;

vec3 result = texture2D(screen, TexCoords.st).rgb;
if (fast) {
scaledRadius *= radius * 10.0 / ((radius * 10.0 + 1.0) * (radius * 10.0 + 1.0) - 1.0);
float weight = 1.0;
float weightSum = weight;
if (first) {
for (int i = 1; float(i) < scaledRadius; i++) {
weight -= 1.0 / scaledRadius;
weightSum += weight * 2.0;
result += texture2D(screen, TexCoords.st + vec2(texOffset.x * i, 0.0)).rgb * weight;
result += texture2D(screen, TexCoords.st - vec2(texOffset.x * i, 0.0)).rgb * weight;
}
vec3 result = texture2D(screen, TexCoords).rgb;
scaledRadius *= radius * 10.0 / ((radius * 10.0 + 1.0) * (radius * 10.0 + 1.0) - 1.0);
float weight = 1.0;
float weightSum = weight;
if (first) {
for (int i = 1; float(i) < scaledRadius; i++) {
weight -= 1.0 / scaledRadius;
weightSum += weight * 2.0;
result += texture2D(screen, TexCoords + vec2(texOffset.x * float(i), 0.0)).rgb * weight;
result += texture2D(screen, TexCoords - vec2(texOffset.x * float(i), 0.0)).rgb * weight;
}
else {
for (int i = 1; float(i) < scaledRadius; i++) {
weight -= 1.0 / scaledRadius;
weightSum += weight * 2.0;
result += texture2D(screen, TexCoords.st + vec2(0.0, texOffset.y * i)).rgb * weight;
result += texture2D(screen, TexCoords.st - vec2(0.0, texOffset.y * i)).rgb * weight;
}
} else {
for (int i = 1; float(i) < scaledRadius; i++) {
weight -= 1.0 / scaledRadius;
weightSum += weight * 2.0;
result += texture2D(screen, TexCoords + vec2(0.0, texOffset.y * float(i))).rgb * weight;
result += texture2D(screen, TexCoords - vec2(0.0, texOffset.y * float(i))).rgb * weight;
}
result /= weightSum;
}
else {
float firstWeight = 0.84089642 / pow(scaledRadius, 0.96);
result *= firstWeight;
float weightSum = firstWeight;
if (first) {
for (int i = 1; float(i) <= ceil(scaledRadius); i++) {
float weight = firstWeight * exp(-i * i / (2.0 * scaledRadius));
weightSum += weight * 2;
result += texture2D(screen, TexCoords.st + vec2(texOffset.x * i, 0.0)).rgb * weight;
result += texture2D(screen, TexCoords.st - vec2(texOffset.x * i, 0.0)).rgb * weight;
}
}
else {
for (int i = 1; float(i) <= ceil(scaledRadius); i++) {
float weight = firstWeight * exp(-i * i / (2.0 * scaledRadius));
weightSum += weight * 2;
result += texture2D(screen, TexCoords.st + vec2(0.0, texOffset.y * i)).rgb * weight;
result += texture2D(screen, TexCoords.st - vec2(0.0, texOffset.y * i)).rgb * weight;
}
}
result /= weightSum;
}
result /= weightSum;

#if __VERSION__ == 300
FragColor = vec4(result, 1.0);
#else
gl_FragColor = vec4(result, 1.0);
#endif
}
23 changes: 17 additions & 6 deletions resources/pp-vert.glsl
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
#version 120
#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#endif

attribute vec2 aPosition;
attribute vec2 aTexCoords;

varying vec2 TexCoords;
#if __VERSION__ == 300
layout(location = 0) in vec2 aPosition;
layout(location = 1) in vec2 aTexCoords;
out vec2 TexCoords;
#else
attribute vec2 aPosition;
attribute vec2 aTexCoords;
varying vec2 TexCoords;
#endif

void main() {
gl_Position = vec4(aPosition.x, aPosition.y, 0.0, 1.0);
TexCoords = aTexCoords;
}
}
Binary file added resources/sprites/qolmodButtonBG.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/sprites/qolmodButtonOverlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 48 additions & 9 deletions src/Client/AndroidBall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ bool AndroidBall::init()
menu->setPosition(position);
menu->setContentSize(ccp(0, 0));

l = CCLabelBMFont::create(">_", "bigFont.fnt");
l->setAnchorPoint(ccp(0.5f, 0.35f));
//l = CCLabelBMFont::create(">_", "bigFont.fnt");
//l->setAnchorPoint(ccp(0.5f, 0.35f));

btn = CircleButtonSprite::create(l, CircleBaseColor::Gray);
btnOverlay = CCSprite::create(isColonThreeEnabled() ? "qolmodButtonOverlaycolonthree.png"_spr : "qolmodButtonOverlay.png"_spr);

btn = CCSprite::create("qolmodButtonBG.png"_spr);
btn->addChildAtPosition(btnOverlay, Anchor::Center);
menu->addChild(btn);

this->addChild(menu);
Expand Down Expand Up @@ -153,7 +156,7 @@ void AndroidBall::UpdateVisible(bool i)

ColourUtility::pastel++;

l->setColor(ColourUtility::getPastelColour(ColourUtility::pastel));
btnOverlay->setColor(ColourUtility::getPastelColour(ColourUtility::pastel));
instance = this;

if (btn->getActionByTag(69))
Expand All @@ -164,7 +167,7 @@ void AndroidBall::UpdateVisible(bool i)
if (PlayLayer::get())
{
btn->setOpacity(50);
l->setOpacity(50);
btnOverlay->setOpacity(50);

i = false;
}
Expand Down Expand Up @@ -200,7 +203,7 @@ void AndroidBall::UpdateVisible(bool i)
if (i)
{
btn->setOpacity(op);
l->setOpacity(op);
btnOverlay->setOpacity(op);
}
else
{
Expand All @@ -211,7 +214,7 @@ void AndroidBall::UpdateVisible(bool i)
action2->setTag(69);

btn->runAction(action);
l->runAction(action2);
btnOverlay->runAction(action2);
}
}
}
Expand All @@ -232,6 +235,34 @@ float AndroidBall::clampf(float v, float min, float max)
return v;
}

bool AndroidBall::isColonThreeEnabled()
{
return Mod::get()->getSavedValue<bool>("colon-three-secwet-uwu-:3", false);
}

void AndroidBall::setColonThreeEnabled()
{
Mod::get()->setSavedValue<bool>("colon-three-secwet-uwu-:3", !isColonThreeEnabled());

auto spr = CCSprite::create(isColonThreeEnabled() ? "qolmodButtonOverlaycolonthree.png"_spr : "qolmodButtonOverlay.png"_spr)->getTexture();
btnOverlay->setTexture(spr);

#ifndef GEODE_IS_IOS
auto over = CCClippingNode::create(btn);
over->setAlphaThreshold(0.9f);

auto inner = CCLayerColor::create(ccc4(255, 255, 255, 255));
inner->setAnchorPoint(ccp(0.5f, 0.5f));
inner->setContentSize(ccp(100, 100));
inner->ignoreAnchorPointForPosition(false);
inner->runAction(CCFadeOut::create(1));

over->addChild(inner);

menu->addChild(over);
#endif
}

class $modify (CCScene)
{
int getHighestChildZ()
Expand All @@ -251,20 +282,28 @@ class $modify (CCScene)
}
};

#ifdef GEODE_IS_IOS
class $modify (AchievementNotifier)
#else
class $modify (AppDelegate)
#endif
{
void willSwitchToScene(CCScene* newScene)
{
#ifdef GEODE_IS_IOS
AchievementNotifier::willSwitchToScene(newScene);
#else
AppDelegate::willSwitchToScene(newScene);
#endif

if (!newScene)
return;

if (getChildOfType<LoadingLayer>(newScene, 0))
return; // fixes texture ldr

if (AndroidBall::get())
AndroidBall::get()->removeFromParent();
if (auto ball = getChildOfType<AndroidBall>(newScene, 0))
ball->removeFromParent();

newScene->addChild(AndroidBall::create());

Expand Down
Loading

0 comments on commit 2f4ed50

Please sign in to comment.