summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortwinaphex2014-12-12 01:30:05 +0100
committertwinaphex2014-12-12 01:30:05 +0100
commitc54cff8f70e972fcb2b21dc5b746e44a05e38f93 (patch)
tree6678f0e9783b1a86163a7f6e395126866f2fbb3c
parentbf17a15988f1d7efa279baa51ad7861ab8297a58 (diff)
downloadpicogpsp-c54cff8f70e972fcb2b21dc5b746e44a05e38f93.tar.gz
picogpsp-c54cff8f70e972fcb2b21dc5b746e44a05e38f93.tar.bz2
picogpsp-c54cff8f70e972fcb2b21dc5b746e44a05e38f93.zip
Cut down a lot of duplicate code in tile_render functions
-rw-r--r--video.c385
1 files changed, 118 insertions, 267 deletions
diff --git a/video.c b/video.c
index 84916c0..b30ba19 100644
--- a/video.c
+++ b/video.c
@@ -884,16 +884,6 @@ static void render_scanline_text_base_normal(u32 layer,
partial_tile_right_map(base, 8bpp, normal);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, normal);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, normal);
- }
}
else
{
@@ -907,14 +897,14 @@ static void render_scanline_text_base_normal(u32 layer,
multiple_tile_map(base, 8bpp, normal);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, normal);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 8bpp, normal);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, normal);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 8bpp, normal);
}
}
else
@@ -958,16 +948,6 @@ static void render_scanline_text_base_normal(u32 layer,
partial_tile_right_map(base, 4bpp, normal);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, normal);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, normal);
- }
}
else
{
@@ -981,14 +961,14 @@ static void render_scanline_text_base_normal(u32 layer,
multiple_tile_map(base, 4bpp, normal);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, normal);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 4bpp, normal);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, normal);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 4bpp, normal);
}
}
}
@@ -1090,16 +1070,6 @@ static void render_scanline_text_transparent_normal(u32 layer,
partial_tile_right_map(transparent, 8bpp, normal);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, normal);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, normal);
- }
}
else
{
@@ -1113,14 +1083,14 @@ static void render_scanline_text_transparent_normal(u32 layer,
multiple_tile_map(transparent, 8bpp, normal);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, normal);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 8bpp, normal);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, normal);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 8bpp, normal);
}
}
else
@@ -1163,16 +1133,6 @@ static void render_scanline_text_transparent_normal(u32 layer,
partial_tile_right_map(transparent, 4bpp, normal);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, normal);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, normal);
- }
}
else
{
@@ -1186,14 +1146,15 @@ static void render_scanline_text_transparent_normal(u32 layer,
multiple_tile_map(transparent, 4bpp, normal);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, normal);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, normal);
- }
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 4bpp, normal);
+
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 4bpp, normal);
}
}
}
@@ -1294,16 +1255,6 @@ static void render_scanline_text_base_color16(u32 layer,
partial_tile_right_map(base, 8bpp, color16);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, color16);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, color16);
- }
}
else
{
@@ -1317,14 +1268,14 @@ static void render_scanline_text_base_color16(u32 layer,
multiple_tile_map(base, 8bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, color16);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 8bpp, color16);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, color16);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 8bpp, color16);
}
}
else
@@ -1367,15 +1318,6 @@ static void render_scanline_text_base_color16(u32 layer,
}
}
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, color16);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, color16);
- }
}
else
{
@@ -1389,14 +1331,15 @@ static void render_scanline_text_base_color16(u32 layer,
multiple_tile_map(base, 4bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, color16);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 4bpp, color16);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, color16);
- }
+ partial_tile_run = end % 8;
+
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 4bpp, color16);
}
}
}
@@ -1497,16 +1440,6 @@ static void render_scanline_text_transparent_color16(u32 layer,
partial_tile_right_map(transparent, 8bpp, color16);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, color16);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, color16);
- }
}
else
{
@@ -1520,14 +1453,14 @@ static void render_scanline_text_transparent_color16(u32 layer,
multiple_tile_map(transparent, 8bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, color16);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 8bpp, color16);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, color16);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 8bpp, color16);
}
}
else
@@ -1570,15 +1503,6 @@ static void render_scanline_text_transparent_color16(u32 layer,
}
}
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, color16);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, color16);
- }
}
else
{
@@ -1592,14 +1516,15 @@ static void render_scanline_text_transparent_color16(u32 layer,
multiple_tile_map(transparent, 4bpp, color16);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, color16);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 4bpp, color16);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, color16);
- }
+ partial_tile_run = end % 8;
+
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 4bpp, color16);
}
}
}
@@ -1700,16 +1625,6 @@ static void render_scanline_text_base_color32(u32 layer,
partial_tile_right_map(base, 8bpp, color32);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, color32);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, color32);
- }
}
else
{
@@ -1723,14 +1638,14 @@ static void render_scanline_text_base_color32(u32 layer,
multiple_tile_map(base, 8bpp, color32);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, color32);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 8bpp, color32);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, color32);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 8bpp, color32);
}
}
else
@@ -1773,15 +1688,6 @@ static void render_scanline_text_base_color32(u32 layer,
}
}
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, color32);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, color32);
- }
}
else
{
@@ -1795,14 +1701,15 @@ static void render_scanline_text_base_color32(u32 layer,
multiple_tile_map(base, 4bpp, color32);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, color32);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 4bpp, color32);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, color32);
- }
+ partial_tile_run = end % 8;
+
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 4bpp, color32);
}
}
}
@@ -1904,15 +1811,6 @@ static void render_scanline_text_transparent_color32(u32 layer,
}
}
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, color32);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, color32);
- }
}
else
{
@@ -1926,14 +1824,15 @@ static void render_scanline_text_transparent_color32(u32 layer,
multiple_tile_map(transparent, 8bpp, color32);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, color32);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 8bpp, color32);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, color32);
- }
+ partial_tile_run = end % 8;
+
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 8bpp, color32);
}
}
else
@@ -1976,15 +1875,6 @@ static void render_scanline_text_transparent_color32(u32 layer,
}
}
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, color32);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, color32);
- }
}
else
{
@@ -1998,14 +1888,15 @@ static void render_scanline_text_transparent_color32(u32 layer,
multiple_tile_map(transparent, 4bpp, color32);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, color32);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 4bpp, color32);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, color32);
- }
+ partial_tile_run = end % 8;
+
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 4bpp, color32);
}
}
}
@@ -2106,16 +1997,6 @@ static void render_scanline_text_base_alpha(u32 layer,
partial_tile_right_map(base, 8bpp, alpha);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, alpha);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, alpha);
- }
}
else
{
@@ -2129,14 +2010,14 @@ static void render_scanline_text_base_alpha(u32 layer,
multiple_tile_map(base, 8bpp, alpha);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 8bpp, alpha);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 8bpp, alpha);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 8bpp, alpha);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 8bpp, alpha);
}
}
else
@@ -2178,16 +2059,6 @@ static void render_scanline_text_base_alpha(u32 layer,
partial_tile_right_map(base, 4bpp, alpha);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, alpha);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, alpha);
- }
}
else
{
@@ -2201,14 +2072,14 @@ static void render_scanline_text_base_alpha(u32 layer,
multiple_tile_map(base, 4bpp, alpha);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(base, 4bpp, alpha);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(base, 4bpp, alpha);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(base, 4bpp, alpha);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(base, 4bpp, alpha);
}
}
}
@@ -2309,16 +2180,6 @@ static void render_scanline_text_transparent_alpha(u32 layer,
partial_tile_right_map(transparent, 8bpp, alpha);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, alpha);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, alpha);
- }
}
else
{
@@ -2332,14 +2193,14 @@ static void render_scanline_text_transparent_alpha(u32 layer,
multiple_tile_map(transparent, 8bpp, alpha);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 8bpp, alpha);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 8bpp, alpha);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 8bpp, alpha);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 8bpp, alpha);
}
}
else
@@ -2381,16 +2242,6 @@ static void render_scanline_text_transparent_alpha(u32 layer,
partial_tile_right_map(transparent, 4bpp, alpha);
}
}
-
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, alpha);
-
- partial_tile_run = end % 8;
-
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, alpha);
- }
}
else
{
@@ -2404,14 +2255,14 @@ static void render_scanline_text_transparent_alpha(u32 layer,
multiple_tile_map(transparent, 4bpp, alpha);
map_ptr = second_ptr;
end -= pixel_run;
- tile_run = end / 8;
- multiple_tile_map(transparent, 4bpp, alpha);
+ }
+ tile_run = end / 8;
+ multiple_tile_map(transparent, 4bpp, alpha);
- partial_tile_run = end % 8;
- if(partial_tile_run)
- {
- partial_tile_left_map(transparent, 4bpp, alpha);
- }
+ partial_tile_run = end % 8;
+ if(partial_tile_run)
+ {
+ partial_tile_left_map(transparent, 4bpp, alpha);
}
}
}