aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dc/icon.cpp8
-rw-r--r--dc/icon.h3
-rw-r--r--dc/label.cpp10
-rw-r--r--dc/label.h3
4 files changed, 14 insertions, 10 deletions
diff --git a/dc/icon.cpp b/dc/icon.cpp
index 1ba92dedb7..93e70ad2b5 100644
--- a/dc/icon.cpp
+++ b/dc/icon.cpp
@@ -68,7 +68,8 @@ void Icon::set_palette(int pal)
(*hwpal)[pal][n] = palette[n];
}
-void Icon::draw(float x1, float y1, float x2, float y2, int pal)
+void Icon::draw(float x1, float y1, float x2, float y2, int pal,
+ unsigned int argb)
{
struct polygon_list mypoly;
struct packed_colour_vertex_list myvertex;
@@ -80,7 +81,8 @@ void Icon::draw(float x1, float y1, float x2, float y2, int pal)
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
- TA_POLYMODE2_TEXTURE_REPLACE|TA_POLYMODE2_U_SIZE_32|TA_POLYMODE2_V_SIZE_32;
+ TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_U_SIZE_32|
+ TA_POLYMODE2_V_SIZE_32;
mypoly.texture = TA_TEXTUREMODE_CLUT4|TA_TEXTUREMODE_CLUTBANK4(pal)|
TA_TEXTUREMODE_ADDRESS(texture);
@@ -90,7 +92,7 @@ void Icon::draw(float x1, float y1, float x2, float y2, int pal)
myvertex.cmd = TA_CMD_VERTEX;
myvertex.ocolour = 0;
- myvertex.colour = 0;
+ myvertex.colour = argb;
myvertex.z = 0.5;
myvertex.u = 0.0;
myvertex.v = 1.0;
diff --git a/dc/icon.h b/dc/icon.h
index a945b152ad..b9cf344bab 100644
--- a/dc/icon.h
+++ b/dc/icon.h
@@ -15,6 +15,7 @@ class Icon
bool load(const char *filename);
void create_texture();
void set_palette(int pal);
- void draw(float x1, float y1, float x2, float y2, int pal);
+ void draw(float x1, float y1, float x2, float y2, int pal,
+ unsigned argb = 0xffffffff);
void create_vmicon(void *buffer);
};
diff --git a/dc/label.cpp b/dc/label.cpp
index 2e7325df30..8f263eec0a 100644
--- a/dc/label.cpp
+++ b/dc/label.cpp
@@ -82,7 +82,7 @@ void Label::create_texture(const char *text)
texture = tex;
}
-void Label::draw(float x, float y, unsigned int argb)
+void Label::draw(float x, float y, unsigned int argb, float scale)
{
struct polygon_list mypoly;
struct packed_colour_vertex_list myvertex;
@@ -94,7 +94,7 @@ void Label::draw(float x, float y, unsigned int argb)
mypoly.mode2 =
TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_ENABLE_ALPHA|
- TA_POLYMODE2_TEXTURE_MODULATE|TA_POLYMODE2_V_SIZE_32|tex_u;
+ TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|TA_POLYMODE2_V_SIZE_32|tex_u;
mypoly.texture = TA_TEXTUREMODE_ARGB1555|TA_TEXTUREMODE_NON_TWIDDLED|
TA_TEXTUREMODE_ADDRESS(texture);
@@ -113,17 +113,17 @@ void Label::draw(float x, float y, unsigned int argb)
myvertex.y = y;
ta_commit_list(&myvertex);
- myvertex.x = x+u;
+ myvertex.x = x+u*scale;
myvertex.u = 1.0;
ta_commit_list(&myvertex);
myvertex.x = x;
- myvertex.y = y+25.0;
+ myvertex.y = y+25.0*scale;
myvertex.u = 0.0;
myvertex.v = 25.0/32.0;
ta_commit_list(&myvertex);
- myvertex.x = x+u;
+ myvertex.x = x+u*scale;
myvertex.u = 1.0;
myvertex.cmd |= TA_CMD_VERTEX_EOS;
ta_commit_list(&myvertex);
diff --git a/dc/label.h b/dc/label.h
index bf43212499..d4a407307d 100644
--- a/dc/label.h
+++ b/dc/label.h
@@ -6,5 +6,6 @@ class Label
public:
void create_texture(const char *text);
- void draw(float x, float y, unsigned int argb = 0xffffffff);
+ void draw(float x, float y, unsigned int argb = 0xffffffff,
+ float scale = 1.0);
};