forked from tsuki/openroller
Compare commits
1
Commits
main
..
msys2-builds
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b8d30bac4 |
@@ -1,7 +1,5 @@
|
|||||||
# OpenRoller
|
# OpenRoller
|
||||||
|
|
||||||
meow
|
|
||||||
|
|
||||||
OpenRoller is an experimental rhythm-game runtime for desktop Linux and Sony
|
OpenRoller is an experimental rhythm-game runtime for desktop Linux and Sony
|
||||||
PSP. It reconstructs compatible playback from independently researched stage
|
PSP. It reconstructs compatible playback from independently researched stage
|
||||||
formats and user-provided data.
|
formats and user-provided data.
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "vectorail/core/gl_loader.hpp"
|
||||||
|
|
||||||
|
inline void ActivateTexture(GLenum texture) {
|
||||||
|
using ActiveTextureProc = void(APIENTRY *)(GLenum);
|
||||||
|
static const auto activeTexture = reinterpret_cast<ActiveTextureProc>(
|
||||||
|
SDL_GL_GetProcAddress("glActiveTexture"));
|
||||||
|
if (activeTexture) activeTexture(texture);
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "openroller/desktop/ServiceMenu.hpp"
|
#include "openroller/desktop/ServiceMenu.hpp"
|
||||||
|
|
||||||
#include "openroller/desktop/CabinetBackend.hpp"
|
#include "openroller/desktop/CabinetBackend.hpp"
|
||||||
|
#include "openroller/desktop/GlCompat.hpp"
|
||||||
#include "vectorail/core/Shader.hpp"
|
#include "vectorail/core/Shader.hpp"
|
||||||
#include "vectorail/core/gl_loader.hpp"
|
#include "vectorail/core/gl_loader.hpp"
|
||||||
|
|
||||||
@@ -109,7 +110,7 @@ public:
|
|||||||
shader_.setBool("uUseTexture", true);
|
shader_.setBool("uUseTexture", true);
|
||||||
shader_.setBool("uUseGradient", false);
|
shader_.setBool("uUseGradient", false);
|
||||||
shader_.setVec4("uColor", color);
|
shader_.setVec4("uColor", color);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
ActivateTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, activeTexture);
|
glBindTexture(GL_TEXTURE_2D, activeTexture);
|
||||||
glBindVertexArray(vao_);
|
glBindVertexArray(vao_);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, vbo_);
|
glBindBuffer(GL_ARRAY_BUFFER, vbo_);
|
||||||
|
|||||||
@@ -14,8 +14,13 @@
|
|||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#include <process.h>
|
||||||
|
#else
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/matrix_transform.hpp>
|
#include <glm/gtc/matrix_transform.hpp>
|
||||||
#include <glm/gtc/quaternion.hpp>
|
#include <glm/gtc/quaternion.hpp>
|
||||||
@@ -23,6 +28,7 @@
|
|||||||
#include "vectorail/core/Shader.hpp"
|
#include "vectorail/core/Shader.hpp"
|
||||||
#include "openroller/desktop/LevelLoader.hpp"
|
#include "openroller/desktop/LevelLoader.hpp"
|
||||||
#include "openroller/desktop/AudioManager.hpp"
|
#include "openroller/desktop/AudioManager.hpp"
|
||||||
|
#include "openroller/desktop/GlCompat.hpp"
|
||||||
#include "vectorail/core/DdsTexture.hpp"
|
#include "vectorail/core/DdsTexture.hpp"
|
||||||
#include "gc/GcTargetEffect.hpp"
|
#include "gc/GcTargetEffect.hpp"
|
||||||
#include "vectorail/core/PngTexture.hpp"
|
#include "vectorail/core/PngTexture.hpp"
|
||||||
@@ -2077,7 +2083,7 @@ int main(int argc, char* argv[]) {
|
|||||||
noteShader.use();
|
noteShader.use();
|
||||||
noteShader.setMat4("uProjection", proj);
|
noteShader.setMat4("uProjection", proj);
|
||||||
noteShader.setInt("uTexture", 0);
|
noteShader.setInt("uTexture", 0);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
ActivateTexture(GL_TEXTURE0);
|
||||||
glBindVertexArray(noteSpriteVAO);
|
glBindVertexArray(noteSpriteVAO);
|
||||||
for (const MarkerDraw& marker : markerDraws) {
|
for (const MarkerDraw& marker : markerDraws) {
|
||||||
if (marker.effectId <= 0 || marker.uvRecordBase < 0) continue;
|
if (marker.effectId <= 0 || marker.uvRecordBase < 0) continue;
|
||||||
@@ -2169,7 +2175,7 @@ int main(int argc, char* argv[]) {
|
|||||||
noteShader.use();
|
noteShader.use();
|
||||||
noteShader.setMat4("uProjection", proj);
|
noteShader.setMat4("uProjection", proj);
|
||||||
noteShader.setInt("uTexture", 0);
|
noteShader.setInt("uTexture", 0);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
ActivateTexture(GL_TEXTURE0);
|
||||||
glBindVertexArray(noteSpriteVAO);
|
glBindVertexArray(noteSpriteVAO);
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
@@ -2250,7 +2256,7 @@ int main(int argc, char* argv[]) {
|
|||||||
glm::ortho(0.0f, static_cast<float>(kGameWidth),
|
glm::ortho(0.0f, static_cast<float>(kGameWidth),
|
||||||
static_cast<float>(kGameHeight), 0.0f, -1.0f, 1.0f));
|
static_cast<float>(kGameHeight), 0.0f, -1.0f, 1.0f));
|
||||||
noteShader.setInt("uTexture", 0);
|
noteShader.setInt("uTexture", 0);
|
||||||
glActiveTexture(GL_TEXTURE0);
|
ActivateTexture(GL_TEXTURE0);
|
||||||
glBindTexture(GL_TEXTURE_2D, helperAtlas.id);
|
glBindTexture(GL_TEXTURE_2D, helperAtlas.id);
|
||||||
glBindVertexArray(noteSpriteVAO);
|
glBindVertexArray(noteSpriteVAO);
|
||||||
const glm::mat4 helperRoot = glm::scale(
|
const glm::mat4 helperRoot = glm::scale(
|
||||||
@@ -2328,6 +2334,25 @@ int main(int argc, char* argv[]) {
|
|||||||
}
|
}
|
||||||
for (SDL_Gamepad* gamepad : gamepads) SDL_CloseGamepad(gamepad);
|
for (SDL_Gamepad* gamepad : gamepads) SDL_CloseGamepad(gamepad);
|
||||||
if (chartCompleted && !gcRoot.empty()) {
|
if (chartCompleted && !gcRoot.empty()) {
|
||||||
|
#ifdef _WIN32
|
||||||
|
char executable[MAX_PATH]{};
|
||||||
|
const DWORD length = GetModuleFileNameA(nullptr, executable, sizeof(executable));
|
||||||
|
if (length > 0 && length < sizeof(executable)) {
|
||||||
|
const std::string root = gcRoot.string();
|
||||||
|
if (gameplayItem == GcGameplayItem::Mirror) {
|
||||||
|
_execl(executable, executable, "--item", "mirror",
|
||||||
|
"--menu", root.c_str(), static_cast<char*>(nullptr));
|
||||||
|
} else if (gameplayItem == GcGameplayItem::Reverse) {
|
||||||
|
_execl(executable, executable, "--item", "reverse",
|
||||||
|
"--menu", root.c_str(), static_cast<char*>(nullptr));
|
||||||
|
} else {
|
||||||
|
_execl(executable, executable, "--menu", root.c_str(),
|
||||||
|
static_cast<char*>(nullptr));
|
||||||
|
}
|
||||||
|
std::cerr << "Could not return to song menu: "
|
||||||
|
<< std::strerror(errno) << std::endl;
|
||||||
|
}
|
||||||
|
#else
|
||||||
char executable[PATH_MAX]{};
|
char executable[PATH_MAX]{};
|
||||||
const ssize_t length = readlink(
|
const ssize_t length = readlink(
|
||||||
"/proc/self/exe", executable, sizeof(executable) - 1);
|
"/proc/self/exe", executable, sizeof(executable) - 1);
|
||||||
@@ -2347,6 +2372,7 @@ int main(int argc, char* argv[]) {
|
|||||||
std::cerr << "Could not return to song menu: "
|
std::cerr << "Could not return to song menu: "
|
||||||
<< std::strerror(errno) << std::endl;
|
<< std::strerror(errno) << std::endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user