mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-01 19:41:16 +00:00
clang format
This commit is contained in:
parent
02371e33ba
commit
02b942b491
@ -61,6 +61,7 @@
|
|||||||
#ifdef __vita__
|
#ifdef __vita__
|
||||||
#include "vita/config.h"
|
#include "vita/config.h"
|
||||||
#include "vita/messagebox.h"
|
#include "vita/messagebox.h"
|
||||||
|
|
||||||
#include <psp2/appmgr.h>
|
#include <psp2/appmgr.h>
|
||||||
#include <psp2/kernel/clib.h>
|
#include <psp2/kernel/clib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -13,5 +13,5 @@ void VITA_SetupDefaultConfigOverrides(dictionary* p_dictionary)
|
|||||||
iniparser_set(p_dictionary, "isle:Draw Cursor", "true");
|
iniparser_set(p_dictionary, "isle:Draw Cursor", "true");
|
||||||
|
|
||||||
// Use e_noAnimation/cut transition
|
// Use e_noAnimation/cut transition
|
||||||
//iniparser_set(p_dictionary, "isle:Transition Type", "1");
|
// iniparser_set(p_dictionary, "isle:Transition Type", "1");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,56 +1,52 @@
|
|||||||
#include "messagebox.h"
|
#include "messagebox.h"
|
||||||
|
|
||||||
|
#include "../../miniwin/src/d3drm/backends/gxm/gxm_context.h"
|
||||||
|
|
||||||
#include <psp2/common_dialog.h>
|
#include <psp2/common_dialog.h>
|
||||||
#include <psp2/message_dialog.h>
|
#include <psp2/message_dialog.h>
|
||||||
|
|
||||||
#include "../../miniwin/src/d3drm/backends/gxm/gxm_context.h"
|
bool Vita_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char* title, const char* message, SDL_Window* window)
|
||||||
|
|
||||||
bool Vita_ShowSimpleMessageBox(
|
|
||||||
SDL_MessageBoxFlags flags,
|
|
||||||
const char* title,
|
|
||||||
const char* message,
|
|
||||||
SDL_Window* window
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
SceMsgDialogParam param;
|
SceMsgDialogParam param;
|
||||||
SceMsgDialogUserMessageParam msgParam;
|
SceMsgDialogUserMessageParam msgParam;
|
||||||
SceMsgDialogButtonsParam buttonParam;
|
SceMsgDialogButtonsParam buttonParam;
|
||||||
SceMsgDialogResult dialog_result;
|
SceMsgDialogResult dialog_result;
|
||||||
SceCommonDialogErrorCode init_result;
|
SceCommonDialogErrorCode init_result;
|
||||||
bool setup_minimal_gxm = false;
|
bool setup_minimal_gxm = false;
|
||||||
|
|
||||||
SDL_zero(param);
|
SDL_zero(param);
|
||||||
sceMsgDialogParamInit(¶m);
|
sceMsgDialogParamInit(¶m);
|
||||||
param.mode = SCE_MSG_DIALOG_MODE_USER_MSG;
|
param.mode = SCE_MSG_DIALOG_MODE_USER_MSG;
|
||||||
|
|
||||||
SDL_zero(msgParam);
|
SDL_zero(msgParam);
|
||||||
char message_data[0x1000];
|
char message_data[0x1000];
|
||||||
SDL_snprintf(message_data, sizeof(message_data), "%s\r\n\r\n%s", title, message);
|
SDL_snprintf(message_data, sizeof(message_data), "%s\r\n\r\n%s", title, message);
|
||||||
|
|
||||||
msgParam.msg = (const SceChar8 *)message_data;
|
msgParam.msg = (const SceChar8*) message_data;
|
||||||
msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_OK;
|
msgParam.buttonType = SCE_MSG_DIALOG_BUTTON_TYPE_OK;
|
||||||
param.userMsgParam = &msgParam;
|
param.userMsgParam = &msgParam;
|
||||||
|
|
||||||
if(!gxm) {
|
if (!gxm) {
|
||||||
gxm = (GXMContext*)SDL_malloc(sizeof(GXMContext));
|
gxm = (GXMContext*) SDL_malloc(sizeof(GXMContext));
|
||||||
}
|
}
|
||||||
if(ret = gxm->init(); ret < 0) {
|
if (ret = gxm->init(); ret < 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
init_result = (SceCommonDialogErrorCode)sceMsgDialogInit(¶m);
|
init_result = (SceCommonDialogErrorCode) sceMsgDialogInit(¶m);
|
||||||
if (init_result >= 0) {
|
if (init_result >= 0) {
|
||||||
while (sceMsgDialogGetStatus() == SCE_COMMON_DIALOG_STATUS_RUNNING) {
|
while (sceMsgDialogGetStatus() == SCE_COMMON_DIALOG_STATUS_RUNNING) {
|
||||||
gxm->clear(0,0,1, true);
|
gxm->clear(0, 0, 1, true);
|
||||||
gxm->swap_display();
|
gxm->swap_display();
|
||||||
}
|
}
|
||||||
SDL_zero(dialog_result);
|
SDL_zero(dialog_result);
|
||||||
sceMsgDialogGetResult(&dialog_result);
|
sceMsgDialogGetResult(&dialog_result);
|
||||||
sceMsgDialogTerm();
|
sceMsgDialogTerm();
|
||||||
return dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_OK;
|
return dialog_result.buttonId == SCE_MSG_DIALOG_BUTTON_ID_OK;
|
||||||
} else {
|
}
|
||||||
return false;
|
else {
|
||||||
}
|
return false;
|
||||||
return true;
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
@ -3,11 +3,6 @@
|
|||||||
|
|
||||||
#include <SDL3/SDL_messagebox.h>
|
#include <SDL3/SDL_messagebox.h>
|
||||||
|
|
||||||
bool Vita_ShowSimpleMessageBox(
|
bool Vita_ShowSimpleMessageBox(SDL_MessageBoxFlags flags, const char* title, const char* message, SDL_Window* window);
|
||||||
SDL_MessageBoxFlags flags,
|
|
||||||
const char* title,
|
|
||||||
const char* message,
|
|
||||||
SDL_Window* window
|
|
||||||
);
|
|
||||||
|
|
||||||
#endif // VITA_MESSAGE_BOX_H
|
#endif // VITA_MESSAGE_BOX_H
|
||||||
|
|||||||
@ -1,13 +1,14 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <psp2/gxm.h>
|
|
||||||
#include "tlsf.h"
|
#include "tlsf.h"
|
||||||
|
|
||||||
|
#include <psp2/gxm.h>
|
||||||
|
|
||||||
#define GXM_DISPLAY_BUFFER_COUNT 3
|
#define GXM_DISPLAY_BUFFER_COUNT 3
|
||||||
|
|
||||||
typedef struct Vertex2D {
|
typedef struct Vertex2D {
|
||||||
float position[2];
|
float position[2];
|
||||||
float texCoord[2];
|
float texCoord[2];
|
||||||
} Vertex2D;
|
} Vertex2D;
|
||||||
|
|
||||||
typedef struct GXMContext {
|
typedef struct GXMContext {
|
||||||
@ -33,10 +34,9 @@ typedef struct GXMContext {
|
|||||||
SceUID patcherVertexUsseUid;
|
SceUID patcherVertexUsseUid;
|
||||||
size_t patcherVertexUsseOffset;
|
size_t patcherVertexUsseOffset;
|
||||||
void* patcherVertexUsse;
|
void* patcherVertexUsse;
|
||||||
|
|
||||||
SceUID patcherFragmentUsseUid;
|
SceUID patcherFragmentUsseUid;
|
||||||
size_t patcherFragmentUsseOffset;
|
size_t patcherFragmentUsseOffset;
|
||||||
void* patcherFragmentUsse;
|
void* patcherFragmentUsse;
|
||||||
|
|
||||||
SceGxmShaderPatcher* shaderPatcher;
|
SceGxmShaderPatcher* shaderPatcher;
|
||||||
|
|
||||||
|
|||||||
@ -281,10 +281,8 @@
|
|||||||
#define INCBIN_EXTERN_2(TYPE, NAME) \
|
#define INCBIN_EXTERN_2(TYPE, NAME) \
|
||||||
INCBIN_EXTERNAL const INCBIN_ALIGN TYPE \
|
INCBIN_EXTERNAL const INCBIN_ALIGN TYPE \
|
||||||
INCBIN_CONCATENATE(INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), INCBIN_STYLE_IDENT(DATA))[]; \
|
INCBIN_CONCATENATE(INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), INCBIN_STYLE_IDENT(DATA))[]; \
|
||||||
INCBIN_EXTERNAL const INCBIN_ALIGN TYPE* const INCBIN_CONCATENATE( \
|
INCBIN_EXTERNAL const INCBIN_ALIGN \
|
||||||
INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
|
TYPE* const INCBIN_CONCATENATE(INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), INCBIN_STYLE_IDENT(END)); \
|
||||||
INCBIN_STYLE_IDENT(END) \
|
|
||||||
); \
|
|
||||||
INCBIN_EXTERNAL const unsigned int INCBIN_CONCATENATE( \
|
INCBIN_EXTERNAL const unsigned int INCBIN_CONCATENATE( \
|
||||||
INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
|
INCBIN_CONCATENATE(INCBIN_PREFIX, NAME), \
|
||||||
INCBIN_STYLE_IDENT(SIZE) \
|
INCBIN_STYLE_IDENT(SIZE) \
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -12,15 +12,15 @@
|
|||||||
|
|
||||||
#define SCE_ERR(func, ...) \
|
#define SCE_ERR(func, ...) \
|
||||||
({ \
|
({ \
|
||||||
DEBUG_ONLY_PRINTF("%s\n", #func); \
|
DEBUG_ONLY_PRINTF("%s\n", #func); \
|
||||||
int __sce_err_ret_val = func(__VA_ARGS__); \
|
int __sce_err_ret_val = func(__VA_ARGS__); \
|
||||||
if (__sce_err_ret_val < 0) { \
|
if (__sce_err_ret_val < 0) { \
|
||||||
sceClibPrintf(#func " error: 0x%x\n", __sce_err_ret_val); \
|
sceClibPrintf(#func " error: 0x%x\n", __sce_err_ret_val); \
|
||||||
} \
|
} \
|
||||||
__sce_err_ret_val; \
|
__sce_err_ret_val; \
|
||||||
})
|
})
|
||||||
|
|
||||||
#define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1))
|
#define ALIGN(x, a) (((x) + ((a) -1)) & ~((a) -1))
|
||||||
|
|
||||||
#define ALIGNMENT(n, a) (((a) - ((n) % (a))) % (a))
|
#define ALIGNMENT(n, a) (((a) - ((n) % (a))) % (a))
|
||||||
|
|
||||||
|
|||||||
@ -153,8 +153,8 @@ HRESULT Direct3DRMImpl::CreateDeviceFromSurface(
|
|||||||
DDSDesc.dwSize = sizeof(DDSURFACEDESC);
|
DDSDesc.dwSize = sizeof(DDSURFACEDESC);
|
||||||
surface->GetSurfaceDesc(&DDSDesc);
|
surface->GetSurfaceDesc(&DDSDesc);
|
||||||
|
|
||||||
|
if (false) {
|
||||||
if(false) {}
|
}
|
||||||
#ifdef USE_SDL_GPU
|
#ifdef USE_SDL_GPU
|
||||||
else if (SDL_memcmp(&guid, &SDL3_GPU_GUID, sizeof(GUID)) == 0) {
|
else if (SDL_memcmp(&guid, &SDL3_GPU_GUID, sizeof(GUID)) == 0) {
|
||||||
DDRenderer = Direct3DRMSDL3GPURenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
DDRenderer = Direct3DRMSDL3GPURenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
||||||
|
|||||||
@ -352,7 +352,8 @@ HRESULT DirectDrawImpl::CreateDevice(
|
|||||||
DDSDesc.dwSize = sizeof(DDSURFACEDESC);
|
DDSDesc.dwSize = sizeof(DDSURFACEDESC);
|
||||||
pBackBuffer->GetSurfaceDesc(&DDSDesc);
|
pBackBuffer->GetSurfaceDesc(&DDSDesc);
|
||||||
|
|
||||||
if(false) {}
|
if (false) {
|
||||||
|
}
|
||||||
#ifdef USE_SDL_GPU
|
#ifdef USE_SDL_GPU
|
||||||
else if (SDL_memcmp(&guid, &SDL3_GPU_GUID, sizeof(GUID)) == 0) {
|
else if (SDL_memcmp(&guid, &SDL3_GPU_GUID, sizeof(GUID)) == 0) {
|
||||||
DDRenderer = Direct3DRMSDL3GPURenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
DDRenderer = Direct3DRMSDL3GPURenderer::Create(DDSDesc.dwWidth, DDSDesc.dwHeight);
|
||||||
|
|||||||
@ -2,17 +2,15 @@
|
|||||||
|
|
||||||
#include "d3drmrenderer.h"
|
#include "d3drmrenderer.h"
|
||||||
#include "d3drmtexture_impl.h"
|
#include "d3drmtexture_impl.h"
|
||||||
#include "ddraw_impl.h"
|
|
||||||
#include "ddpalette_impl.h"
|
#include "ddpalette_impl.h"
|
||||||
|
#include "ddraw_impl.h"
|
||||||
|
#include "gxm_context.h"
|
||||||
|
|
||||||
#include <SDL3/SDL.h>
|
#include <SDL3/SDL.h>
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <psp2/gxm.h>
|
#include <psp2/gxm.h>
|
||||||
#include <psp2/types.h>
|
|
||||||
#include <psp2/kernel/clib.h>
|
#include <psp2/kernel/clib.h>
|
||||||
|
#include <psp2/types.h>
|
||||||
#include "gxm_context.h"
|
#include <vector>
|
||||||
|
|
||||||
DEFINE_GUID(GXM_GUID, 0x682656F3, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x58, 0x4D);
|
DEFINE_GUID(GXM_GUID, 0x682656F3, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x58, 0x4D);
|
||||||
|
|
||||||
@ -20,7 +18,7 @@ DEFINE_GUID(GXM_GUID, 0x682656F3, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|||||||
#define GXM_FRAGMENT_BUFFER_COUNT 3
|
#define GXM_FRAGMENT_BUFFER_COUNT 3
|
||||||
#define GXM_TEXTURE_BUFFER_COUNT 2
|
#define GXM_TEXTURE_BUFFER_COUNT 2
|
||||||
|
|
||||||
//#define GXM_PRECOMPUTE
|
// #define GXM_PRECOMPUTE
|
||||||
|
|
||||||
struct GXMTextureCacheEntry {
|
struct GXMTextureCacheEntry {
|
||||||
IDirect3DRMTexture* texture;
|
IDirect3DRMTexture* texture;
|
||||||
@ -66,21 +64,16 @@ struct GXMSceneLightUniform {
|
|||||||
float ambientLight[3];
|
float ambientLight[3];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
typedef struct Vertex {
|
typedef struct Vertex {
|
||||||
float position[3];
|
float position[3];
|
||||||
float normal[3];
|
float normal[3];
|
||||||
float texCoord[2];
|
float texCoord[2];
|
||||||
} Vertex;
|
} Vertex;
|
||||||
|
|
||||||
class GXMRenderer : public Direct3DRMRenderer {
|
class GXMRenderer : public Direct3DRMRenderer {
|
||||||
public:
|
public:
|
||||||
static Direct3DRMRenderer* Create(DWORD width, DWORD height);
|
static Direct3DRMRenderer* Create(DWORD width, DWORD height);
|
||||||
GXMRenderer(
|
GXMRenderer(DWORD width, DWORD height);
|
||||||
DWORD width,
|
|
||||||
DWORD height
|
|
||||||
);
|
|
||||||
GXMRenderer(int forEnum) {};
|
|
||||||
~GXMRenderer() override;
|
~GXMRenderer() override;
|
||||||
|
|
||||||
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
void PushLights(const SceneLight* lightsArray, size_t count) override;
|
||||||
@ -113,26 +106,26 @@ class GXMRenderer : public Direct3DRMRenderer {
|
|||||||
GXMMeshCacheEntry GXMUploadMesh(const MeshGroup& meshGroup);
|
GXMMeshCacheEntry GXMUploadMesh(const MeshGroup& meshGroup);
|
||||||
|
|
||||||
void StartScene();
|
void StartScene();
|
||||||
inline const SceGxmTexture* UseTexture(GXMTextureCacheEntry& texture) {
|
inline const SceGxmTexture* UseTexture(GXMTextureCacheEntry& texture)
|
||||||
|
{
|
||||||
texture.notifications[texture.currentIndex] = &this->fragmentNotifications[this->currentFragmentBufferIndex];
|
texture.notifications[texture.currentIndex] = &this->fragmentNotifications[this->currentFragmentBufferIndex];
|
||||||
const SceGxmTexture* gxmTexture = &texture.gxmTexture[texture.currentIndex];
|
const SceGxmTexture* gxmTexture = &texture.gxmTexture[texture.currentIndex];
|
||||||
sceGxmSetFragmentTexture(gxm->context, 0, gxmTexture);
|
sceGxmSetFragmentTexture(gxm->context, 0, gxmTexture);
|
||||||
return gxmTexture;
|
return gxmTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Vertex2D* QuadVerticesBuffer() {
|
inline Vertex2D* QuadVerticesBuffer()
|
||||||
Vertex2D* verts = &this->quadVertices[this->currentVertexBufferIndex][this->quadsUsed*4];
|
{
|
||||||
|
Vertex2D* verts = &this->quadVertices[this->currentVertexBufferIndex][this->quadsUsed * 4];
|
||||||
this->quadsUsed += 1;
|
this->quadsUsed += 1;
|
||||||
if(this->quadsUsed >= 50) {
|
if (this->quadsUsed >= 50) {
|
||||||
SDL_Log("QuadVerticesBuffer overflow");
|
SDL_Log("QuadVerticesBuffer overflow");
|
||||||
this->quadsUsed = 0; // declare bankruptcy
|
this->quadsUsed = 0; // declare bankruptcy
|
||||||
}
|
}
|
||||||
return verts;
|
return verts;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline GXMSceneLightUniform* LightsBuffer() {
|
inline GXMSceneLightUniform* LightsBuffer() { return this->lights[this->currentFragmentBufferIndex]; }
|
||||||
return this->lights[this->currentFragmentBufferIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<GXMTextureCacheEntry> m_textures;
|
std::vector<GXMTextureCacheEntry> m_textures;
|
||||||
std::vector<GXMMeshCacheEntry> m_meshes;
|
std::vector<GXMMeshCacheEntry> m_meshes;
|
||||||
@ -153,15 +146,10 @@ class GXMRenderer : public Direct3DRMRenderer {
|
|||||||
SceGxmFragmentProgram* blendedTextureFragmentProgram;
|
SceGxmFragmentProgram* blendedTextureFragmentProgram;
|
||||||
|
|
||||||
// main shader vertex uniforms
|
// main shader vertex uniforms
|
||||||
//const SceGxmProgramParameter* uNormalMatrix;
|
|
||||||
//const SceGxmProgramParameter* uWorldViewProjection;
|
|
||||||
//const SceGxmProgramParameter* uWorld;
|
|
||||||
//const SceGxmProgramParameter* uViewInverse;
|
|
||||||
const SceGxmProgramParameter* uModelViewMatrix;
|
const SceGxmProgramParameter* uModelViewMatrix;
|
||||||
const SceGxmProgramParameter* uNormalMatrix;
|
const SceGxmProgramParameter* uNormalMatrix;
|
||||||
const SceGxmProgramParameter* uProjectionMatrix;
|
const SceGxmProgramParameter* uProjectionMatrix;
|
||||||
|
|
||||||
|
|
||||||
// main shader fragment uniforms
|
// main shader fragment uniforms
|
||||||
const SceGxmProgramParameter* uShininess;
|
const SceGxmProgramParameter* uShininess;
|
||||||
const SceGxmProgramParameter* uColor;
|
const SceGxmProgramParameter* uColor;
|
||||||
@ -205,11 +193,10 @@ inline static void GXMRenderer_EnumDevice(LPD3DENUMDEVICESCALLBACK cb, void* ctx
|
|||||||
helDesc.dwDeviceRenderBitDepth = DDBD_32;
|
helDesc.dwDeviceRenderBitDepth = DDBD_32;
|
||||||
|
|
||||||
int ret = gxm_library_init();
|
int ret = gxm_library_init();
|
||||||
if(ret < 0) {
|
if (ret < 0) {
|
||||||
SDL_Log("gxm_library_init failed: %08x", ret);
|
SDL_Log("gxm_library_init failed: %08x", ret);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumDevice(cb, ctx, "GXM HAL", &halDesc, &helDesc, GXM_GUID);
|
EnumDevice(cb, ctx, "GXM HAL", &halDesc, &helDesc, GXM_GUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user