Added proper Trails support.

This commit is contained in:
Rinnegatamante
2020-10-23 18:51:56 +02:00
parent a3457eb63d
commit 62c5aa6fc8
4 changed files with 23 additions and 23 deletions
+12 -2
View File
@@ -1202,8 +1202,18 @@ rasterRenderFast(Raster *raster, int32 x, int32 y)
case Raster::CAMERA: case Raster::CAMERA:
setActiveTexture(0); setActiveTexture(0);
glBindTexture(GL_TEXTURE_2D, natdst->texid); glBindTexture(GL_TEXTURE_2D, natdst->texid);
/*glCopyTexSubImage2D(GL_TEXTURE_2D, 0, x, (dst->height-src->height)-y, SceDisplayFrameBuf pParam;
0, 0, src->width, src->height);*/ pParam.size = sizeof(SceDisplayFrameBuf);
sceDisplayGetFrameBuf(&pParam, SCE_DISPLAY_SETBUF_NEXTFRAME);
sceGxmTransferCopy(960, 544, 0, SCE_GXM_COLOR_MASK_A,
SCE_GXM_TRANSFER_COLORKEY_NONE,
SCE_GXM_TRANSFER_FORMAT_U8U8U8U8_ABGR,
SCE_GXM_TRANSFER_LINEAR,
pParam.base, 0, 0, 960 * 4,
SCE_GXM_TRANSFER_FORMAT_U8U8U8_BGR,
SCE_GXM_TRANSFER_LINEAR,
(uint8_t*)vglGetTexDataPointer(GL_TEXTURE_2D) + 1023 * 1024 * 3, 0, 0, - 1024 * 3,
NULL, SCE_GXM_TRANSFER_FRAGMENT_SYNC, NULL);
glBindTexture(GL_TEXTURE_2D, boundTexture[0]); glBindTexture(GL_TEXTURE_2D, boundTexture[0]);
return 1; return 1;
} }
+2 -6
View File
@@ -256,11 +256,9 @@ defaultInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
geo->morphTargets[0].normals, geo->morphTargets[0].normals,
header->totalNumVertex, a->stride); header->totalNumVertex, a->stride);
} else if (!hasNormals) { } else if (!hasNormals) {
int i = 0; for (int i = 0; i < header->totalNumVertex; i++) {
while (i < header->totalNumVertex) {
float *verts_f = (float*)&verts[12 + i * 36]; float *verts_f = (float*)&verts[12 + i * 36];
verts_f[0] = verts_f[1] = verts_f[2] = 0; verts_f[0] = verts_f[1] = verts_f[2] = 0;
i++;
} }
} }
@@ -279,13 +277,11 @@ defaultInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
inst++; inst++;
} }
} else if (!isPrelit) { } else if (!isPrelit) {
int i = 0; for (int i = 0; i < header->totalNumVertex; i++) {
while (i < header->totalNumVertex) {
verts[24 + i * 36] = 0; verts[24 + i * 36] = 0;
verts[25 + i * 36] = 0; verts[25 + i * 36] = 0;
verts[26 + i * 36] = 0; verts[26 + i * 36] = 0;
verts[27 + i * 36] = 255; verts[27 + i * 36] = 255;
i++;
} }
} }
+6 -6
View File
@@ -120,15 +120,15 @@ rasterCreateCameraTexture(Raster *raster)
#ifdef RW_GLES #ifdef RW_GLES
// glReadPixels only supports GL_RGBA // glReadPixels only supports GL_RGBA
natras->internalFormat = GL_RGBA; natras->internalFormat = GL_RGB;
natras->format = GL_RGBA; natras->format = GL_RGB;
natras->type = GL_UNSIGNED_BYTE; natras->type = GL_UNSIGNED_BYTE;
natras->bpp = 4; natras->bpp = 3;
#endif #endif
#ifndef PSP2_NO_DXT_TEXTURES //#ifndef PSP2_NO_DXT_TEXTURES
natras->internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; // natras->internalFormat = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
#endif //#endif
raster->stride = raster->width*natras->bpp; raster->stride = raster->width*natras->bpp;
+3 -9
View File
@@ -148,11 +148,9 @@ skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
geo->morphTargets[0].normals, geo->morphTargets[0].normals,
header->totalNumVertex, a->stride); header->totalNumVertex, a->stride);
} else if (!hasNormals) { } else if (!hasNormals) {
int i = 0; for (int i = 0; i < header->totalNumVertex; i++) {
while (i < header->totalNumVertex) {
float *verts_f = (float*)&verts[12 + i * 56]; float *verts_f = (float*)&verts[12 + i * 56];
verts_f[0] = verts_f[1] = verts_f[2] = 0; verts_f[0] = verts_f[1] = verts_f[2] = 0.0f;
i++;
} }
} }
@@ -164,13 +162,11 @@ skinInstanceCB(Geometry *geo, InstanceDataHeader *header, bool32 reinstance)
geo->colors, geo->colors,
header->totalNumVertex, a->stride); header->totalNumVertex, a->stride);
} else if (!isPrelit) { } else if (!isPrelit) {
int i = 0; for (int i = 0; i < header->totalNumVertex; i++) {
while (i < header->totalNumVertex) {
verts[24 + i * 56] = 0; verts[24 + i * 56] = 0;
verts[25 + i * 56] = 0; verts[25 + i * 56] = 0;
verts[26 + i * 56] = 0; verts[26 + i * 56] = 0;
verts[27 + i * 56] = 255; verts[27 + i * 56] = 255;
i++;
} }
} }
@@ -268,8 +264,6 @@ skinRenderCB(Atomic *atomic, InstanceDataHeader *header)
skinShader->use(); skinShader->use();
while(n--){ while(n--){
m = inst->material; m = inst->material;