diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 7b355cf02..51be9b584 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -10528,6 +10528,27 @@ void app_main(int argc,const char **argv) if (numlumps) initprintf("Using .RTS file '%s'\n",ud.rtsname); initprintf("Initializing OSD...\n"); + + OSD_SetFunctions( +#if 1 +//#ifndef _WIN32 + GAME_drawosdchar, + GAME_drawosdstr, + GAME_drawosdcursor, + GAME_getcolumnwidth, + GAME_getrowheight, +#else + NULL, + NULL, + NULL, + NULL, + NULL, +#endif + GAME_clearbackground, + (int(*)(void))GetTime, + GAME_onshowosd + ); + OSD_SetParameters(10,0, 0,12, 4,12); OSD_SetVersionString(HEAD2, 10,0); registerosdcommands(); diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 1a9dd7d83..4ec8dc1c4 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -4492,7 +4492,7 @@ static int parse(void) int q = *insptr++, i = *insptr++; if (fta_quotes[q] == NULL || redefined_quotes[i] == NULL) { - OSD_Printf(CON_ERROR "%s %d null quote %d %d\n",line_num,__FILE__,__LINE__,q,i); + OSD_Printf(CON_ERROR "CON_REDEFINEQUOTE: %s %d null quote\n",line_num,q,i); break; } Bstrcpy(fta_quotes[q],redefined_quotes[i]); @@ -4921,6 +4921,7 @@ static int parse(void) return 1; case CON_ADDAMMO: insptr++; + if(!(*insptrammo_amount[*insptr] >= g_player[g_p].ps->max_ammo_amount[*insptr]) { killit_flag = 2; @@ -4974,6 +4975,7 @@ static int parse(void) case CON_ADDWEAPON: insptr++; + if(!(*insptrgotweapon[*insptr] == 0) { if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr); @@ -5136,18 +5138,22 @@ static int parse(void) switch (tw) { case CON_ACTIVATEBYSECTOR: + if(!(var1inven_icon = 7; g_player[g_p].ps->boot_amount = *insptr; break; + default: + OSD_Printf(CON_ERROR "CON_ADDINVENTORY: Invalid inventory ID %d\n",line_num,*(insptr-1)); + break; } insptr++; break; @@ -6550,8 +6574,8 @@ static int parse(void) Bsprintf(fta_quotes[dq],tempbuf,var1,var2,var3,var4); break; } - if (fta_quotes[sq] == NULL) OSD_Printf(CON_ERROR "%s %d null quote %d\n",line_num,__FILE__,__LINE__,sq); - if (fta_quotes[dq] == NULL) OSD_Printf(CON_ERROR "%s %d null quote %d\n",line_num,__FILE__,__LINE__,dq); + if (fta_quotes[sq] == NULL) OSD_Printf(CON_ERROR "CON_QSPRINTF: null quote %d\n",line_num,sq); + if (fta_quotes[dq] == NULL) OSD_Printf(CON_ERROR "CON_QSPRINTF: null quote %d\n",line_num,dq); insptr += 4; break; } @@ -6597,7 +6621,7 @@ static int parse(void) } else { - OSD_Printf(CON_ERROR "CONLOGVAR: L=%d INVALID ARRAY INDEX\n",line_num,l); + OSD_Printf(CON_ERROR "CON_ADDLOGVAR: L=%d invalid array index\n",line_num,l); break; } } @@ -6610,7 +6634,7 @@ static int parse(void) { // invalid varID insptr++; - OSD_Printf(CON_ERROR "CONLOGVAR: L=%d INVALID VARIABLE\n",line_num,l); + OSD_Printf(CON_ERROR "CON_ADDLOGVAR: L=%d invalid variable\n",line_num,l); break; // out of switch } } @@ -7496,7 +7520,7 @@ static int parse(void) if (fta_quotes[*insptr] == NULL) { - OSD_Printf(CON_ERROR "%s %d null quote %d\n",line_num,__FILE__,__LINE__,*insptr); + OSD_Printf(CON_ERROR "CON_QUOTE: null quote %d\n",line_num,*insptr); insptr++; break; } @@ -7518,7 +7542,7 @@ static int parse(void) if (fta_quotes[i] == NULL) { - OSD_Printf(CON_ERROR "%s %d null quote %d\n",line_num,__FILE__,__LINE__,i); + OSD_Printf(CON_ERROR "CON_USERQUOTE: null quote %d\n",line_num,i); break; } adduserquote(fta_quotes[i]); diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index c6816e20f..c11ac0808 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -555,6 +555,27 @@ static int osdcmd_setvar(const osdfuncparm_t *parm) return OSDCMD_OK; } +static int osdcmd_addlogvar(const osdfuncparm_t *parm) +{ + int i; + char varname[256]; + + if (parm->numparms != 1) return OSDCMD_SHOWHELP; + + if (numplayers > 1) + { + OSD_Printf("Command not allowed in multiplayer\n"); + return OSDCMD_OK; + } + + strcpy(varname,parm->parms[0]); + for (i=0;ii, myconnectindex)); + return OSDCMD_OK; +} + static int osdcmd_setactorvar(const osdfuncparm_t *parm) { int i, varval, ID; @@ -1348,6 +1369,7 @@ int registerosdcommands(void) OSD_RegisterFunction("restartvid","restartvid: reinitializes the video mode",osdcmd_restartvid); OSD_RegisterFunction("sensitivity","sensitivity : changes the mouse sensitivity", osdcmd_sensitivity); + OSD_RegisterFunction("addlogvar","addlogvar : prints the value of a gamevar", osdcmd_addlogvar); OSD_RegisterFunction("setvar","setvar : sets the value of a gamevar", osdcmd_setvar); OSD_RegisterFunction("setvarvar","setvar : sets the value of a gamevar", osdcmd_setvar); OSD_RegisterFunction("setactorvar","setactorvar : sets the value of a gamevar", osdcmd_setactorvar);