Update of /cvsroot/netrek/client/netrekxp/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29360/src Modified Files: cowmain.c data.c defaults.c local.c mswindow.c newwin.c option.c playback.c Log Message: Attempt to incorporate Defcom's high resolution bitmaps (80x80) into game . Right now all that is in, is a fed bitmaps, and they don't rotate yet (goal is to have CPU rotate ships for you). Index: mswindow.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- mswindow.c 1 May 2006 18:06:22 -0000 1.11 +++ mswindow.c 2 May 2006 00:55:52 -0000 1.12 @@ -406,6 +406,7 @@ // Remove the ship bitmap structures we've created for (j = 0; j < NUM_TYPES; j++) + { for (k = 0; k < SHIP_VIEWS; k++) { free (fed_bitmapsT[j][k]); @@ -434,7 +435,12 @@ free (rom_bitmaps1[j][k]); free (rom_bitmaps[j][k]); } - + free (fed_bitmapsHR[j]); + free (ind_bitmapsHR[j]); + free (kli_bitmapsHR[j]); + free (ori_bitmapsHR[j]); + free (rom_bitmapsHR[j]); + } free (ship_bitmaps[0]); free (ship_bitmaps[1]); free (ship_bitmaps[2]); Index: newwin.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- newwin.c 1 May 2006 16:10:18 -0000 1.16 +++ newwin.c 2 May 2006 00:55:52 -0000 1.17 @@ -421,6 +421,63 @@ } /******************************************************************************/ +/*** loadweaponsHR() - high quality ship bitmaps, 80x80 +/******************************************************************************/ +void loadbitmapsHR() +{ + int j; + + if ( access("bitmaps/shiplib/fedshipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/indshipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/klishipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/orishipHR.bmp", R_OK) == 0 + && access("bitmaps/shiplib/romshipHR.bmp", R_OK) == 0 ) + { + ship_bitmapsHR[0] = + W_StoreBitmap3 (fed_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_FED_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[1] = + W_StoreBitmap3 (ind_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_IND_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[2] = + W_StoreBitmap3 (kli_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_KLI_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[3] = + W_StoreBitmap3 (ori_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_ORI_SHIP, w, + LR_DEFAULTCOLOR); + ship_bitmapsHR[4] = + W_StoreBitmap3 (rom_ship_bmp_HR, BMP_SHIP_WIDTH_HR * 8, + BMP_SHIP_HEIGHT_HR, BMP_ROM_SHIP, w, + LR_DEFAULTCOLOR); + } + else // No bitmaps, doh! + return; + + for (j = 0; j < NUM_TYPES; j++) + { + fed_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[0], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + ind_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[1], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + kli_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[2], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + ori_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[3], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + rom_bitmapsHR[j] = + W_PointBitmap2 (ship_bitmapsHR[4], j, 0, BMP_SHIP_WIDTH_HR, + BMP_SHIP_HEIGHT_HR); + } +} + +/******************************************************************************/ /*** loadweaponsC() - colorized weapons /******************************************************************************/ void loadweaponsC() @@ -863,6 +920,9 @@ loadbitmapsT(); loadbitmapsG(); break; + case 4: /* HR bitmaps */ + loadbitmapsHR(); + break; default: /* mono */ loadbitmapsM(); break; @@ -875,6 +935,7 @@ loadbitmapsG(); loadbitmapsT(); loadbitmapsM(); + loadbitmapsHR(); } #ifdef BEEPLITE Index: cowmain.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/cowmain.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- cowmain.c 26 Apr 2006 02:04:24 -0000 1.10 +++ cowmain.c 2 May 2006 00:55:52 -0000 1.11 @@ -747,6 +747,27 @@ if ((stringDefault ("indshipMbmpfile")) != NULL) ind_ship_bmp_M = stringDefault ("indshipMbmpfile"); + // HR bitmaps + fed_ship_bmp_HR = "bitmaps/shiplib/fedshipHR.bmp"; + if ((stringDefault ("fedshipHRbmpfile")) != NULL) + fed_ship_bmp_HR = stringDefault ("fedshipHRbmpfile"); + + rom_ship_bmp_HR = "bitmaps/shiplib/romshipHR.bmp"; + if ((stringDefault ("romshipHRbmpfile")) != NULL) + rom_ship_bmp_HR = stringDefault ("romshipHRbmpfile"); + + kli_ship_bmp_HR = "bitmaps/shiplib/klishipHR.bmp"; + if ((stringDefault ("klishipHRbmpfile")) != NULL) + kli_ship_bmp_HR = stringDefault ("klishipHRbmpfile"); + + ori_ship_bmp_HR = "bitmaps/shiplib/orishipHR.bmp"; + if ((stringDefault ("orishipHRbmpfile")) != NULL) + ori_ship_bmp_HR = stringDefault ("orishipHRbmpfile"); + + ind_ship_bmp_HR = "bitmaps/shiplib/indshipHR.bmp"; + if ((stringDefault ("indshipHRbmpfile")) != NULL) + ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); + newwin (display_host, name); #ifdef META Index: local.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- local.c 29 Apr 2006 21:00:43 -0000 1.16 +++ local.c 2 May 2006 00:55:52 -0000 1.17 @@ -454,6 +454,7 @@ int newdx, newdy, distance, angle; /* For newSound */ W_Icon (*ship_bits)[SHIP_VIEWS]; + W_Icon (*ship_bitsHR); /* Kludge to try to fix missing ID chars on tactical (short range) display. */ @@ -667,13 +668,14 @@ /* Logic of color scheme is as follows: 1) Mono bitmaps (colorClient 0) and new bitmaps (colorClient 1) - are the same for both player and everyone else. + and high-res bitmaps (colorClient 4) are the same for both player + and everyone else. 2) Single color bitmaps (colorClient 2) and shaded single color bitmaps (colorClient 3) have a monochrome version (bitmap set G) that will be used for the player's ship, to set it apart in color from the rest of the team */ - if (colorClient <= 0 || colorClient > 3) + if (colorClient <= 0 || colorClient > 4) { switch (j->p_team) { @@ -757,6 +759,27 @@ break; } } + else if (colorClient == 4) + { + switch (j->p_team) + { + case FED: + ship_bitsHR = fed_bitmapsHR; + break; + case ROM: + ship_bitsHR = rom_bitmapsHR; + break; + case KLI: + ship_bitsHR = kli_bitmapsHR; + break; + case ORI: + ship_bitsHR = ori_bitmapsHR; + break; + default: + ship_bitsHR = ind_bitmapsHR; + break; + } + } else /* Default to bitmap set G (greyscale) for player's ship */ { switch (j->p_team) @@ -778,14 +801,25 @@ break; } } - - W_WriteBitmap (dx - (j->p_ship.s_width / 2), + + if (colorClient != 4) + { + W_WriteBitmap (dx - (j->p_ship.s_width / 2), dy - (j->p_ship.s_height / 2), ship_bits[j->p_ship. s_type][rosette (j->p_dir)], - playerColor (j)); - + } + else + { + W_WriteScaleBitmap (dx - (j->p_ship.s_width / 2), + dy - (j->p_ship.s_height / 2), + (float)(BMP_SHIP_WIDTH_HR/j->p_ship.s_width), + (float)(BMP_SHIP_HEIGHT_HR/j->p_ship.s_height), + ship_bitsHR[j->p_ship.s_type], + playerColor (j)); + } + if (j->p_cloakphase > 0) { W_WriteBitmap (dx - (cloak_width / 2), Index: playback.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/playback.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- playback.c 26 Apr 2006 02:04:24 -0000 1.11 +++ playback.c 2 May 2006 00:55:52 -0000 1.12 @@ -177,6 +177,27 @@ if ((stringDefault ("indshipMbmpfile")) != NULL) ind_ship_bmp_M = stringDefault ("indshipMbmpfile"); + // HR bitmaps + fed_ship_bmp_HR = "bitmaps/shiplib/fedshipHR.bmp"; + if ((stringDefault ("fedshipHRbmpfile")) != NULL) + fed_ship_bmp_HR = stringDefault ("fedshipHRbmpfile"); + + rom_ship_bmp_HR = "bitmaps/shiplib/romshipHR.bmp"; + if ((stringDefault ("romshipHRbmpfile")) != NULL) + rom_ship_bmp_HR = stringDefault ("romshipHRbmpfile"); + + kli_ship_bmp_HR = "bitmaps/shiplib/klishipHR.bmp"; + if ((stringDefault ("klishipHRbmpfile")) != NULL) + kli_ship_bmp_HR = stringDefault ("klishipHRbmpfile"); + + ori_ship_bmp_HR = "bitmaps/shiplib/orishipHR.bmp"; + if ((stringDefault ("orishipHRbmpfile")) != NULL) + ori_ship_bmp_HR = stringDefault ("orishipHRbmpfile"); + + ind_ship_bmp_HR = "bitmaps/shiplib/indshipHR.bmp"; + if ((stringDefault ("indshipHRbmpfile")) != NULL) + ind_ship_bmp_HR = stringDefault ("indshipHRbmpfile"); + newwin (display_host, name); resetdefaults (); Index: defaults.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/defaults.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- defaults.c 30 Apr 2006 20:17:47 -0000 1.13 +++ defaults.c 2 May 2006 00:55:52 -0000 1.14 @@ -84,7 +84,8 @@ "0 - mono", "1 - new color bitmaps (default)", "2 - old color bitmaps", - "3 - shaded old color bitmaps", + "3 - shaded old color bitmaps" + "4 - experimental high res bitmaps", NULL } }, Index: data.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/data.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- data.c 1 May 2006 16:10:18 -0000 1.15 +++ data.c 2 May 2006 00:55:52 -0000 1.16 @@ -300,6 +300,11 @@ kli_bitmapsT[NUM_TYPES][SHIP_VIEWS], rom_bitmapsT[NUM_TYPES][SHIP_VIEWS], ori_bitmapsT[NUM_TYPES][SHIP_VIEWS], ind_bitmapsT[NUM_TYPES][SHIP_VIEWS]; +W_Icon ship_bitmapsHR[5]; +W_Icon fed_bitmapsHR[NUM_TYPES], + kli_bitmapsHR[NUM_TYPES], rom_bitmapsHR[NUM_TYPES], + ori_bitmapsHR[NUM_TYPES], ind_bitmapsHR[NUM_TYPES]; + // Planets W_Icon base_planets; W_Icon base_mplanets; @@ -659,6 +664,11 @@ char *kli_ship_bmp_M; char *ori_ship_bmp_M; char *ind_ship_bmp_M; +char *fed_ship_bmp_HR; +char *rom_ship_bmp_HR; +char *kli_ship_bmp_HR; +char *ori_ship_bmp_HR; +char *ind_ship_bmp_HR; // Added to fix thread creation issue HANDLE MainThread = NULL; Index: option.c =================================================================== RCS file: /cvsroot/netrek/client/netrekxp/src/option.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- option.c 30 Apr 2006 20:17:48 -0000 1.11 +++ option.c 2 May 2006 00:55:52 -0000 1.12 @@ -133,6 +133,7 @@ "New color bitmaps", "Old color bitmaps", "Shaded old color bitmaps", + "Experimental high res bitmaps", "" }; @@ -218,7 +219,7 @@ /* range of menus. Will be updated when menu list is assembled */ struct int_range Menus_Range = { 0, 1, 1 }; -struct int_range bitmap_range = { 0, 3, 1 }; +struct int_range bitmap_range = { 0, 4, 1 }; struct int_range keepInfo_range = { 0, 100, 1 };