diff --git a/nzportable.3dsx b/nzportable.3dsx index 7a1eef3..9365d63 100644 Binary files a/nzportable.3dsx and b/nzportable.3dsx differ diff --git a/nzportable.elf b/nzportable.elf index 5c9d141..8b3433d 100755 Binary files a/nzportable.elf and b/nzportable.elf differ diff --git a/source/cl_hud.c b/source/cl_hud.c index 66aae99..a70574e 100644 --- a/source/cl_hud.c +++ b/source/cl_hud.c @@ -38,19 +38,20 @@ qpic_t *fragpic; qpic_t *bettypic; -qpic_t *b_circle; -qpic_t *b_square; -qpic_t *b_cross; -qpic_t *b_triangle; +qpic_t *b_abutton; +qpic_t *b_bbutton; +qpic_t *b_xbutton; +qpic_t *b_ybutton; qpic_t *b_left; qpic_t *b_right; qpic_t *b_up; qpic_t *b_down; qpic_t *b_lt; qpic_t *b_rt; +qpic_t *b_zlt; +qpic_t *b_zrt; qpic_t *b_start; qpic_t *b_select; -qpic_t *b_home; qpic_t *fx_blood_lu; qpic_t *fx_blood_ru; @@ -124,20 +125,20 @@ void HUD_Init (void) fragpic = Draw_CachePic ("gfx/hud/frag"); bettypic = Draw_CachePic ("gfx/hud/betty"); - b_circle = Draw_CachePic ("gfx/butticons/circle"); - b_square = Draw_CachePic ("gfx/butticons/square"); - b_cross = Draw_CachePic ("gfx/butticons/cross"); - b_triangle = Draw_CachePic ("gfx/butticons/triangle"); - b_left = Draw_CachePic ("gfx/butticons/left"); - b_right = Draw_CachePic ("gfx/butticons/right"); - b_up = Draw_CachePic ("gfx/butticons/up"); - b_down = Draw_CachePic ("gfx/butticons/down"); - b_lt = Draw_CachePic ("gfx/butticons/lt"); - b_rt = Draw_CachePic ("gfx/butticons/rt"); - b_start = Draw_CachePic ("gfx/butticons/start"); - b_select = Draw_CachePic ("gfx/butticons/select"); - b_home = Draw_CachePic ("gfx/butticons/home"); - + b_abutton = Draw_CachePic ("gfx/butticons/facebt_a"); + b_bbutton = Draw_CachePic ("gfx/butticons/facebt_b"); + b_ybutton = Draw_CachePic ("gfx/butticons/facebt_y"); + b_xbutton = Draw_CachePic ("gfx/butticons/facebt_x"); + b_left = Draw_CachePic ("gfx/butticons/dir_left"); + b_right = Draw_CachePic ("gfx/butticons/dir_right"); + b_up = Draw_CachePic ("gfx/butticons/dir_up"); + b_down = Draw_CachePic ("gfx/butticons/dir_down"); + b_lt = Draw_CachePic ("gfx/butticons/shldr_l"); + b_rt = Draw_CachePic ("gfx/butticons/shldr_r"); + b_zlt = Draw_CachePic ("gfx/butticons/shldr_zl"); + b_zrt = Draw_CachePic ("gfx/butticons/shldr_zr"); + b_start = Draw_CachePic ("gfx/butticons/func_sta"); + b_select = Draw_CachePic ("gfx/butticons/func_sel"); fx_blood_lu = Draw_CachePic ("gfx/hud/blood"); /*fx_blood_lu = Draw_CachePic ("gfx/hud/blood_tl"); @@ -531,15 +532,15 @@ void HUD_WorldText(int alpha) if (!strcmp("location", key)) // search for location key { - Draw_ColoredString(4, vid.height/2 + 50, value, 255, 255, 255, alpha, 1); + Draw_ColoredString(4, vid.height/2 + 42, value, 255, 255, 255, alpha, 1); } if (!strcmp("date", key)) // search for date key { - Draw_ColoredString(4, vid.height/2 + 60, value, 255, 255, 255, alpha, 1); + Draw_ColoredString(4, vid.height/2 + 52, value, 255, 255, 255, alpha, 1); } if (!strcmp("person", key)) // search for person key { - Draw_ColoredString(4, vid.height/2 + 70, value, 255, 255, 255, alpha, 1); + Draw_ColoredString(4, vid.height/2 + 62, value, 255, 255, 255, alpha, 1); } } } @@ -615,7 +616,7 @@ void HUD_Rounds (void) Draw_ColoredString(vid.width/2 - (strlen("Round")*8)/2, 80, "Round", 255, 0, 0, value, 2); HUD_WorldText(value2); - Draw_ColoredString(4, vid.height/2 + 40, "'Nazi Zombies'", 255, 255, 255, value2, 1); + Draw_ColoredString(4, vid.height/2 + 32, "'Nazi Zombies'", 255, 255, 255, value2, 1); value -= cl.time * 0.4; value2 += cl.time * 0.4; @@ -629,7 +630,7 @@ void HUD_Rounds (void) // Hold world text for a few seconds else if (textstate == 2) { HUD_WorldText(255); - Draw_ColoredString(4, vid.height/2 + 40, "'Nazi Zombies'", 255, 255, 255, 255, 1); + Draw_ColoredString(4, vid.height/2 + 32, "'Nazi Zombies'", 255, 255, 255, 255, 1); value2 += cl.time * 0.4; @@ -641,7 +642,7 @@ void HUD_Rounds (void) // Fade worldtext out, finally. else if (textstate == 3) { HUD_WorldText(value2); - Draw_ColoredString(4, vid.height/2 + 40, "'Nazi Zombies'", 255, 255, 255, value2, 1); + Draw_ColoredString(4, vid.height/2 + 32, "'Nazi Zombies'", 255, 255, 255, value2, 1); value2 -= cl.time * 0.4; diff --git a/source/gl_draw.c b/source/gl_draw.c index 2dcb3c5..e24c666 100644 --- a/source/gl_draw.c +++ b/source/gl_draw.c @@ -1371,7 +1371,7 @@ GL_Upload32 void GL_Upload32 (byte *data, int width, int height, qboolean mipmap, qboolean alpha) { int samples; - unsigned int scaled[1024*512]; // [512*256]; + static unsigned int scaled[1024*512]; // [512*256]; int scaled_width, scaled_height; for (scaled_width = 1 ; scaled_width < width ; scaled_width<<=1) @@ -1393,17 +1393,6 @@ void GL_Upload32 (byte *data, int width, int height, qboolean mipmap, qboolean samples = alpha ? gl_alpha_format : gl_solid_format; texels += scaled_width * scaled_height; -/* - Con_Printf("GL_Upload32 width: %d height: %d\n", width, height); - for (int rr = 0; rr < height; rr++) { - for (int cc = 0; cc < height; cc++) { - int rowcolindex = ((rr * height)*4) + cc*4; - //Con_Printf("rowcolindex: %d\n", rowcolindex); - Con_Printf("%d %d %d %d\n", data[rowcolindex], data[rowcolindex + 1], data[rowcolindex + 2], data[rowcolindex + 3]); - } - Con_Printf("\n"); - } -*/ if (scaled_width == width && scaled_height == height) { @@ -1612,6 +1601,7 @@ int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolea if (lhcsum != glt->lhcsum || width != glt->width || height != glt->height) { Con_Printf("GL_LoadTexture: cache mismatch\n"); + Con_Printf("lhcsum: %d - %d\twidth: %d - %d\theight: %d - %d\n", lhcsum, glt->lhcsum, width, glt->width, height, glt->height); goto GL_LoadTexture_setup; } return glt->texnum; @@ -1630,7 +1620,9 @@ int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolea GL_LoadTexture_setup: + // naievil -- why do we have this twice lol gltextures[glt->texnum].checksum = lhcsum; + gltextures[glt->texnum].lhcsum = lhcsum; gltextures[glt->texnum].width = width; gltextures[glt->texnum].height = height; diff --git a/source/gl_screen.c b/source/gl_screen.c index 4c2cceb..4b32632 100644 --- a/source/gl_screen.c +++ b/source/gl_screen.c @@ -90,7 +90,7 @@ cvar_t scr_showturtle = {"showturtle","0"}; cvar_t scr_showpause = {"showpause","1"}; cvar_t scr_printspeed = {"scr_printspeed","8"}; cvar_t scr_showfps = {"scr_showfps", "0"}; -cvar_t scr_loadscreen = {"scr_loadscreen","1", qtrue}; +cvar_t scr_loadscreen = {"scr_loadscreen","1"}; cvar_t gl_triplebuffer = {"gl_triplebuffer", "1", true }; extern cvar_t crosshair; @@ -98,12 +98,18 @@ extern cvar_t crosshair; qboolean scr_initialized; // ready to draw qpic_t *hitmark; -qpic_t *scr_ram; -qpic_t *scr_net; -qpic_t *scr_turtle; +qpic_t *lscreen; int scr_fullupdate; +int loadingScreen; +int ShowBlslogo; + +qboolean loadscreeninit; + +char* loadname2; +char* loadnamespec; + int clearconsole; int clearnotify; @@ -235,10 +241,10 @@ Press somthing printing char scr_usestring[1024]; float scr_usetime_off = 0.0f; int button_pic_x; -extern qpic_t *b_circle; -extern qpic_t *b_square; -extern qpic_t *b_cross; -extern qpic_t *b_triangle; +extern qpic_t *b_abutton; +extern qpic_t *b_bbutton; +extern qpic_t *b_ybutton; +extern qpic_t *b_xbutton; extern qpic_t *b_left; extern qpic_t *b_right; extern qpic_t *b_up; @@ -247,7 +253,8 @@ extern qpic_t *b_lt; extern qpic_t *b_rt; extern qpic_t *b_start; extern qpic_t *b_select; -extern qpic_t *b_home; +extern qpic_t *b_zlt; +extern qpic_t *b_zrt; /* ============== @@ -272,33 +279,35 @@ qpic_t *GetButtonIcon (char *buttonname) if (!strncmp (b, buttonname, l) ) { // naievil -- need to fix these - if (!strcmp(Key_KeynumToString(j), "UPARROW")) + if (!strcmp(Key_KeynumToString(j), "PADUP")) return b_up; - else if (!strcmp(Key_KeynumToString(j), "DOWNARROW")) + else if (!strcmp(Key_KeynumToString(j), "PADDOWN")) return b_down; - else if (!strcmp(Key_KeynumToString(j), "LEFTARROW")) + else if (!strcmp(Key_KeynumToString(j), "PADLEFT")) return b_left; - else if (!strcmp(Key_KeynumToString(j), "RIGHTARROW")) + else if (!strcmp(Key_KeynumToString(j), "PADRIGHT")) return b_right; else if (!strcmp(Key_KeynumToString(j), "SELECT")) return b_select; - else if (!strcmp(Key_KeynumToString(j), "HOME")) - return b_home; - else if (!strcmp(Key_KeynumToString(j), "TRIANGLE")) - return b_triangle; - else if (!strcmp(Key_KeynumToString(j), "CIRCLE")) - return b_circle; - else if (!strcmp(Key_KeynumToString(j), "CROSS")) - return b_cross; - else if (!strcmp(Key_KeynumToString(j), "SQUARE")) - return b_square; + else if (!strcmp(Key_KeynumToString(j), "ABUTTON")) + return b_abutton; + else if (!strcmp(Key_KeynumToString(j), "BBUTTON")) + return b_bbutton; + else if (!strcmp(Key_KeynumToString(j), "XBUTTON")) + return b_xbutton; + else if (!strcmp(Key_KeynumToString(j), "YBUTTON")) + return b_ybutton; else if (!strcmp(Key_KeynumToString(j), "LTRIGGER")) return b_lt; else if (!strcmp(Key_KeynumToString(j), "RTRIGGER")) return b_rt; + else if (!strcmp(Key_KeynumToString(j), "ZLTRIGGER")) + return b_zlt; + else if (!strcmp(Key_KeynumToString(j), "ZRTRIGGER")) + return b_zrt; } } - return b_cross; + return b_abutton; } char *GetUseButtonL () @@ -461,13 +470,13 @@ void SCR_DrawUseString (void) return; // the finale prints the characters one at a time - y = vid.height*0.70; + y = vid.height*0.65; l = strlen (scr_usestring); x = (vid.width - l*8)/2; // naievil -- fixme the picture does not show... Draw_String (x, y, scr_usestring); - Draw_Pic (x + button_pic_x*8, y, GetButtonIcon("+use")); + Draw_Pic (x + button_pic_x*8, y - 4, GetButtonIcon("+use")); } void SCR_CheckDrawUseString (void) @@ -645,6 +654,7 @@ void SCR_Init (void) Cvar_RegisterVariable (&scr_centertime); Cvar_RegisterVariable (&scr_printspeed); Cvar_RegisterVariable (&scr_showfps); + Cvar_RegisterVariable (&scr_loadscreen); Cvar_RegisterVariable (&gl_triplebuffer); @@ -655,11 +665,6 @@ void SCR_Init (void) Cmd_AddCommand ("sizeup",SCR_SizeUp_f); Cmd_AddCommand ("sizedown",SCR_SizeDown_f); - // naievil -- fixme remove this - scr_ram = Draw_PicFromWad ("ram"); - scr_net = Draw_PicFromWad ("net"); - scr_turtle = Draw_PicFromWad ("turtle"); - hitmark = Draw_CachePic("gfx/hud/hit_marker"); @@ -710,65 +715,284 @@ void SCR_DrawFPS (void) } } -/* -============== -SCR_DrawRam -============== -*/ -void SCR_DrawRam (void) -{ - if (!scr_showram.value) - return; - - if (!r_cache_thrash) - return; - - Draw_Pic (scr_vrect.x+32, scr_vrect.y, scr_ram); -} - -/* -============== -SCR_DrawTurtle -============== -*/ -void SCR_DrawTurtle (void) -{ - static int count; - - if (!scr_showturtle.value) - return; - - if (host_frametime < 0.1) - { - count = 0; - return; - } - - count++; - if (count < 3) - return; - - Draw_Pic (scr_vrect.x, scr_vrect.y, scr_turtle); -} - -/* -============== -SCR_DrawNet -============== -*/ -void SCR_DrawNet (void) -{ - if (realtime - cl.last_received_message < 0.3) - return; - if (cls.demoplayback) - return; - - Draw_Pic (scr_vrect.x+64, scr_vrect.y, scr_net); -} - //============================================================================= +/* +============== +SCR_DrawLoading +============== +*/ +void SCR_DrawLoading (void) +{ + qpic_t *pic; + + if (!scr_drawloading) + return; + + pic = Draw_CachePic ("gfx/loading.lmp"); + Draw_Pic ( (vid.width - pic->width)/2, + (vid.height - 48 - pic->height)/2, pic); +} + +int Random_Int (int max_int) +{ + float f; + f = (rand ()&0x7fff) / ((float)0x7fff) * max_int; + if (f > 0) + return (int)(f + 0.5) + 1; + else + return (int)(f - 0.5) + 1; +} +/* +============== +SCR_DrawLoadScreen +============== +*/ + +/* + Creds to the following people from the 2020 + Loading Screen Hint Submission/Contest: + + * BCDeshiG + * Derped_Crusader + * Aidan + * yasen + * greg + * Asher + * Bernerd + * Omar Alejandro + * TheSmashers +*/ +double loadingtimechange; +int loadingdot; +int loadingtextwidth; +char *lodinglinetext; +qpic_t *awoo; +char *ReturnLoadingtex (void) +{ + int StringNum = Random_Int(55); + switch(StringNum) + { + case 1: + return "Released in 1996, Quake is now over 25 years old!"; + break; + case 2: + return "Use the Kar98-k to be the hero we want you to be!"; + break; + case 3: + return "There is a huge number of modern engines based on Quake!"; + break; + case 4: + return "Development for NZ:P officially began on September 27, 2009"; + break; + case 5: + return "NZ:P was first released on December 25, 2010!"; + break; + case 6: + return "The 1.1 release of NZ:P has over 90,000 downloads!"; + break; + case 7: + return "NZ:P has been downloaded over 400,000 times!"; + break; + case 8: + return "The original NZP was made mainly by 3 guys around the world."; + break; + case 9: + return "Blubswillrule: known as \"blubs\", is from the USA."; + break; + case 10: + return "Jukki is from Finland."; + break; + case 11: + return "Ju[s]tice, or \"tom\" is from Lithuania."; + break; + case 12: + return "This game is the reason that we have bad sleeping habits!"; + break; + case 13: + return "We had a lot of fun making this game."; + break; + case 14: + return "Did you know you can make your own Custom Map?"; + break; + case 15: + return "Try Retro Mode, it's in the Graphics Settings!"; + break; + case 16: + return "Tired of the base maps? Make your own or try some online!"; + break; + case 17: + return "Slay zombies & be grateful."; + break; + case 18: + return "Custom maps, CUSTOM MAPS!"; + break; + case 19: + return "Go outside & build a snowman!"; + break; + case 20: + return "Please surround yourself with zombies!"; + break; + case 21: + return "Don't play for too long, or zombies will eat you."; + break; + case 22: + return "That was epic... EPIC FOR THE WIIIN!"; //why + break; + case 23: + return "Citra is an awesome 3DS emulator!"; + break; + case 24: + return "You dead yet?"; + break; + case 25: + return "Now 21% cooler!"; + break; + case 26: + return "your lg is nothink on the lan"; //what + break; + case 27: + return "I'm not your chaotic on dm6!"; + break; + case 28: + return "Shoot zombies to kill them. Or knife them. You choose."; + break; + case 29: + return "How many people forgot to Compile today?"; + break; + case 30: + return "ggnore"; + break; + case 31: + return "Have you tried NZ:P on PC or NX?"; + break; + case 32: + return "Submerge your device in water for godmode!"; + break; + case 33: + return "10/10/10 was a good day."; + break; + case 34: + return "Also check out \"No Bugs Allowed\" for the PSP!"; + break; + case 35: + return "MotoLegacy, or \"Ian\", is from the USA."; + break; + case 36: + return "Zombies don't like bullets."; + break; + case 37: + return "Thanks for being an awesome fan!"; + break; + case 38: + return "Removed Herobrine"; + break; + case 39: + return "Pack-a-Punch the Kar98k to get to round infinity."; + break; + case 40: + return "I feel like I'm being gaslit."; + break; + case 41: + return "Heads up! You will die if you are killed!"; + break; + case 42: + return "Zombies legally can't kill you if you say no!"; + break; + case 43: + return "Please help me find the meaning of . Thanks."; + break; + case 44: + return "NZ:P Discord is ONLY for Thomas the Tank Engine Roleplay!"; + break; + case 45: + return "Get rid of the 21% cooler tip, it's an MLP reference."; + break; + case 46: + return "You're playing on a 3DS!"; + break; + case 47: + return "Don't leak the beta!"; + break; + case 48: + return "Jugger-Nog increases your health!"; + break; + case 49: + return "greg was here"; + break; + case 50: + return "Where the hell is the Mystery Box?!"; + break; + case 51: + return "Zombies like getting shot.. I think."; + break; + case 52: + return "pro tip: aiming helps"; + break; + case 53: + return "If a Nazi Zombie bites you, are you a Nazi, or a Zombie?"; + break; + case 54: + return "Play some Custom Maps!"; + break; + } + return "wut wut"; +} +qboolean load_screen_exists; +void SCR_DrawLoadScreen (void) +{ + + if (developer.value) { + return; + } + if (!con_forcedup) { + return; + } + + if (loadingScreen) { + if (!loadscreeninit) { + load_screen_exists = qfalse; + + char* lpath; + lpath = (char*)Z_Malloc(sizeof(char)*32); + strcpy(lpath, "gfx/lscreen/"); + strcat(lpath, loadname2); + + lscreen = Draw_CachePic(lpath); + awoo = Draw_CachePic("gfx/menu/awoo"); + + if (lscreen != NULL) + load_screen_exists = qtrue; + + loadscreeninit = qtrue; + } + + if (load_screen_exists == qtrue) + Draw_Pic(scr_vrect.x, scr_vrect.y, lscreen); + + Draw_FillByColor(0, 0, 480, 24, 0, 0, 0, 150); + Draw_FillByColor(0, 248, 480, 24, 0, 0, 0, 150); + + Draw_ColoredString(2, 4, loadnamespec, 255, 255, 0, 255, 2); + } + + if (loadingtimechange < Sys_FloatTime ()) + { + lodinglinetext = ReturnLoadingtex(); + loadingtextwidth = strlen(lodinglinetext)*8; + loadingtimechange = Sys_FloatTime () + 5; + } + + if (key_dest == key_game) { + Draw_ColoredString(vid.width/2 - loadingtextwidth/2, 225, lodinglinetext, 255, 255, 255, 255, 1); + + if (strcmp(lodinglinetext, "Please help me find the meaning of . Thanks.") == 0) { + Draw_Pic(280, 225, awoo); + } + } +} + /* ================== @@ -1253,20 +1477,20 @@ void SCR_UpdateScreen (void) GL_Set2D (); - // naievil -- fixme Draw_Crosshair (); //muff - to show FPS on screen SCR_DrawFPS (); SCR_CheckDrawCenterString (); SCR_CheckDrawUseString (); - HUD_Draw (); // naievil -- fixme + HUD_Draw (); SCR_DrawConsole (); M_Draw (); // naievil -- fixme - //if(scr_loadscreen.value) - // SCR_DrawLoadScreen(); + if(scr_loadscreen.value) { + SCR_DrawLoadScreen(); + } // naievil -- fixme //Draw_LoadingFill(); diff --git a/source/host_cmd.c b/source/host_cmd.c index d33fe6e..2349ae3 100644 --- a/source/host_cmd.c +++ b/source/host_cmd.c @@ -1313,6 +1313,7 @@ void Host_Spawn_f (void) Sys_Printf ("%s entered the game\n", host_client->name); PR_ExecuteProgram (pr_global_struct->PutClientInServer); + S_LocalSound ("sounds/rounds/splash.wav"); // since this won't execute in progs... } diff --git a/source/menu.c b/source/menu.c index ef8089b..3649a57 100644 --- a/source/menu.c +++ b/source/menu.c @@ -23,6 +23,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "winquake.h" #endif +extern int loadingScreen; +extern char* loadname2; +extern char* loadnamespec; +extern qboolean loadscreeninit; + achievement_list_t achievement_list[MAX_ACHIEVEMENTS]; void (*vid_menudrawfn)(void); @@ -161,9 +166,10 @@ void M_ToggleMenu_f (void) { m_entersound = true; - if (key_dest == key_menu) + // naievil -- fixme don't have pause yet + if (key_dest == key_menu /*|| key_dest == key_menu_pause*/) { - if (m_state != m_main) + if (m_state != m_main /*&& m_state != m_paused_menu*/) { M_Menu_Main_f (); return; @@ -176,6 +182,12 @@ void M_ToggleMenu_f (void) { Con_ToggleConsole_f (); } + else if (sv.active && (svs.maxclients > 1 || key_dest == key_game)) + { + Con_Printf("Draw pause here\n"); + // naievil -- fixme + //M_Paused_Menu_f(); + } else { M_Menu_Main_f (); @@ -322,18 +334,36 @@ void M_SinglePlayer_Key (int key) switch (m_singleplayer_cursor) { case 0: - Cbuf_AddText ("map ndu\n"); key_dest = key_game; + if (sv.active) + Cbuf_AddText ("disconnect\n"); + Cbuf_AddText ("maxplayers 1\n"); + Cbuf_AddText ("map ndu\n"); + loadingScreen = 1; + loadname2 = "ndu"; + loadnamespec = "Nacht der Untoten"; break; case 1: - Cbuf_AddText ("map warehouse\n"); key_dest = key_game; + if (sv.active) + Cbuf_AddText ("disconnect\n"); + Cbuf_AddText ("maxplayers 1\n"); + Cbuf_AddText ("map warehouse\n"); + loadingScreen = 1; + loadname2 = "warehouse"; + loadnamespec = "Warehouse"; break; case 2: - Cbuf_AddText ("map christmas_special\n"); key_dest = key_game; + if (sv.active) + Cbuf_AddText ("disconnect\n"); + Cbuf_AddText ("maxplayers 1\n"); + Cbuf_AddText ("map christmas_special\n"); + loadingScreen = 1; + loadname2 = "christmas_special"; + loadnamespec = "Christmas Special"; break; case 3: