Skip to content

Commit

Permalink
simplify repeated affine multimap
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Jun 19, 2024
1 parent 8fc1ae5 commit bd309b4
Show file tree
Hide file tree
Showing 27 changed files with 18 additions and 25 deletions.
Binary file modified gfx/maps/map1x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map1x1.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map1x1.png
Binary file modified gfx/maps/map1x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map1x2.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map1x2.png
Binary file modified gfx/maps/map1x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map1x4.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map1x4.png
Binary file modified gfx/maps/map1x8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map1x8.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map1x8.png
Binary file modified gfx/maps/map2x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map2x1.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map2x1.png
Binary file modified gfx/maps/map2x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map2x2.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map2x2.png
Binary file modified gfx/maps/map2x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map2x4.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map2x4.png
Binary file modified gfx/maps/map4x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map4x1.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map4x1.png
Binary file modified gfx/maps/map4x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map4x2.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map4x2.png
Binary file modified gfx/maps/map4x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map4x4.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map4x4.png
Binary file modified gfx/maps/map8x1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map8x1.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map8x1.png
Binary file modified gfx/maps/map8x2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map8x2.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map8x2.png
Binary file modified gfx/maps/map8x4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gfx/maps/map8x4.t3s
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-f rgb8 -z auto
-f rgba4 -z auto
map8x4.png
17 changes: 5 additions & 12 deletions source/3ds/video_hard.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,22 +310,17 @@ void draw_affine_layer(avertex *vbufs[], C3D_Tex **textures, int count, int base
C3D_TexEnvInit(C3D_GetTexEnv(i));
}
} else {
if (count == 2) C3D_TexEnvBufUpdate(C3D_RGB | C3D_Alpha, GPU_TEV_BUFFER_WRITE_CONFIG(false, true, false, false));
for (int i = 0; i < count; i++) {
C3D_TexBind(i, textures[i]);
C3D_TexEnv *env = C3D_GetTexEnv(i * 2);
C3D_TexEnvInit(env);
C3D_TexEnvColor(env, i == 0 ? 0x7f7fff : 0x7fff7f);
C3D_TexEnvSrc(env, C3D_Both, GPU_TEXTURE2, GPU_CONSTANT, 0);
C3D_TexEnvFunc(env, C3D_Both, GPU_DOT3_RGBA);
env = C3D_GetTexEnv(i * 2 + 1);
C3D_TexEnv *env = C3D_GetTexEnv(i);
C3D_TexEnvInit(env);
C3D_TexEnvSrc(env, C3D_Both, GPU_PREVIOUS, GPU_TEXTURE0 + i, GPU_PREVIOUS_BUFFER);
C3D_TexEnvSrc(env, C3D_Both, GPU_TEXTURE0 + i, GPU_TEXTURE2, GPU_PREVIOUS);
C3D_TexEnvOpRgb(env, 0, i == 0 ? GPU_TEVOP_RGB_SRC_R : GPU_TEVOP_RGB_SRC_G, 0);
C3D_TexEnvOpAlpha(env, 0, i == 0 ? GPU_TEVOP_A_SRC_R : GPU_TEVOP_A_SRC_G, 0);
C3D_TexEnvFunc(env, C3D_Both, i == 0 ? GPU_MODULATE : GPU_MULTIPLY_ADD);
}
if (count == 1) {
C3D_TexEnvInit(C3D_GetTexEnv(2));
C3D_TexEnvInit(C3D_GetTexEnv(3));
C3D_TexEnvInit(C3D_GetTexEnv(1));
}
}

Expand All @@ -340,7 +335,6 @@ void draw_affine_layer(avertex *vbufs[], C3D_Tex **textures, int count, int base
C3D_BufInfo *bufInfo = C3D_GetBufInfo();
BufInfo_Init(bufInfo);
BufInfo_Add(bufInfo, avbuf, sizeof(avertex), 3, 0x210);
C3D_AlphaTest(true, GPU_GREATER, 2); // 0 is fine on hardware, but just to make citra happy

for (int eye = 0; eye < 2; eye++) {
if (vbufs[eye] != NULL) {
Expand All @@ -351,7 +345,6 @@ void draw_affine_layer(avertex *vbufs[], C3D_Tex **textures, int count, int base
}
}

C3D_AlphaTest(true, GPU_GREATER, 0);
bufInfo = C3D_GetBufInfo();
BufInfo_Init(bufInfo);
BufInfo_Add(bufInfo, vbuf, sizeof(vertex), 2, 0x10);
Expand Down

0 comments on commit bd309b4

Please sign in to comment.