Create Xref-Html Frames Remove All Frames
file:/home/jivera/wd/pcsx/Dreamcast/texture.c (Tue Nov 25 22:46:14 2003
)
1: /* GhettoPlay: an S3M browser and playback util
2: (c)2000 Dan Potter
3: */
4:
5: #include "gui.h"
6:
7: /* Creates the utility texture used for the font and mouse cursor. The
8: resulting texture will be 256x256. */
9: #include "mouse1.h"
10: pvr_ptr_t util_texture;
11: pvr_poly_hdr_t util_txr_hdr;
12: void setup_util_texture() {
13: uint16 *vram;
14: int x, y;
15: pvr_poly_cxt_t cxt;
16:
17: util_texture = pvr_mem_malloc(256*256*2);
18: printf("util_texture at %08x\n", util_texture);
19: vram = (uint16 *)util_texture;
20:
21: /* First dump in the mouse cursor */
22: for (y=0; y<16; y++) {
23: for (x=0; x<10; x++) {
24: if (mouse1_xpm[y*10+x] == '.')
25: *vram = 0xffff;
26: else if (mouse1_xpm[y*10+x] == '+')
27: *vram = 0xf000;
28: else
29: *vram = 0x0000;
30: vram++;
31: }
32: vram += 256 - 10;
33: }
34:
35: /* Now add the rest as ASCII characters */
36: vram = (uint16 *)util_texture;
37: for (y=0; y<8; y++) {
38: for (x=0; x<16; x++) {
39: /* Skip the first (it's a mouse pointer) */
40: if (x != 0 || y != 0)
41: bfont_draw(vram, 256, 0, y*16+x);
42: vram += 16;
43: }
44: vram += 23*256;
45: }
46:
47: /* Setup a polygon header for the util texture */
48: pvr_poly_cxt_txr(&cxt, PVR_LIST_TR_POLY, PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_NONTWIDDLED,
49: 256, 256, util_texture, PVR_FILTER_NONE);
50: pvr_poly_compile(&util_txr_hdr, &cxt);
51: }
52: /* arch-tag: Matthew Dempsky Wed Oct 15 10:34:25 CST 2003 (Dreamcast/texture.c)
53: */
54:
Html form generated by Xrefactory version 1.6.4 on Fri Dec 12 20:52:56 2003
Trial version.