[Atsoft-commit] CVS: dcgen/gui image.c,1.2,1.3 options.c,1.1,1.2 romlist.c,1.5,1.6
Brought to you by:
atani
|
From: Mike D. <at...@us...> - 2002-02-13 07:57:28
|
Update of /cvsroot/atsoft/dcgen/gui
In directory usw-pr-cvs1:/tmp/cvs-serv21015/gui
Modified Files:
image.c options.c romlist.c
Log Message:
1) Completed the pvr_* migration.
2) Cleaned up the cpu68k to remove about 11kb of "dead" code
3) See ChangeLog for more details.
Index: image.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/gui/image.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** image.c 26 Jan 2002 03:51:44 -0000 1.2
--- image.c 13 Feb 2002 07:57:25 -0000 1.3
***************
*** 9,36 ****
/* Creates the utility texture used for the font and mouse cursor. The
resulting texture will be 256x256. */
! uint32 image_texture = 0;
void prep_image(char *file)
{
! if(image_texture == 0)
{
! image_texture = ta_txr_allocate(1024*1024*2);
}
jpeg_to_texture(file, image_texture, 1024, 1);
}
void show_image(float alpha, uint32 mode)
{
! poly_hdr_t poly;
! vertex_ot_t vert;
! ta_poly_hdr_txr(&poly, mode, TA_RGB565_TWID, 1024, 1024, image_texture, TA_BILINEAR_FILTER);
! ta_commit_poly_hdr(&poly);
! vert.flags = TA_VERTEX_NORMAL;
vert.z = 5.0f;
! vert.a = alpha;
! vert.r = vert.g = vert.b = 1.0f;
! vert.oa = alpha;
! vert.or = vert.og = vert.ob = 0.0f;
// bottom left
--- 9,36 ----
/* Creates the utility texture used for the font and mouse cursor. The
resulting texture will be 256x256. */
! pvr_ptr_t image_texture = NULL;
! pvr_poly_hdr_t image_header;
void prep_image(char *file)
{
! pvr_poly_cxt_t tmp;
! if(image_texture == NULL)
{
! image_texture = (pvr_ptr_t)pvr_mem_malloc(1024*1024*2);
}
jpeg_to_texture(file, image_texture, 1024, 1);
+ pvr_poly_cxt_txr(&tmp, PVR_LIST_OP_POLY, PVR_TXRFMT_RGB565, 1024, 1024, image_texture, PVR_FILTER_BILINEAR);
+ pvr_poly_compile(&image_header, &tmp);
}
void show_image(float alpha, uint32 mode)
{
! pvr_vertex_t vert;
! pvr_prim(&image_header, sizeof(image_header));
! vert.flags = PVR_CMD_VERTEX;
vert.z = 5.0f;
! vert.argb = PVR_PACK_COLOR(alpha, 1, 1, 1);
! vert.oargb = PVR_PACK_COLOR(alpha, 0, 0, 0);
// bottom left
***************
*** 39,43 ****
vert.u = 0.0f;
vert.v = 480.0f / 1024.0f;
! ta_commit_vertex(&vert, sizeof(vert));
// top left
--- 39,43 ----
vert.u = 0.0f;
vert.v = 480.0f / 1024.0f;
! pvr_prim(&vert, sizeof(vert));
// top left
***************
*** 46,50 ****
vert.u = 0.0f;
vert.v = 0.0f;
! ta_commit_vertex(&vert, sizeof(vert));
// bottom right
--- 46,50 ----
vert.u = 0.0f;
vert.v = 0.0f;
! pvr_prim(&vert, sizeof(vert));
// bottom right
***************
*** 53,64 ****
vert.u = 640.0f / 1024.0f;
vert.v = 480.0f / 1024.0f;
! ta_commit_vertex(&vert, sizeof(vert));
// top right
vert.x = 640.0f;
vert.y = 0.0f;
vert.u = 640.0f / 1024.0f;
vert.v = 0.0f;
! ta_commit_vertex(&vert, sizeof(vert));
}
--- 53,65 ----
vert.u = 640.0f / 1024.0f;
vert.v = 480.0f / 1024.0f;
! pvr_prim(&vert, sizeof(vert));
// top right
+ vert.flags = PVR_CMD_VERTEX_EOL;
vert.x = 640.0f;
vert.y = 0.0f;
vert.u = 640.0f / 1024.0f;
vert.v = 0.0f;
! pvr_prim(&vert, sizeof(vert));
}
Index: options.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/gui/options.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** options.c 24 Jan 2002 04:30:21 -0000 1.1
--- options.c 13 Feb 2002 07:57:25 -0000 1.2
***************
*** 90,94 ****
{
ta_begin_render();
! show_image(1.0f, TA_OPAQUE);
ta_commit_eol();
--- 90,94 ----
{
ta_begin_render();
! show_image(1.0f, PVR_LIST_OP_POLY);
ta_commit_eol();
Index: romlist.c
===================================================================
RCS file: /cvsroot/atsoft/dcgen/gui/romlist.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** romlist.c 12 Feb 2002 05:56:20 -0000 1.5
--- romlist.c 13 Feb 2002 07:57:25 -0000 1.6
***************
*** 62,66 ****
unsigned char exit = 0;
char filename[512];
- poly_hdr_t poly;
prep_image("/rd/rommenu.jpg");
--- 62,65 ----
***************
*** 72,83 ****
while(!exit)
{
! ta_poly_hdr_col(&poly, TA_TRANSLUCENT);
! ta_begin_render();
! show_image(1.0f, TA_OPAQUE);
! ta_commit_eol();
!
draw_listing();
! ta_commit_eol();
! ta_finish_frame();
if(cont_get_cond(maple_first_controller(), &cond) < 0)
--- 71,86 ----
while(!exit)
{
! pvr_wait_ready();
! pvr_scene_begin();
!
! pvr_list_begin(PVR_LIST_OP_POLY);
! show_image(1.0f, PVR_LIST_OP_POLY);
! pvr_list_finish();
!
! pvr_list_begin(PVR_LIST_TR_POLY);
draw_listing();
! pvr_list_finish();
!
! pvr_scene_finish();
if(cont_get_cond(maple_first_controller(), &cond) < 0)
***************
*** 85,92 ****
--- 88,97 ----
exit = 1;
}
+ #ifndef RELEASE_BUILD
else if(!(cond.buttons & CONT_START))
{
exit = 1;
}
+ #endif
else if(!(cond.buttons & CONT_DPAD_UP))
{
***************
*** 167,178 ****
while(!ui_check_cond(CONT_B))
{
! ta_begin_render();
! pvr_dummy_poly(TA_OPAQUE);
! ta_commit_eol();
draw_poly_strf(40.0f, 200.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, "Error loading rom:");
draw_poly_strf(40.0f, 224.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, msg);
draw_poly_strf(40.0f, 400.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, "PRESS B");
! ta_commit_eol();
! ta_finish_frame();
}
}
--- 172,186 ----
while(!ui_check_cond(CONT_B))
{
! pvr_wait_ready();
! pvr_scene_begin();
! pvr_list_begin(PVR_LIST_OP_POLY);
! pvr_dummy_poly(PVR_LIST_OP_POLY);
! pvr_list_finish();
! pvr_list_begin(PVR_LIST_OP_POLY);
draw_poly_strf(40.0f, 200.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, "Error loading rom:");
draw_poly_strf(40.0f, 224.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, msg);
draw_poly_strf(40.0f, 400.0f, 100.0f, 1.0f, 1.0f, 1.0f, 1.0f, "PRESS B");
! pvr_list_finish();
! pvr_scene_finish();
}
}
|