From 9cf97813690cfeff749e22a5c27bc2fa6dcaacfe Mon Sep 17 00:00:00 2001 From: GravisZro Date: Fri, 24 May 2024 11:46:07 -0400 Subject: [PATCH] Properly format/use variadic macros --- 2dlib/font.cpp | 14 +- 2dlib/memsurf.cpp | 2 +- 2dlib/surface.cpp | 4 +- AudioEncode/encoder.cpp | 14 +- Descent3/AIGoal.cpp | 55 +-- Descent3/AImain.cpp | 103 +++-- Descent3/BOA.cpp | 92 +++-- Descent3/Briefing.cpp | 4 +- Descent3/BriefingParse.cpp | 10 +- Descent3/ConfigItem.cpp | 8 +- Descent3/Controls.cpp | 17 +- Descent3/CtlCfgElem.cpp | 4 +- Descent3/D3ForceFeedback.cpp | 14 +- Descent3/DllWrappers.cpp | 2 +- Descent3/Game2DLL.cpp | 32 +- Descent3/GameLoop.cpp | 120 +++--- Descent3/Inventory.cpp | 46 +-- Descent3/LoadLevel.cpp | 60 ++- Descent3/Mission.cpp | 34 +- Descent3/OsirisLoadandBind.cpp | 145 ++++--- Descent3/PilotPicsAPI.cpp | 16 +- Descent3/Player.cpp | 47 ++- Descent3/SLEW.cpp | 33 +- Descent3/TelCom.cpp | 44 +-- Descent3/TelComEffects.cpp | 24 +- Descent3/TelcomEffectsRender.cpp | 48 +-- Descent3/TerrainSearch.cpp | 2 +- Descent3/WeaponFire.cpp | 24 +- Descent3/aipath.cpp | 58 +-- Descent3/args.cpp | 10 +- Descent3/attach.cpp | 26 +- Descent3/audiotaunts.cpp | 66 ++-- Descent3/bnode.cpp | 8 +- Descent3/bsp.cpp | 56 +-- Descent3/buddymenu.cpp | 2 +- Descent3/cinematics.cpp | 2 +- Descent3/cockpit.cpp | 9 +- Descent3/config.cpp | 8 +- Descent3/credits.cpp | 20 +- Descent3/ctlconfig.cpp | 4 +- Descent3/damage.cpp | 6 +- Descent3/dedicated_server.cpp | 8 +- Descent3/demofile.cpp | 52 +-- Descent3/descent.cpp | 2 +- Descent3/doorway.cpp | 4 +- Descent3/fireball.cpp | 31 +- Descent3/game.cpp | 14 +- Descent3/gamecinematics.cpp | 50 +-- Descent3/gameevent.cpp | 4 +- Descent3/gamefont.cpp | 2 +- Descent3/gamepath.cpp | 2 +- Descent3/gamesave.cpp | 14 +- Descent3/gamesave.h | 2 +- Descent3/gamesequence.cpp | 18 +- Descent3/gametexture.cpp | 12 +- Descent3/hotspotmap.cpp | 54 +-- Descent3/hud.cpp | 24 +- Descent3/hudmessage.cpp | 6 +- Descent3/init.cpp | 61 +-- Descent3/intellivibe.cpp | 6 +- Descent3/levelgoal.cpp | 2 +- Descent3/lighting.cpp | 40 +- Descent3/lightmap_info.cpp | 2 +- Descent3/list.cpp | 6 +- Descent3/loadstate.cpp | 33 +- Descent3/localization.cpp | 4 +- Descent3/marker.cpp | 6 +- Descent3/matcen.cpp | 4 +- Descent3/menu.cpp | 28 +- Descent3/mission_download.cpp | 50 +-- Descent3/multi.cpp | 418 ++++++++++---------- Descent3/multi_client.cpp | 18 +- Descent3/multi_connect.cpp | 46 +-- Descent3/multi_dll_mgr.cpp | 22 +- Descent3/multi_save_setting.cpp | 2 +- Descent3/multi_server.cpp | 74 ++-- Descent3/multi_ui.cpp | 8 +- Descent3/multisafe.cpp | 6 +- Descent3/multisafe_server.cpp | 8 +- Descent3/newui.cpp | 2 +- Descent3/newui_core.cpp | 18 +- Descent3/newui_filedlg.cpp | 6 +- Descent3/object.cpp | 40 +- Descent3/object_lighting.cpp | 10 +- Descent3/objinfo.cpp | 2 +- Descent3/osiris_predefs.cpp | 90 ++--- Descent3/pilot.cpp | 115 +++--- Descent3/pilot_class.cpp | 44 +-- Descent3/procedurals.cpp | 8 +- Descent3/render.cpp | 6 +- Descent3/renderobject.cpp | 6 +- Descent3/robotfire.cpp | 2 +- Descent3/room.cpp | 26 +- Descent3/scorch.cpp | 4 +- Descent3/screens.cpp | 2 +- Descent3/spew.cpp | 19 +- Descent3/subtitles.cpp | 10 +- Descent3/terrain.cpp | 4 +- Descent3/terrainrender.cpp | 8 +- Descent3/trigger.cpp | 2 +- Descent3/vclip.cpp | 20 +- Descent3/viseffect.cpp | 6 +- Descent3/voice.cpp | 12 +- Descent3/weapon.cpp | 4 +- Descent3/winmain.cpp | 4 +- bitmap/bitmain.cpp | 58 +-- bitmap/bumpmap.cpp | 4 +- bitmap/iff.cpp | 6 +- bitmap/lightmap.cpp | 4 +- bitmap/pcx.cpp | 8 +- bitmap/tga.cpp | 20 +- cfile/cfile.cpp | 17 +- d3music/musicapi.cpp | 8 +- dd_grwin32/ddgrWin32DX.cpp | 4 +- dd_grwin32/ddgrWin32GDI.cpp | 4 +- dd_video/vidWin32FS.cpp | 6 +- ddebug/lnxdebug.cpp | 4 +- ddebug/mono.h | 15 +- ddebug/windebug.cpp | 6 +- ddio/ddio.cpp | 4 +- ddio/key.cpp | 4 +- ddio/lnxcdrom.cpp | 20 +- ddio/lnxfile.cpp | 10 +- ddio/lnxio.cpp | 8 +- ddio/lnxkey_sdl.cpp | 4 +- ddio/lnxmouse.cpp | 28 +- ddio/lnxtimer.cpp | 2 +- ddio/sdljoy.cpp | 6 +- ddio/winfile.cpp | 4 +- ddio/winforcefeedback.cpp | 70 ++-- ddio/winio.cpp | 8 +- ddio/winjoy.cpp | 18 +- ddio/winkey.cpp | 16 +- ddio/wintimer.cpp | 14 +- grtext/grfont.cpp | 20 +- legacy/D3Launch/3D_detect.cpp | 8 +- legacy/D3Launch/OS_Config.cpp | 50 +-- legacy/D3Launch/UpdateDlg.cpp | 2 +- legacy/FontEditor/FontCreate.cpp | 16 +- legacy/FontEditor/FontKern.cpp | 12 +- legacy/FontEditor/args.cpp | 4 +- legacy/editor/AISettingsDlg.cpp | 4 +- legacy/editor/AmbientSoundPattern.cpp | 2 +- legacy/editor/BriefEdit.cpp | 6 +- legacy/editor/D3Splash.cpp | 2 +- legacy/editor/EPath.cpp | 4 +- legacy/editor/Erooms.cpp | 24 +- legacy/editor/FilePageDialog.cpp | 4 +- legacy/editor/GrFontDialog.cpp | 22 +- legacy/editor/GrListBox.cpp | 6 +- legacy/editor/HObject.cpp | 4 +- legacy/editor/HRoom.cpp | 14 +- legacy/editor/KeypadDialog.cpp | 6 +- legacy/editor/LightingDialog.cpp | 8 +- legacy/editor/MainFrm.cpp | 24 +- legacy/editor/MegacellDialog.cpp | 18 +- legacy/editor/ObjCScript.cpp | 14 +- legacy/editor/ObjectClipboard.cpp | 28 +- legacy/editor/ObjectDialog.cpp | 6 +- legacy/editor/ObjectListDialog.cpp | 2 +- legacy/editor/PhysicsDlg.cpp | 2 +- legacy/editor/PictListBox.cpp | 6 +- legacy/editor/Read3ds.cpp | 26 +- legacy/editor/RoomUVs.cpp | 2 +- legacy/editor/ScriptEditorDlg.cpp | 10 +- legacy/editor/ScriptLevelInterface.cpp | 22 +- legacy/editor/ScriptParmDialog.cpp | 4 +- legacy/editor/ScriptSelect.h | 4 +- legacy/editor/ScriptStudio.cpp | 6 +- legacy/editor/ScriptSyncDialog.cpp | 6 +- legacy/editor/StatusDlg.cpp | 2 +- legacy/editor/TableFileFilterMng.cpp | 20 +- legacy/editor/TableManage.cpp | 6 +- legacy/editor/TerrainDialog.cpp | 8 +- legacy/editor/TextureDialog.cpp | 14 +- legacy/editor/TextureGrWnd.cpp | 56 +-- legacy/editor/TriggerDialog.cpp | 2 +- legacy/editor/ViewerPropDlg.cpp | 2 +- legacy/editor/WorldObjectsDoorDialog.cpp | 6 +- legacy/editor/WorldObjectsGenericDialog.cpp | 8 +- legacy/editor/WorldObjectsPlayerDialog.cpp | 6 +- legacy/editor/WorldObjectsPowerupDialog.cpp | 6 +- legacy/editor/WorldObjectsRobotDialog.cpp | 6 +- legacy/editor/WorldSoundsDialog.cpp | 6 +- legacy/editor/WorldTexturesDialog.cpp | 32 +- legacy/editor/WorldWeaponsDialog.cpp | 16 +- legacy/editor/ebnode.cpp | 34 +- legacy/editor/editor.cpp | 12 +- legacy/editor/editorDoc.cpp | 8 +- legacy/editor/editorView.cpp | 4 +- legacy/editor/editor_lighting.cpp | 60 +-- legacy/editor/editor_object_lighting.cpp | 2 +- legacy/editor/gameeditor.cpp | 10 +- legacy/editor/jaytest.cpp | 2 +- legacy/editor/rad_cast.cpp | 20 +- legacy/editor/rad_hemicube.cpp | 4 +- legacy/editor/rad_init.cpp | 12 +- legacy/editor/roomkeypaddialog.cpp | 6 +- legacy/mtclient/chat_api.cpp | 28 +- legacy/mtclient/mt_net.cpp | 26 +- legacy/mtclient/mtclient.cpp | 166 ++++---- legacy/mtclient/mtgametrack.cpp | 18 +- legacy/mtclient/mtpilottracker.cpp | 4 +- legacy/musicutils/musicutilsDlg.cpp | 6 +- legacy/powerball/powerball.cpp | 16 +- legacy/renderer/Direct3D.cpp | 236 +++++------ legacy/renderer/opengl.cpp | 89 ++--- legacy/renderer/renderer.cpp | 46 +-- lib/pserror.h | 6 +- linux/lnxcon_null.cpp | 2 +- linux/lnxcontroller.cpp | 20 +- linux/lnxdata.cpp | 16 +- linux/registry.cpp | 20 +- manage/doorpage.cpp | 12 +- manage/gamefilepage.cpp | 8 +- manage/generic.cpp | 41 +- manage/manage.cpp | 149 +++---- manage/megapage.cpp | 6 +- manage/pagelock.cpp | 22 +- manage/shippage.cpp | 42 +- manage/soundpage.cpp | 12 +- manage/texpage.cpp | 22 +- manage/weaponpage.cpp | 44 +-- mem/mem.cpp | 56 +-- misc/error.cpp | 2 +- model/polymodel.cpp | 44 +-- module/module.cpp | 14 +- movie/d3movie.cpp | 12 +- music/omflex.cpp | 14 +- music/sequencer.cpp | 22 +- music/streamer.cpp | 6 +- netcon/includes/con_dll.h | 16 +- netcon/lanclient/lanclient.cpp | 20 +- netgames/anarchy/anarchy.cpp | 4 +- netgames/coop/coop.cpp | 10 +- netgames/ctf/ctf.cpp | 42 +- netgames/dmfc/dmfcbase.cpp | 143 +++---- netgames/dmfc/dmfccfg.cpp | 20 +- netgames/dmfc/dmfcclient.cpp | 39 +- netgames/dmfc/dmfchudmessages.cpp | 20 +- netgames/dmfc/dmfcinputcommand.cpp | 10 +- netgames/dmfc/dmfcinternal.h | 2 +- netgames/dmfc/dmfcmenu.cpp | 42 +- netgames/dmfc/dmfcprecord.cpp | 12 +- netgames/dmfc/dmfcremote.cpp | 18 +- netgames/dmfc/dmfcserver.cpp | 4 +- netgames/dmfc/dmfcui.cpp | 12 +- netgames/dmfc/dmfcvirtual.cpp | 2 +- netgames/entropy/EntropyBase.cpp | 10 +- netgames/entropy/EntropyRoom.cpp | 2 +- netgames/hoard/hoard.cpp | 12 +- netgames/hyperanarchy/hyperanarchy.cpp | 18 +- netgames/includes/DMFC.h | 12 +- netgames/monsterball/monsterball.cpp | 14 +- netgames/roboanarchy/roboanarchy.cpp | 4 +- netgames/tanarchy/tanarchy.cpp | 8 +- networking/directplay.cpp | 302 +++++++------- networking/networking.cpp | 211 +++++----- physics/Collide.cpp | 22 +- physics/FindIntersection.cpp | 225 ++++++----- physics/newstyle_fi.cpp | 2 +- physics/physics.cpp | 275 +++++++------ renderer/HardwareBaseGPU.cpp | 4 +- renderer/HardwareClipper.cpp | 4 +- renderer/HardwareOpenGL.cpp | 75 ++-- renderer/dyna_gl.h | 16 +- renderer/lnxscreenmode.cpp | 10 +- rtperformance/rtperformance.cpp | 16 +- scripts/aigame2.cpp | 12 +- sndlib/ddsoundload.cpp | 34 +- sndlib/ds3dgeometry.cpp | 12 +- sndlib/ds3dlib.cpp | 223 ++++++----- sndlib/dsound3d.cpp | 18 +- sndlib/eax.cpp | 8 +- sndlib/hlsoundlib.cpp | 40 +- sndlib/mixer.cpp | 28 +- sndlib/sdlsound.cpp | 28 +- sndlib/sndrender.cpp | 2 +- sndlib/soundload.cpp | 8 +- stream_audio/osfarchive.cpp | 8 +- stream_audio/streamaudio.cpp | 50 +-- ui/UIButton.cpp | 4 +- ui/UIEdit.cpp | 10 +- ui/UIListBox.cpp | 10 +- ui/UIObject.cpp | 2 +- ui/UIRes.cpp | 2 +- ui/UISlider.cpp | 2 +- ui/UISystem.cpp | 13 +- ui/UIWindow.cpp | 2 +- win32/WinController.cpp | 22 +- win32/winapp.cpp | 18 +- win32/windata.cpp | 14 +- 292 files changed, 3784 insertions(+), 3725 deletions(-) diff --git a/2dlib/font.cpp b/2dlib/font.cpp index 0a0ac75c..7befec09 100644 --- a/2dlib/font.cpp +++ b/2dlib/font.cpp @@ -219,7 +219,7 @@ void grFont::close_system() { } // we should free any fonts currently allocated here. - mprintf((0, "Freeing cached fonts...")); + mprintf(0, "Freeing cached fonts..."); for (int i = 0; i < MAX_FONTS; i++) { gr_font_record *ft; if (grFont::m_FontList[i].references) { @@ -389,7 +389,7 @@ void grFont::load(char *filename, int slot) { Error("Illegal font file: %s.\n", filename); } - mprintf((0, "%s font.\n", grFont::m_FontList[slot].name)); + mprintf(0, "%s font.\n", grFont::m_FontList[slot].name); ft->width = READ_FONT_SHORT(ff); ft->height = READ_FONT_SHORT(ff); @@ -399,7 +399,7 @@ void grFont::load(char *filename, int slot) { ft->max_ascii = READ_FONT_BYTE(ff); READ_FONT_DATA(ff, fontname, 32, 1); - mprintf((0, " ::::::", ft->height, ft->min_ascii, ft->max_ascii, ft->baseline)); + mprintf(0, " ::::::", ft->height, ft->min_ascii, ft->max_ascii, ft->baseline); num_char = ft->max_ascii - ft->min_ascii + 1; @@ -408,7 +408,7 @@ void grFont::load(char *filename, int slot) { ft->char_widths = new int16_t[num_char]; for (i = 0; i < num_char; i++) ft->char_widths[i] = READ_FONT_SHORT(ff); - mprintf((0, "::proportional")); + mprintf(0, "::proportional"); } else { ft->char_widths = NULL; } @@ -427,7 +427,7 @@ void grFont::load(char *filename, int slot) { if (ft->flags & FT_COLOR) { int off = 0; - mprintf((0, "::color")); + mprintf(0, "::color"); for (i = 0; i < num_char; i++) { ft->char_data[i] = ft->raw_data + off; if (ft->flags & FT_PROPORTIONAL) @@ -437,7 +437,7 @@ void grFont::load(char *filename, int slot) { } } else { // Monochrome uint8_t *ptr = ft->raw_data; - mprintf((0, "::mono")); + mprintf(0, "::mono"); for (i = 0; i < num_char; i++) { ft->char_data[i] = ptr; if (ft->flags & FT_PROPORTIONAL) @@ -453,7 +453,7 @@ void grFont::load(char *filename, int slot) { // Then read in CLOSE_FONT(ff); - mprintf((0, "\n")); + mprintf(0, "\n"); grFont::m_FontList[slot].font = fnt; diff --git a/2dlib/memsurf.cpp b/2dlib/memsurf.cpp index 4a70eeca..6d96729a 100644 --- a/2dlib/memsurf.cpp +++ b/2dlib/memsurf.cpp @@ -173,7 +173,7 @@ bool gr_mem_surf_Create(ddgr_surface *sf) { bm->data = (char *)mem_malloc(bm->rowsize * sf->h); if (!bm->data) { - mprintf((0, "mem_Create malloc fail <%s>\n", sf->name)); + mprintf(0, "mem_Create malloc fail <%s>\n", sf->name); delete bm; return false; } diff --git a/2dlib/surface.cpp b/2dlib/surface.cpp index 1e9dccfd..4b94ad1d 100644 --- a/2dlib/surface.cpp +++ b/2dlib/surface.cpp @@ -748,7 +748,7 @@ void grSurface::add_to_list(ddgr_surface *sf) { grSurface::surf_list_cur = node; } - // mprintf((0, "Allocated surface %s [%d].\n", sf->name, DDData.surfs_alloc)); + // mprintf(0, "Allocated surface %s [%d].\n", sf->name, DDData.surfs_alloc); } void grSurface::remove_from_list(ddgr_surface *sf) { @@ -779,5 +779,5 @@ void grSurface::remove_from_list(ddgr_surface *sf) { } } - // mprintf((0, "Freed surface %s [%d].\n", sf->name, DDData.surfs_alloc)); + // mprintf(0, "Freed surface %s [%d].\n", sf->name, DDData.surfs_alloc); } diff --git a/AudioEncode/encoder.cpp b/AudioEncode/encoder.cpp index b6983642..8e1fa36c 100644 --- a/AudioEncode/encoder.cpp +++ b/AudioEncode/encoder.cpp @@ -50,7 +50,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level in = fopen(input_filename, "rb"); if (!in) { - mprintf((0, "AENC: Unable to open %s for input.\n", input_filename)); + mprintf(0, "AENC: Unable to open %s for input.\n", input_filename); return false; } @@ -58,7 +58,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level levels = *input_levels; // Levels (default 7 or for 2k total) levels_set = 1; if (levels < 0 || levels > 16) { - mprintf((0, "AENC: Warning: levels outside of the range 0 to 16\n")); + mprintf(0, "AENC: Warning: levels outside of the range 0 to 16\n"); } } @@ -66,7 +66,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level samples_per_subband = *input_samples; // Samples per subband (default 16 or for 2k total) samples_per_subband_set = 1; if (samples_per_subband < 1 || samples_per_subband > 1024) { - mprintf((0, "AENC: Warning: samples per subband not in the range 1 to 1024\n")); + mprintf(0, "AENC: Warning: samples per subband not in the range 1 to 1024\n"); } } @@ -74,7 +74,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level sample_rate = *input_rate; // Sample rate (default 22K) sample_rate_set = 1; if (sample_rate != 11025 && sample_rate != 22050 && sample_rate != 44100) { - mprintf((0, "AENC: Warning: sample rate not 11025, 22050, or 44100\n")); + mprintf(0, "AENC: Warning: sample rate not 11025, 22050, or 44100\n"); } } @@ -82,7 +82,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level channels = *input_channels; channels_set = 1; if (channels != 1 && channels != 2) { - mprintf((0, "AENC: Warning: /C channels not 1 or 2\n")); + mprintf(0, "AENC: Warning: /C channels not 1 or 2\n"); } } @@ -94,7 +94,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level factor = 1.0f / factor; if (factor <= 0.0f) { - mprintf((0, "AENC: Warning: compression factor <= 0.0\n")); + mprintf(0, "AENC: Warning: compression factor <= 0.0\n"); factor = 1.0f; } } @@ -131,7 +131,7 @@ bool aenc_Compress(char *input_filename, char *output_filename, int *input_level out = fopen(output_filename, "wb"); if (!out) { - mprintf((0, "AENC: Unable to open %s for output.\n", output_filename)); + mprintf(0, "AENC: Unable to open %s for output.\n", output_filename); return false; } diff --git a/Descent3/AIGoal.cpp b/Descent3/AIGoal.cpp index 0e019e4d..4ba2d078 100644 --- a/Descent3/AIGoal.cpp +++ b/Descent3/AIGoal.cpp @@ -490,7 +490,7 @@ void GoalInitWanderAround(object *obj, goal *goal_ptr) { int roomnum; vector pos; - // mprintf((0, "Wander around\n")); + // mprintf(0, "Wander around\n"); goal *cur_goal = GoalGetCurrentGoal(obj); if (cur_goal != goal_ptr) @@ -563,7 +563,7 @@ void GoalClearGoal(object *obj, goal *cur_goal, int reason) { if (obj->ai_info->path.goal_uid == cur_goal->goal_uid) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(&ai_info->path); @@ -612,7 +612,7 @@ void GoalDoFrame(object *obj) { if (ai_info->path.num_paths > 0 && (cur_task_goal == NULL || (cur_task_goal->goal_uid != ai_info->path.goal_uid))) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(&ai_info->path); @@ -667,9 +667,9 @@ void GoalDoFrame(object *obj) { } else if (POSGOAL(cur_goal)) { float dist = vm_VectorDistance(&obj->pos, &cur_goal->g_info.pos); - // mprintf((0, "Dist is %f\n", dist)); - // mprintf((0, "Dist %f, %f, %f\n", XYZ(&cur_goal->g_info.pos))); - // mprintf((0, "Obj %f, %f, %f\n", XYZ(&obj->pos))); + // mprintf(0, "Dist is %f\n", dist); + // mprintf(0, "Dist %f, %f, %f\n", XYZ(&cur_goal->g_info.pos)); + // mprintf(0, "Obj %f, %f, %f\n", XYZ(&obj->pos)); cur_goal->dist_to_goal = dist; AIStatusCircleFrame(obj, NULL, dist, cur_goal->circle_distance, &cur_goal->status_reg); @@ -708,18 +708,19 @@ void GoalDoFrame(object *obj) { if (!(cur_goal->flags & GF_HAS_PATH) || ai_info->path.num_paths == 0) { GoalInitWanderAround(obj, cur_goal); } - /* else if((cur_goal->flags & GF_HAS_PATH) && ai_info->path.num_paths != 0) - { - vector *posp = &cur_goal->g_info.pos; - float dist = vm_VectorDistance(&AIDynamicPath[ai_info->path.num_paths - - 1].pos[ai_info->path.path_end_node[ai_info->path.num_paths - 1]], posp); +/* + else if ((cur_goal->flags & GF_HAS_PATH) && ai_info->path.num_paths != 0) { + vector *posp = &cur_goal->g_info.pos; + float dist = vm_VectorDistance( + &AIDynamicPath[ai_info->path.num_paths - 1].pos[ai_info->path.path_end_node[ai_info->path.num_paths - 1]], + posp); - if(dist > 5.0f) - { - mprintf((0, "In wander path case for obj %d - %s....\n", OBJNUM(obj), - Object_info[obj->id].name)); cur_goal->next_path_time = Gametime - 1.0f; - } - }*/ + if (dist > 5.0f) { + mprintf(0, "In wander path case for obj %d - %s....\n", OBJNUM(obj), Object_info[obj->id].name); + cur_goal->next_path_time = Gametime - 1.0f; + } + } +*/ } if (OBJGOAL(cur_goal)) { @@ -773,7 +774,7 @@ void GoalDoFrame(object *obj) { fq.flags = FQ_CHECK_OBJS | FQ_NO_RELINK | FQ_IGNORE_NON_LIGHTMAP_OBJECTS; if (fvi_FindIntersection(&fq, &hit_info) == HIT_NONE) { - mprintf((0, "AI OBJ Path: No need to update the path for obj %d\n", OBJNUM(obj))); + mprintf(0, "AI OBJ Path: No need to update the path for obj %d\n", OBJNUM(obj)); f_make_path = false; } } @@ -810,7 +811,7 @@ void GoalDoFrame(object *obj) { fq.flags = FQ_CHECK_OBJS | FQ_NO_RELINK | FQ_IGNORE_NON_LIGHTMAP_OBJECTS; if (fvi_FindIntersection(&fq, &hit_info) == HIT_NONE) { - mprintf((0, "AI POS Path: No need to update the path for obj %d\n", OBJNUM(obj))); + mprintf(0, "AI POS Path: No need to update the path for obj %d\n", OBJNUM(obj)); f_make_path = false; } } @@ -879,10 +880,10 @@ int GoalAllocSlot(object *obj, int level, float influence) { ASSERT((level >= 0 && level < NUM_ACTIVATION_LEVELS) || (level == ACTIVATION_BLEND_LEVEL)); if (influence > MAX_INFLUENCE) { - mprintf((0, "Goal added with too much influence -- bashing down\n")); + mprintf(0, "Goal added with too much influence -- bashing down\n"); influence = MAX_INFLUENCE; } else if (influence < 0.0f) { - mprintf((0, "Goal added with negative influence -- bashing to zero\n")); + mprintf(0, "Goal added with negative influence -- bashing to zero\n"); influence = 0.0f; } @@ -890,7 +891,7 @@ int GoalAllocSlot(object *obj, int level, float influence) { cur_slot = level; if (level < 0) { - mprintf((0, "AI: Bashed an invalid activation level to zero\n")); + mprintf(0, "AI: Bashed an invalid activation level to zero\n"); level = 0; } @@ -905,7 +906,7 @@ int GoalAllocSlot(object *obj, int level, float influence) { goal *cur_goal = &ai_info->goals[cur_slot]; if (level != ACTIVATION_BLEND_LEVEL) { - mprintf((0, "AI: Bashed an invalid activation blend level to blend level\n")); + mprintf(0, "AI: Bashed an invalid activation blend level to blend level\n"); level = ACTIVATION_BLEND_LEVEL; } @@ -952,7 +953,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl if (!(goal_type & (AIG_SET_ANIM | AIG_DO_MELEE_ANIM | AIG_FIRE_AT_OBJ))) { goal_index = GoalAllocSlot(obj, level, influence); if (goal_index == AI_INVALID_INDEX) { - // mprintf((0, "WARNING: Object %d has too many goals\n", OBJNUM(obj))); + // mprintf(0, "WARNING: Object %d has too many goals\n", OBJNUM(obj)); return AI_INVALID_INDEX; } @@ -1074,7 +1075,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl case AIG_FIRE_AT_OBJ: { gi_fire *attack_info = (gi_fire *)arg_struct; if (attack_info->cur_wb > MAX_WBS_PER_OBJ) { // DAJ - mprintf((2, "GoalAddGoal wb_index %d > MAX_WBS_PER_OBJ\n", attack_info->cur_wb)); + mprintf(2, "GoalAddGoal wb_index %d > MAX_WBS_PER_OBJ\n", attack_info->cur_wb); return 0; } if ((ai_info->animation_type == AS_ALERT && !(ai_info->next_animation_type == AS_FLINCH)) || @@ -1124,7 +1125,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl char new_anim = *((int *)arg_struct); polyobj_info *p_info = &obj->rtype.pobj_info; - // mprintf((0, "Anim Goal %d\n", new_anim)); + // mprintf(0, "Anim Goal %d\n", new_anim); // Custom animations cannot be overriden if (ai_info->next_animation_type == AS_CUSTOM) { return -1; @@ -1238,7 +1239,7 @@ int GoalAddEnabler(object *obj, int goal_index, uint8_t enabler_type, void *arg_ int enabler_index = ai_info->goals[goal_index].num_enablers; if (ai_info->goals[goal_index].num_enablers >= MAX_ENABLERS_PER_GOAL) { - mprintf((0, "Object %d with goal %d has to many enablers\n", OBJNUM(obj), goal_index)); + mprintf(0, "Object %d with goal %d has to many enablers\n", OBJNUM(obj), goal_index); return AI_INVALID_INDEX; } diff --git a/Descent3/AImain.cpp b/Descent3/AImain.cpp index a86f2955..6f780df9 100644 --- a/Descent3/AImain.cpp +++ b/Descent3/AImain.cpp @@ -2020,15 +2020,14 @@ bool goal_do_avoid_walls(object *obj, vector *mdir) { awall_dir += (scale * fp->normal); - // mprintf((0, "%d\n", facelist[i].face_index)); + // mprintf(0, "%d\n", facelist[i].face_index); if (GameTextures[fp->tmap].flags & (TF_VOLATILE | TF_FORCEFIELD | TF_LAVA)) { if (!(fp->portal_num >= 0 && !(rp->portals[fp->portal_num].flags & PF_RENDER_FACES))) { f_danger = true; } } - // mprintf((0, "Dist %f %f (%d, %d)\n", dist, scale, - // facelist[i].room_index, facelist[i].face_index)); + // mprintf(0, "Dist %f %f (%d, %d)\n", dist, scale, facelist[i].room_index, facelist[i].face_index)); if (dist < closest_dist) { closest_dist = dist; @@ -2069,7 +2068,7 @@ bool goal_do_avoid_walls(object *obj, vector *mdir) { (TF_VOLATILE | TF_FORCEFIELD | TF_LAVA)) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Danger - NEAR FORCEFIELD, VOLATILE, OR LAVA\n")); + mprintf(0, "AI Note: Danger - NEAR FORCEFIELD, VOLATILE, OR LAVA\n"); } #endif f_danger = true; @@ -2106,7 +2105,7 @@ bool goal_do_avoid_walls(object *obj, vector *mdir) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Avoid wall %f\n", scale)); + mprintf(0, "AI Note: Avoid wall %f\n", scale); } #endif @@ -2408,7 +2407,7 @@ bool AiMelee(object *obj) { attack_num = 0; } - // mprintf((0, "Melee attack now!!!!\n")); + // mprintf(0, "Melee attack now!!!!\n"); attack_info.melee_number = attack_num; if (GoalAddGoal(obj, AIG_DO_MELEE_ANIM, (void *)&attack_info, ACTIVATION_BLEND_LEVEL) == 0) @@ -2520,7 +2519,7 @@ void AIUpdateAnim(object *obj) { p_info->anim_flags &= ~AIAF_NOTIFY; if (!(p_info->multi_anim_info.flags & FMA_VALID)) { - mprintf((0, "Update Anim: Earily bail\n")); + mprintf(0, "Update Anim: Earily bail\n"); return; } @@ -2558,7 +2557,7 @@ void AIUpdateAnim(object *obj) { ai_info->next_flinch_time = Gametime + delta_time; } - // mprintf((0, "D %d to %d\n", ai_info->animation_type, ai_info->next_animation_type)); + // mprintf(0, "D %d to %d\n", ai_info->animation_type, ai_info->next_animation_type); // Update the physics and movement class info switch (ai_info->animation_type) { @@ -3049,8 +3048,7 @@ bool AINotify(object *obj, uint8_t notify_type, void *info) { { if (!(Game_mode & GM_MULTI)) { for (i = 0; i < AI_NumRendered; i++) { - // mprintf((0, "I know that I could dodge, if I was aware, says - // robot %d.\n", AI_RenderedList[i])); + // mprintf(0, "I know that I could dodge, if I was aware, says robot %d.\n", AI_RenderedList[i]); if (!BOA_IsVisible(Objects[AI_RenderedList[i]].roomnum, other_obj->roomnum)) continue; @@ -3065,8 +3063,7 @@ bool AINotify(object *obj, uint8_t notify_type, void *info) { if (ai_info->vec_to_target_actual * (*AIDetermineFovVec(&Objects[AI_RenderedList[i]], &fov_vec)) >= Objects[AI_RenderedList[i]].ai_info->fov) { - // mprintf((0, - //"I am fired upon says robot %d\n", AI_RenderedList[i])); + // mprintf(0, "I am fired upon says robot %d\n", AI_RenderedList[i])); if (ai_info->notify_flags & (0x00000001 << notify_type)) { ai_info->memory[0].num_enemy_shots_dodged++; GoalAddGoal(&Objects[AI_RenderedList[i]], AIG_DODGE_OBJ, (void *)&obj->handle, @@ -3086,8 +3083,7 @@ bool AINotify(object *obj, uint8_t notify_type, void *info) { } } else { for (i = 0; i <= Highest_object_index; i++) { - // mprintf((0, "I know that I could dodge, if I was aware, says robot %d.\n", - // AI_RenderedList[i])); + // mprintf(0, "I know that I could dodge, if I was aware, says robot %d.\n", AI_RenderedList[i]); if (Objects[i].control_type != CT_AI || Objects[i].type == OBJ_NONE) continue; @@ -3107,8 +3103,7 @@ bool AINotify(object *obj, uint8_t notify_type, void *info) { AIDetermineFovVec(&Objects[i], &fov_vec); if (to_weapon * fov_vec >= Objects[i].ai_info->fov) { - // mprintf((0, "I am fired upon says robot %d\n", - // AI_RenderedList[i])); + // mprintf(0, "I am fired upon says robot %d\n", AI_RenderedList[i]); if (ai_info->notify_flags & (0x00000001 << notify_type)) { ai_info->memory[0].num_enemy_shots_dodged++; GoalAddGoal(&Objects[i], AIG_DODGE_OBJ, (void *)&obj->handle, ACTIVATION_BLEND_LEVEL, 1.0f, @@ -3269,7 +3264,7 @@ bool AINotify(object *obj, uint8_t notify_type, void *info) { ei.extra_info = info; break; default: - mprintf((0, "Warning, %d has been notified with an unhandled notification %d\n", OBJNUM(obj), notify_type)); + mprintf(0, "Warning, %d has been notified with an unhandled notification %d\n", OBJNUM(obj), notify_type); return true; } @@ -3423,7 +3418,7 @@ start_loop: spc /= scaler; } } - // mprintf((0, "AI ANIM %d %d\n", from, to)); + // mprintf(0, "AI ANIM %d %d\n", from, to); f_looped = (obj->rtype.pobj_info.anim_flags & AIAF_LOOPING) != 0; f_notify = (obj->rtype.pobj_info.anim_flags & AIAF_NOTIFY) != 0; @@ -3445,7 +3440,7 @@ start_loop: ASSERT(from <= to); if (*anim_frame < from || *anim_frame > to) { - mprintf((0, "AI/Animation: Correcting for an incorrect frame number\n")); + mprintf(0, "AI/Animation: Correcting for an incorrect frame number\n"); *anim_frame = from; } @@ -3467,7 +3462,7 @@ start_loop: *anim_frame = to; if (f_notify) { - // mprintf((0, "Animation ended\n")); + // mprintf(0, "Animation ended\n"); AINotify(obj, AIN_ANIM_COMPLETE, NULL); } @@ -3480,7 +3475,7 @@ start_loop: } if (obj->rtype.pobj_info.anim_frame + 0.001 < from || obj->rtype.pobj_info.anim_frame > to) { - mprintf((2, "AI ANIM from %0.6f (%0.6f) to %0.6f\n", from, obj->rtype.pobj_info.anim_frame, to)); + mprintf(2, "AI ANIM from %0.6f (%0.6f) to %0.6f\n", from, obj->rtype.pobj_info.anim_frame, to); } if (obj->rtype.pobj_info.anim_frame < from) { obj->rtype.pobj_info.anim_frame = from; @@ -3576,7 +3571,7 @@ int AIFindRandomRoom(object *obj, ai_frame *ai_info, goal *goal_ptr, int avoid_r } if (!valid) { - mprintf((0, "AI: Wander is generating the same room :(\n")); + mprintf(0, "AI: Wander is generating the same room :(\n"); random_room = obj->roomnum; } } @@ -3599,7 +3594,7 @@ void AIDestroyObj(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(&ai_info->path); @@ -3832,7 +3827,7 @@ void AISetDefault(t_ai_info *ai_info_ptr) {} void AIInitAll() { int i; - mprintf((0, "Initializing AI systems\n")); + mprintf(0, "Initializing AI systems\n"); // Initialize the terrain AI system ait_Init(); @@ -3888,7 +3883,7 @@ void AIInitAll() { } } - mprintf((0, "Done Initializing AI systems\n")); + mprintf(0, "Done Initializing AI systems\n"); } void AICheckTargetVis(object *obj) { @@ -3897,7 +3892,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 1\n")); + mprintf(0, "AI Note: Vis 1\n"); } #endif @@ -3917,7 +3912,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 2\n")); + mprintf(0, "AI Note: Vis 2\n"); } #endif @@ -3928,7 +3923,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 3\n")); + mprintf(0, "AI Note: Vis 3\n"); } #endif @@ -3950,7 +3945,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 4\n")); + mprintf(0, "AI Note: Vis 4\n"); } #endif @@ -3962,7 +3957,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 5\n")); + mprintf(0, "AI Note: Vis 5\n"); } #endif @@ -3974,7 +3969,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 6\n")); + mprintf(0, "AI Note: Vis 6\n"); } #endif @@ -3982,14 +3977,14 @@ void AICheckTargetVis(object *obj) { ai_info->awareness <= AWARE_BARELY && (target->roomnum != obj->roomnum)) || (target->type == OBJ_PLAYER && (Players[target->id].flags & (PLAYER_FLAGS_DEAD | PLAYER_FLAGS_DYING))) || target->type == OBJ_GHOST || !AIDetermineObjVisLevel(obj, target)) { - //. mprintf((0, "No check vis\n")); + //. mprintf(0, "No check vis\n"); ai_info->status_reg &= ~AISR_SEES_GOAL; return; } #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 7\n")); + mprintf(0, "AI Note: Vis 7\n"); } #endif @@ -4040,7 +4035,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis 8\n")); + mprintf(0, "AI Note: Vis 8\n"); } #endif @@ -4053,7 +4048,7 @@ void AICheckTargetVis(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Vis SEE TARGET\n")); + mprintf(0, "AI Note: Vis SEE TARGET\n"); } #endif } @@ -4681,7 +4676,7 @@ void ai_move(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Dodging\n")); + mprintf(0, "AI Note: Dodging\n"); } #endif } @@ -4692,7 +4687,7 @@ void ai_move(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Melee\n")); + mprintf(0, "AI Note: Melee\n"); } #endif } else if (ai_info->goals[i].type == AIG_GET_AROUND_OBJ) { @@ -4721,7 +4716,7 @@ void ai_move(object *obj) { if (AiGoalAvoid(&adir, obj, g_obj, dist)) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Avoiding object\n")); + mprintf(0, "AI Note: Avoiding object\n"); } #endif @@ -4780,7 +4775,7 @@ void ai_move(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Auto avoid friends.\n")); + mprintf(0, "AI Note: Auto avoid friends.\n"); } #endif } @@ -4794,7 +4789,7 @@ void ai_move(object *obj) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: Avoiding walls\n")); + mprintf(0, "AI Note: Avoiding walls\n"); } #endif } @@ -4971,10 +4966,10 @@ void ai_move(object *obj) { AIMoveTowardsPosition(obj, &g_obj->pos, 1.0f, false, &goal_mdir, &goal_f_moved); goal_mset = true; } else { - mprintf((0, "AIG Warning: No obj for GetToObj.\n")); + mprintf(0, "AIG Warning: No obj for GetToObj.\n"); } } else if (cur_goal->type == AIG_FOLLOW_PATH) { - mprintf((0, "AIG Warning: Follow path has no path\n")); + mprintf(0, "AIG Warning: Follow path has no path\n"); } } break; @@ -4988,8 +4983,7 @@ void ai_move(object *obj) { bool f_toward = (subtype & 0x00000001); vector *vec; - // mprintf((0, "Moving relative a type - //%d\n", obj->type)); + // mprintf(0, "Moving relative a type %d\n", obj->type); switch (vec_id) { case GST_FVEC: @@ -5002,7 +4996,7 @@ void ai_move(object *obj) { vec = &goal_obj->orient.uvec; break; default: - mprintf((0, "Invalid vec in AIG_MOVE_RELATIVE_OBJ_VEC bashing to fvec\n")); + mprintf(0, "Invalid vec in AIG_MOVE_RELATIVE_OBJ_VEC bashing to fvec\n"); cur_goal->subtype = GST_FVEC | (int)f_toward; vec_id = GST_FVEC; } @@ -5145,7 +5139,7 @@ void ai_move(object *obj) { } break; default: { - mprintf((0, "AI ERROR: Object %d trying a non-implemented goal\n", OBJNUM(obj))); + mprintf(0, "AI ERROR: Object %d trying a non-implemented goal\n", OBJNUM(obj)); AIMoveTowardsPosition(obj, &ai_info->last_see_target_pos, 1.0f, true, &goal_mdir, &goal_f_moved); goal_mset = true; } @@ -5213,7 +5207,7 @@ void ai_fire(object *obj) { object_info *obj_info = &Object_info[obj->id]; bool f_turret_next_move_still; - //. mprintf((0, "Aiming\n")); + //. mprintf(0, "Aiming\n"); if (!(ai_info->flags & AIF_FIRE)) { if (ai_info->status_reg & AISR_RANGED_ATTACK) { for (i = 0; i < pm->num_wbs; i++) { @@ -5346,8 +5340,7 @@ void ai_fire(object *obj) { WeaponCalcGun(&gun_point[WB_MOVE_LEFT], &gun_normal[WB_MOVE_LEFT], obj, pm->poly_wb[i].gp_index[aiming_gp_index]); - // mprintf((0, "Weapon %f, %f, %f and normal %f, %f, %f\n", XYZ(&gun_point), - // XYZ(&gun_normal))); + // mprintf(0, "Weapon %f, %f, %f and normal %f, %f, %f\n", XYZ(&gun_point), XYZ(&gun_normal)); target_dir[WB_MOVE_STILL] = ai_info->last_see_target_pos - gun_point[WB_MOVE_STILL]; target_dir[WB_MOVE_RIGHT] = ai_info->last_see_target_pos - gun_point[WB_MOVE_RIGHT]; @@ -5594,7 +5587,7 @@ static inline void ai_decrease_awareness(object *obj) { if (ai_info->awareness == AWARE_NONE && !(ai_info->flags & AIF_PERSISTANT)) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(&ai_info->path); @@ -5611,7 +5604,7 @@ static inline void ai_decrease_awareness(object *obj) { ai_info->awareness = AWARE_NONE; } - // mprintf((0, "Awareness %f", ai_info->awareness)); + // mprintf(0, "Awareness %f", ai_info->awareness); } static inline bool ai_do_script_stuff(object *obj) { @@ -6019,7 +6012,7 @@ void AIDoFreud(object *obj) { GoalAddGoal(obj, AIG_WANDER_AROUND, NULL, 3, 2.0f, GF_SPEED_FLEE | GF_ORIENT_VELOCITY | GF_NONFLUSHABLE); GoalAddEnabler(obj, 3, AIE_CLEAR_TIME, (void *)&time, 1.0, 0.0); - mprintf((0, "Fear!!!!\n")); + mprintf(0, "Fear!!!!\n"); return; } @@ -6033,7 +6026,7 @@ void AIDoFreud(object *obj) { GoalAddGoal(obj, AIG_WANDER_AROUND, NULL, 3, 2.0f, GF_SPEED_FLEE | GF_ORIENT_VELOCITY | GF_NONFLUSHABLE); GoalAddEnabler(obj, 3, AIE_CLEAR_TIME, (void *)&time, 1.0, 0.0); - mprintf((0, "Fear!!!!\n")); + mprintf(0, "Fear!!!!\n"); return; } @@ -6045,7 +6038,7 @@ void AIDoFreud(object *obj) { GoalAddGoal(obj, AIG_WANDER_AROUND, NULL, 3, 2.0f, GF_SPEED_FLEE | GF_ORIENT_VELOCITY | GF_NONFLUSHABLE); GoalAddEnabler(obj, 3, AIE_CLEAR_TIME, (void *)&time, 1.0, 0.0); - mprintf((0, "Fear!!!!\n")); + mprintf(0, "Fear!!!!\n"); return; } } @@ -6136,7 +6129,7 @@ void AIDoFrame(object *obj) { DebugBlockPrint("A "); - // mprintf((0, "Awareness = %d\n", ai_info->awareness)); + // mprintf(0, "Awareness = %d\n", ai_info->awareness); if ((ai_info->flags & AIF_DISABLED) || (obj->type == OBJ_DUMMY)) { DebugBlockPrint("DA"); diff --git a/Descent3/BOA.cpp b/Descent3/BOA.cpp index a7951dd1..9f0ce564 100644 --- a/Descent3/BOA.cpp +++ b/Descent3/BOA.cpp @@ -932,7 +932,7 @@ void FindPath(int i, int j) { q_item *node_list[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS]; - // mprintf((0, "Find path for %d to %d\n", i, j)); + // mprintf(0, "Find path for %d to %d\n", i, j); if (i == -1 || j == -1) { delete start_node; @@ -1079,7 +1079,7 @@ void FindPath(int i, int j) { // Mark as an impossible path. BOA_Array[i][j] = BOA_NO_PATH; - // mprintf((0, "Found an impossible path\n")); + // mprintf(0, "Found an impossible path\n"); done: for (counter = 0; counter <= Highest_room_index + MAX_BOA_TERRAIN_REGIONS; counter++) { @@ -1246,7 +1246,7 @@ int BOAGetMineChecksum() { total += BOA_VERSION << 24; - mprintf((0, "Computed Checksum is %d\n", (int)total)); + mprintf(0, "Computed Checksum is %d\n", (int)total); return total; } @@ -1357,7 +1357,7 @@ void ValidateRoomPathPoint(int room, char *message, int len) { } if (!message) - mprintf((0, "Room %d has a bad center point\n", room)); + mprintf(0, "Room %d has a bad center point\n", room); else { char new_message[300]; snprintf(new_message, sizeof(new_message), "Room %d has a bad center point\n", room); @@ -1585,7 +1585,7 @@ void MakeBOAVisTable(bool from_lighting) { // Now compute all room to room visibility stuff int i, t, j; - mprintf((0, "Computing visibility for %d rooms.\n", Highest_room_index)); + mprintf(0, "Computing visibility for %d rooms.\n", Highest_room_index); for (i = 0; i <= Highest_room_index + MAX_BOA_TERRAIN_REGIONS; i++) { for (t = 0; t <= Highest_room_index + MAX_BOA_TERRAIN_REGIONS; t++) { @@ -1609,7 +1609,7 @@ void MakeBOAVisTable(bool from_lighting) { #ifdef NEWEDITOR DoBOAVisProgressDialog((float)(i + 1) / (float)(Highest_room_index + 1), 1); #endif - mprintf_at((2, 4, 0, "Room=%d ", i)); + mprintf_at(2, 4, 0, "Room=%d ", i); if (rp->flags & RF_EXTERNAL) continue; @@ -1966,7 +1966,7 @@ void find_small_portals() { } } - mprintf((0, " Found %d small portals... :)\n", counter)); + mprintf(0, " Found %d small portals... :)\n", counter); } void compute_robot_path_info() { @@ -2038,46 +2038,46 @@ void MakeBOA(void) { BOA_mine_checksum = cur_check; BOA_f_making_boa = true; - mprintf((0, "Making BOA and friends\n")); + mprintf(0, "Making BOA and friends\n"); - mprintf((0, "Finding small portals\n")); + mprintf(0, "Finding small portals\n"); find_small_portals(); - mprintf((0, "Done Finding small portals\n")); + mprintf(0, "Done Finding small portals\n"); - mprintf((0, " Start computing path points.\n")); + mprintf(0, " Start computing path points.\n"); BOA_ComputePathPoints(); - mprintf((0, " Done computing path points.\n")); + mprintf(0, " Done computing path points.\n"); clear_BOA(); compute_costs(); - mprintf((0, " Start computing mines.\n")); + mprintf(0, " Start computing mines.\n"); compute_mine_info(); - mprintf((0, " Done computing %d mines.\n", BOA_num_mines)); + mprintf(0, " Done computing %d mines.\n", BOA_num_mines); - mprintf((0, " Start computing terrain regions.\n")); + mprintf(0, " Start computing terrain regions.\n"); compute_terrain_region_info(); - mprintf((0, " Done computing %d terrain regions.\n", BOA_num_terrain_regions)); + mprintf(0, " Done computing %d terrain regions.\n", BOA_num_terrain_regions); - mprintf((0, " Making designers wait for no particular reason...\n")); + mprintf(0, " Making designers wait for no particular reason...\n"); compute_next_segs(); - mprintf((0, " Done with the sodomy...\n")); + mprintf(0, " Done with the sodomy...\n"); - mprintf((0, " Start computing blockage info.\n")); + mprintf(0, " Start computing blockage info.\n"); compute_blockage_info(); - mprintf((0, " Done computing blockage info.\n")); + mprintf(0, " Done computing blockage info.\n"); - mprintf((0, " Start computing sound prop.\n")); + mprintf(0, " Start computing sound prop.\n"); compute_sound_dist_info(); - mprintf((0, " Done computing sound prop.\n")); + mprintf(0, " Done computing sound prop.\n"); - mprintf((0, " Start computing invalid robot path info.\n")); + mprintf(0, " Start computing invalid robot path info.\n"); compute_robot_path_info(); - mprintf((0, " Done computing invalid robot path info.\n")); + mprintf(0, " Done computing invalid robot path info.\n"); - mprintf((0, " Verifying connections\n")); + mprintf(0, " Verifying connections\n"); verify_connections(); - mprintf((0, " Done with verification\n")); + mprintf(0, " Done with verification\n"); // { // int cur_seg = 0; @@ -2095,7 +2095,7 @@ void MakeBOA(void) { // } BOA_f_making_boa = false; - mprintf((0, "BOA is done\n")); + mprintf(0, "BOA is done\n"); } static int Current_sort_room; @@ -2127,13 +2127,13 @@ void ComputeAABB(bool f_full) { int computed_room_check[MAX_ROOMS]; - mprintf((0, "Computing AABB's")); + mprintf(0, "Computing AABB's"); // Determines the room and face min/max information int cur_check = BOAGetMineChecksum(); if (cur_check == BOA_AABB_checksum && !f_full) { - mprintf((0, " (partial)!\n")); + mprintf(0, " (partial)!\n"); } else { for (i = 0; i < MAX_ROOMS; i++) { if (Rooms[i].used) { @@ -2160,7 +2160,7 @@ void ComputeAABB(bool f_full) { int16_t count; BOA_AABB_checksum = cur_check; - mprintf((0, " (full)!\n")); + mprintf(0, " (full)!\n"); for (i = 0; i <= Highest_room_index; i++) { Current_sort_room = i; @@ -2306,7 +2306,7 @@ void ComputeAABB(bool f_full) { ASSERT(num_struct < MAX_REGIONS_PER_ROOM); // get chris num_structs_per_room[i] = num_struct; - // mprintf((0, "%d structs in r %d\n", num_struct, i)); + // mprintf(0, "%d structs in r %d\n", num_struct, i); } } @@ -2373,7 +2373,7 @@ void ComputeAABB(bool f_full) { } } - // mprintf((0, "Room %d Best Shell is %d\n", i, best)); + // mprintf(0, "Room %d Best Shell is %d\n", i, best); if (best != 0) { for (count = 0; count < rp->num_faces; count++) { if (r_struct_list[i][count] == 0) { @@ -2694,15 +2694,15 @@ void ComputeAABB(bool f_full) { // Remove unneccessary groups for (count = 0; count <= Highest_room_index; count++) { if (Rooms[count].used) { - // mprintf((0, "==================\n", count)); - // mprintf((0, "Room %d\n", count)); + // mprintf(0, "==================\n", count); + // mprintf(0, "Room %d\n", count); if (BOA_AABB_ROOM_checksum[count] != 0 && BOA_AABB_ROOM_checksum[count] == computed_room_check[count]) continue; room *rp = &Rooms[count]; for (i = 0; i < rp->num_bbf_regions; i++) { - // mprintf((0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i])); + // mprintf(0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i]); if (rp->num_bbf[i] == 0) { for (j = i + 1; j < rp->num_bbf_regions; j++) { @@ -2764,11 +2764,9 @@ void ComputeAABB(bool f_full) { } int diff[3]; - // mprintf((0, "Split plane results r %d s %d n %d\n", i, j, - // rp->num_bbf[j])); + // mprintf(0, "Split plane results r %d s %d n %d\n", i, j, rp->num_bbf[j]); for (sp = 0; sp < 3; sp++) { - // mprintf((0, "%d %d %d\n", num_faces[sp][0], - // num_faces[sp][1], num_faces[sp][2])); + // mprintf(0, "%d %d %d\n", num_faces[sp][0], num_faces[sp][1], num_faces[sp][2]); if (abs(num_faces[sp][0] - num_faces[sp][1]) > abs(num_faces[sp][1] - num_faces[sp][2])) diff[sp] = abs(num_faces[sp][0] - num_faces[sp][1]); @@ -2786,7 +2784,7 @@ void ComputeAABB(bool f_full) { } } - // mprintf((0, "Split Plane is %d\n", best)); + // mprintf(0, "Split Plane is %d\n", best); if (rp->num_bbf_regions <= MAX_REGIONS_PER_ROOM - 2) { rp->num_bbf[rp->num_bbf_regions] = 0; @@ -2830,14 +2828,14 @@ void ComputeAABB(bool f_full) { // Remove unneccessary groups for (count = 0; count <= Highest_room_index; count++) { if (Rooms[count].used) { - // mprintf((0, "==================\n", count)); - // mprintf((0, "Room %d\n", count)); + // mprintf(0, "==================\n", count); + // mprintf(0, "Room %d\n", count); if (BOA_AABB_ROOM_checksum[count] != 0 && BOA_AABB_ROOM_checksum[count] == computed_room_check[count]) continue; room *rp = &Rooms[count]; for (i = 0; i < rp->num_bbf_regions; i++) { - // mprintf((0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i])); + // mprintf(0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i]); if (rp->num_bbf[i] == 0) { for (j = i + 1; j < rp->num_bbf_regions; j++) { @@ -2980,13 +2978,13 @@ void ComputeAABB(bool f_full) { // { // if(Rooms[count].used) // { - // mprintf((0, "==================\n", count)); - // mprintf((0, "Room %d\n", count)); + // mprintf(0, "==================\n", count); + // mprintf(0, "Room %d\n", count); // // room *rp = &Rooms[count]; // for(i = 0; i < rp->num_bbf_regions; i++) // { - // mprintf((0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i])); + // mprintf(0, "Region %d has %d faces in it.\n", i, rp->num_bbf[i]); // } // } // } @@ -3044,5 +3042,5 @@ void ComputeAABB(bool f_full) { } } - mprintf((0, "Done Computing AABB's.\n")); + mprintf(0, "Done Computing AABB's.\n"); } diff --git a/Descent3/Briefing.cpp b/Descent3/Briefing.cpp index 70ea62bf..aa705cb3 100644 --- a/Descent3/Briefing.cpp +++ b/Descent3/Briefing.cpp @@ -352,7 +352,7 @@ bool ParseForHotTags(const char *src, char **dest) { if (!strnicmp(curr_ptr, HotTags[i].name, HotTags[i].length)) { // this is a hot tag!!!!! - mprintf((0, "Found Embedded HotTag: %s\n", HotTags[i].name)); + mprintf(0, "Found Embedded HotTag: %s\n", HotTags[i].name); is_hot_tag = i; ret = true; break; @@ -481,7 +481,7 @@ void PBAddMovieEffect(LPTCMOVIEDESC desc, const char *description) { void PBAddBkgEffect(LPTCBKGDESC desc, const char *description) { if (IsMissionMaskOK(desc->mission_mask_set, desc->mission_mask_unset) && ok_to_parse_screen) { - mprintf((0, "PB: Add Bkg\n")); + mprintf(0, "PB: Add Bkg\n"); } } diff --git a/Descent3/BriefingParse.cpp b/Descent3/BriefingParse.cpp index aae106ce..8db3f1d3 100644 --- a/Descent3/BriefingParse.cpp +++ b/Descent3/BriefingParse.cpp @@ -323,7 +323,7 @@ int CBriefParse::ParseBriefing(const char *filename) { strcpy(title, " "); - mprintf((0, "Parsing <%s>\n", filename)); + mprintf(0, "Parsing <%s>\n", filename); // Open the file ifile = cfopen(filename, "rt"); @@ -822,12 +822,12 @@ int CBriefParse::ParseBriefing(const char *filename) { done_parsing:; if (abort) { - mprintf((0, "Parse aborted\n")); + mprintf(0, "Parse aborted\n"); } else if (!parse_error) { if (reading_text) { ParseError("Missing '$endtext'"); } else { - mprintf((0, "Parse sucessful\n")); + mprintf(0, "Parse sucessful\n"); } } @@ -1185,9 +1185,9 @@ done_parsing: // Generates an parsing error void CBriefParse::ParseError(const char *msg, const char *p) { - mprintf((0, "ERROR, line %d: %s\n", linenum, msg)); + mprintf(0, "ERROR, line %d: %s\n", linenum, msg); if (p) { - mprintf((0, " %s\n", p)); + mprintf(0, " %s\n", p); } parse_error = 1; diff --git a/Descent3/ConfigItem.cpp b/Descent3/ConfigItem.cpp index ca7d1165..4c900dc5 100644 --- a/Descent3/ConfigItem.cpp +++ b/Descent3/ConfigItem.cpp @@ -166,7 +166,7 @@ bool ConfigItem::Create(NewUIGameWindow *parentwnd, int type, int flags, int x, m_iType = type; break; default: - mprintf((0, "Bad config item type in Create\n")); + mprintf(0, "Bad config item type in Create\n"); return false; } if (!label) @@ -177,7 +177,7 @@ bool ConfigItem::Create(NewUIGameWindow *parentwnd, int type, int flags, int x, if ((m_iFlags & CIF_USEGROUP) && (type != CIT_RADIOBUTTON)) { // only radiobutton items support the CIF_USEGROUP - mprintf((0, "CONFIGITEM: Only CIT_RADIOBUTTON supports CIF_USEGROUP flag\n")); + mprintf(0, "CONFIGITEM: Only CIT_RADIOBUTTON supports CIF_USEGROUP flag\n"); m_iFlags &= ~CIF_USEGROUP; Int3(); } @@ -558,7 +558,7 @@ void ConfigItem::Update(int result) { UpdateCheckBox(index); break; default: - mprintf((0, "Bad ConfigItem Type in Update\n")); + mprintf(0, "Bad ConfigItem Type in Update\n"); } } @@ -1012,7 +1012,7 @@ void ConfigItem::Add(int count, ...) { m_rbList[m_iInitial]->Activate(); break; default: - mprintf((0, "Bad ConfigItem Type in Add\n")); + mprintf(0, "Bad ConfigItem Type in Add\n"); } va_end(marker); } diff --git a/Descent3/Controls.cpp b/Descent3/Controls.cpp index f7499042..7e97aebd 100644 --- a/Descent3/Controls.cpp +++ b/Descent3/Controls.cpp @@ -620,7 +620,7 @@ void InitControls() { Key_ramp.oz = Key_ramp.z = 0.0f; // Initialize preemptive controller system for non-positonal data. - mprintf((0, "Initialized control system.\n")); + mprintf(0, "Initialized control system.\n"); } void CloseControls() { @@ -629,7 +629,7 @@ void CloseControls() { ResumeControls(); DestroyController(Controller); Controller = NULL; - mprintf((0, "Closing control system.\n")); + mprintf(0, "Closing control system.\n"); Control_system_init = false; } @@ -806,10 +806,10 @@ void DoMovement(game_controls *controls) { if (controls->afterburn_thrust < -LIMIT_FORWARD) controls->afterburn_thrust = -LIMIT_FORWARD; - mprintf_at((1, 5, 30, "ch:%.2f ", controls->heading_thrust)); + mprintf_at(1, 5, 30, "ch:%.2f ", controls->heading_thrust); // if (controls->pitch_thrust || controls->heading_thrust) - // mprintf((0, "p:%.2f h:%.2f\n", controls->pitch_thrust, controls->heading_thrust)); + // mprintf(0, "p:%.2f h:%.2f\n", controls->pitch_thrust, controls->heading_thrust); } void DoKeyboardMovement(game_controls *controls) { @@ -911,10 +911,9 @@ void DoControllerMovement(game_controls *controls) { Controller->get_packet(ctfBANK_LEFTBUTTON, &ctl_blb); Controller->get_packet(ctfBANK_RIGHTBUTTON, &ctl_brb); - // check for joystick movement - // mprintf((0, "p:%f h:%f b:%f\n", ctl_p.value, ctl_h.value, ctl_b.value)); - // mprintf((0, "u:%d d:%d l:%d r:%d\n", (int)ctl_povu.value, (int)ctl_povd.value, (int)ctl_povl.value, - //(int)ctl_povr.value)); + // check for joystick movement + // mprintf(0, "p:%f h:%f b:%f\n", ctl_p.value, ctl_h.value, ctl_b.value); + // mprintf(0, "u:%d d:%d l:%d r:%d\n", (int)ctl_povu.value, (int)ctl_povd.value, (int)ctl_povl.value, (int)ctl_povr.value); // do x and y thrust controls->sideways_thrust += ctl_x.value; @@ -948,7 +947,7 @@ void DoControllerMovement(game_controls *controls) { // do afterburn button control if (!controls->afterburn_thrust) { - // mprintf((0, "aft=%.4f\n", ctl_afterburn.value)); + // mprintf(0, "aft=%.4f\n", ctl_afterburn.value); controls->afterburn_thrust = ((ctl_afterburn.value) / Frametime); } diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index fb1675f4..1a69f607 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -970,10 +970,10 @@ int cfg_element_ui::DoUI() { m_element = GCV_VALUE(ccfgdata); m_controller = GCV_CONTROLLER(ccfgdata); catch_press = true; - // mprintf((0, "HERE?\n")); + // mprintf(0, "HERE?\n"); } else if (catch_press) { quit = true; - // mprintf((0, "THERE?\n")); + // mprintf(0, "THERE?\n"); } break; } diff --git a/Descent3/D3ForceFeedback.cpp b/Descent3/D3ForceFeedback.cpp index 1d86719b..05b43149 100644 --- a/Descent3/D3ForceFeedback.cpp +++ b/Descent3/D3ForceFeedback.cpp @@ -142,12 +142,12 @@ void ForceInit(void) { D3Force_init = true; D3Force_pause = false; - mprintf((0, "Force: High Level Force Feedback system initialized\n")); + mprintf(0, "Force: High Level Force Feedback system initialized\n"); } else { D3Force_init = false; D3Force_pause = false; - mprintf((0, "Force: Force Feedback System Not Found\n")); + mprintf(0, "Force: Force Feedback System Not Found\n"); } for (int i = 0; i < DDIO_FF_MAXEFFECTS; i++) { @@ -194,7 +194,7 @@ void ForceClose(void) { D3Force_pause = false; D3Force_init = false; - mprintf((0, "Force: Shutting down high level force feedback\n")); + mprintf(0, "Force: Shutting down high level force feedback\n"); ForceEffectsClose(); for (int i = 0; i < DDIO_FF_MAXEFFECTS; i++) { @@ -213,7 +213,7 @@ void ForceShutdown(void) { ForceClose(); if (D3Force_init) { - mprintf((0, "Force: Shutting down Force Feedback System\n")); + mprintf(0, "Force: Shutting down Force Feedback System\n"); ddio_ffb_Pause(kJoy1); } } @@ -228,7 +228,7 @@ void ForceRestart(void) { D3Force_pause = false; if (D3Force_init) { - mprintf((0, "Force: Restarting Force Feedback System\n")); + mprintf(0, "Force: Restarting Force Feedback System\n"); ddio_ff_Acquire(kJoy1); ddio_ffb_Continue(kJoy1); @@ -261,7 +261,7 @@ void ForceRestart(void) { // ------------------------------------------------------------------ void ForceDisable(void) { if (D3Force_init) { - mprintf((0, "Force: Disabling Force Feedback System\n")); + mprintf(0, "Force: Disabling Force Feedback System\n"); //@@ddio_ffb_Disable(kJoy1); D3Use_force_feedback = false; } @@ -274,7 +274,7 @@ void ForceDisable(void) { // ------------------------------------------------------------------ void ForceEnable(void) { if (D3Force_init) { - mprintf((0, "Force: Enabling Force Feedback System\n")); + mprintf(0, "Force: Enabling Force Feedback System\n"); //@@ddio_ffb_Enable(kJoy1); D3Use_force_feedback = true; } diff --git a/Descent3/DllWrappers.cpp b/Descent3/DllWrappers.cpp index 392ec542..b96cc515 100644 --- a/Descent3/DllWrappers.cpp +++ b/Descent3/DllWrappers.cpp @@ -123,7 +123,7 @@ void SetObjectDeadFlagDLL(object *obj, bool tell_clients_to_remove, bool tell_cl void assertdll(int x, const char *expression, const char *file, int line) { #ifndef RELEASE if (!(unsigned)(x)) { - mprintf((0, "Assertion failed (%s) in %s line %d.\n", expression, file, line)); + mprintf(0, "Assertion failed (%s) in %s line %d.\n", expression, file, line); if (Debug_break) DEBUG_BREAK(); else diff --git a/Descent3/Game2DLL.cpp b/Descent3/Game2DLL.cpp index 754c1f94..568eb7cb 100644 --- a/Descent3/Game2DLL.cpp +++ b/Descent3/Game2DLL.cpp @@ -570,7 +570,7 @@ void CloseGameModule(module *mod) { if (Multi_game_dll_name[0] != '\0') { // Try deleting the file now! if (!ddio_DeleteFile(Multi_game_dll_name)) { - mprintf((0, "Couldn't delete the tmp dll")); + mprintf(0, "Couldn't delete the tmp dll"); } } mod->handle = NULL; @@ -603,7 +603,7 @@ bool InitGameModule(const char *name, module *mod) { } // Copy the DLL if (!cf_CopyFile(tmp_dll_name, dll_name)) { - mprintf((0, "DLL copy failed!\n")); + mprintf(0, "DLL copy failed!\n"); return false; } strcpy(Multi_game_dll_name, tmp_dll_name); @@ -612,7 +612,7 @@ loaddll: mod_GetLastError(); if (!mod_LoadModule(mod, tmp_dll_name)) { int err = mod_GetLastError(); - mprintf((0, "You are missing the DLL %s!\n", name)); + mprintf(0, "You are missing the DLL %s!\n", name); return false; } return true; @@ -651,7 +651,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { num_teams_to_use = 1; } } - mprintf((0, "Loading '%s', setting up for %d teams\n", name, num_teams_to_use)); + mprintf(0, "Loading '%s', setting up for %d teams\n", name, num_teams_to_use); if (!InitGameModule(name, &GameDLLHandle)) return 0; @@ -660,7 +660,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { DLLGameInit = (DLLGameInit_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameInit", 12); if (!DLLGameInit) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLGameInit!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLGameInit!\n"); Int3(); FreeGameDLL(); return 0; @@ -670,7 +670,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { DLLGameCall = (DLLGameCall_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameCall", 8); if (!DLLGameCall) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLGameCall!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLGameCall!\n"); Int3(); FreeGameDLL(); return 0; @@ -680,7 +680,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { DLLGameClose = (DLLGameClose_fp)mod_GetSymbol(&GameDLLHandle, "DLLGameClose", 0); if (!DLLGameClose) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLGameClose!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLGameClose!\n"); Int3(); FreeGameDLL(); return 0; @@ -690,7 +690,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { DLLGetGameInfo = (DLLGetGameInfo_fp)mod_GetSymbol(&GameDLLHandle, "DLLGetGameInfo", 4); if (!DLLGetGameInfo) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLGetGameInfo!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLGetGameInfo!\n"); Int3(); FreeGameDLL(); return 0; @@ -709,7 +709,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { DLLGameInit((int *)api_fp, &ok, num_teams_to_use); if (!ok) { // The DLL said no to the load - mprintf((0, "DLLGameInit returned false, couldn't init DLL\n")); + mprintf(0, "DLLGameInit returned false, couldn't init DLL\n"); Int3(); FreeGameDLL(); return 0; @@ -721,10 +721,10 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { // If this function is called than the DLL is to be closed, because there was an error running it // if reason is not NULL than that is the reason why void DLLFatalError(const char *reason) { - mprintf((0, "============================\n")); - mprintf((0, "= DLL Fatal Error =\n")); - mprintf((0, "============================\n")); - mprintf((0, "%s\n", (reason) ? reason : "")); + mprintf(0, "============================\n"); + mprintf(0, "= DLL Fatal Error =\n"); + mprintf(0, "============================\n"); + mprintf(0, "%s\n", (reason) ? reason : ""); Netgame.flags |= NF_EXIT_NOW; Int3(); } @@ -776,7 +776,7 @@ bool GetDLLGameInfo(const char *name, tDLLOptions *options) { modGetGameInfo = (DLLGetGameInfo_fp)mod_GetSymbol(&mod, "DLLGetGameInfo", 4); if (!modGetGameInfo) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLGetGameInfo!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLGetGameInfo!\n"); Int3(); CloseGameModule(&mod); return false; @@ -792,7 +792,7 @@ int GetDLLRequirements(const char *name, char *requirements, int buflen) { ASSERT(requirements); tDLLOptions opt; if (!GetDLLGameInfo(name, &opt)) { - mprintf((0, "Unable to get %s's requirements\n", name)); + mprintf(0, "Unable to get %s's requirements\n", name); return -1; } strncpy(requirements, opt.requirements, buflen - 1); @@ -800,7 +800,7 @@ int GetDLLRequirements(const char *name, char *requirements, int buflen) { uint32_t opt_req_len = strlen(opt.requirements); if (opt_req_len > strlen(requirements)) { // too small of a buffer! - mprintf((0, "Too small of a buffer to fill in all requirements!...need %d\n", opt_req_len + 1)); + mprintf(0, "Too small of a buffer to fill in all requirements!...need %d\n", opt_req_len + 1); Int3(); // cut off last requirement (which is shortened) char *p = strrchr(requirements, ','); diff --git a/Descent3/GameLoop.cpp b/Descent3/GameLoop.cpp index 68220389..cd6676e0 100644 --- a/Descent3/GameLoop.cpp +++ b/Descent3/GameLoop.cpp @@ -1136,12 +1136,12 @@ void ProcessButtons() { PollControls(); if (Controller->get_joy_raw_values(&x, &y) || Controller->get_mouse_raw_values(&x, &y)) { // death. - mprintf((0, "here?")); + mprintf(0, "here?"); if (Total_time_dead < DEATH_RESPAWN_TIME) return; - mprintf((0, "Respawning joystick death. Death time=%f\n", Total_time_dead)); + mprintf(0, "Respawning joystick death. Death time=%f\n", Total_time_dead); if (Game_mode & GM_MULTI) MultiSendEndPlayerDeath(); // couldn't this be called from withing EndPlayerDeath()? @@ -1178,7 +1178,7 @@ void ProcessGuidebotKeys(int key) { object *buddy = ObjGet(Buddy_handle[Player_num]); if (!buddy || buddy->type != OBJ_ROBOT) { // not out of the ship - mprintf((0, "Guidebot: mrmph mmrump..mrmph...LET ME OUT OF YOUR SHIP!\n")); + mprintf(0, "Guidebot: mrmph mmrump..mrmph...LET ME OUT OF YOUR SHIP!\n"); return; } int command_id = -1; @@ -1321,7 +1321,7 @@ void ProcessNormalKey(int key) { if (Game_mode & GM_MULTI) { char str[80]; - mprintf((0, "Printing message %d!\n", index)); + mprintf(0, "Printing message %d!\n", index); int save_do = Doing_input_message; int save_len = HudInputMessageLen; @@ -1347,7 +1347,7 @@ void ProcessNormalKey(int key) { case KEY_PRINT_SCREEN: case KEY_SHIFTED + KEY_PRINT_SCREEN: - mprintf((0, "Doing screenshot!\n")); + mprintf(0, "Doing screenshot!\n"); DoScreenshot(); return; @@ -1688,7 +1688,7 @@ void ProcessTestKeys(int key) { /*case KEY_G: { char dmb_msg[100]; - mprintf((0,"Current Gametime is %f\n",Gametime)); + mprintf(0,"Current Gametime is %f\n",Gametime); snprintf(dmb_msg,sizeof(dmb_msg),"Current Gametime is %f\n",Gametime); AddHUDMessage(dmb_msg); } @@ -1960,7 +1960,7 @@ void ProcessTestKeys(int key) { for (i = 0; i < MAX_OBJECTS; i++) { if (Objects[i].type == OBJ_DUMMY && Objects[i].dummy_type == OBJ_POWERUP && Objects[i].id == id) { // here's a betty - mprintf((0, "Killing a betty\n")); + mprintf(0, "Killing a betty\n"); SetObjectDeadFlag(&Objects[i], true); } } @@ -1976,64 +1976,64 @@ void ProcessTestKeys(int key) { Game_update_attach = 1 - Game_update_attach; if (Game_update_attach) { - mprintf((0, "Update attach on\n")); + mprintf(0, "Update attach on\n"); } else { - mprintf((0, "Update attach off\n")); + mprintf(0, "Update attach off\n"); } } break; case KEY_PAD1: { Game_do_flying_sim = 1 - Game_do_flying_sim; if (Game_do_flying_sim) { - mprintf((0, "Game_do_flying_sim on\n")); + mprintf(0, "Game_do_flying_sim on\n"); } else { - mprintf((0, "Game_do_flying_sim off\n")); + mprintf(0, "Game_do_flying_sim off\n"); } } break; case KEY_PAD2: { Game_do_walking_sim = 1 - Game_do_walking_sim; if (Game_do_walking_sim) { - mprintf((0, "Game_do_walking_sim on\n")); + mprintf(0, "Game_do_walking_sim on\n"); } else { - mprintf((0, "Game_do_walking_sim off\n")); + mprintf(0, "Game_do_walking_sim off\n"); } } break; case KEY_PAD3: { Game_do_vis_sim = 1 - Game_do_vis_sim; if (Game_do_vis_sim) { - mprintf((0, "Game_do_vis_sim on\n")); + mprintf(0, "Game_do_vis_sim on\n"); } else { - mprintf((0, "Game_do_vis_sim off\n")); + mprintf(0, "Game_do_vis_sim off\n"); } } break; case KEY_PAD4: { Game_do_ai_movement = 1 - Game_do_ai_movement; if (Game_do_ai_movement) { - mprintf((0, "Game_do_ai_movement on\n")); + mprintf(0, "Game_do_ai_movement on\n"); } else { - mprintf((0, "Game_do_ai_movement off\n")); + mprintf(0, "Game_do_ai_movement off\n"); } } break; case KEY_PAD5: { Game_do_ai_vis = 1 - Game_do_ai_vis; if (Game_do_ai_vis) { - mprintf((0, "Game_do_ai_vis on\n")); + mprintf(0, "Game_do_ai_vis on\n"); } else { - mprintf((0, "Game_do_ai_vis off\n")); + mprintf(0, "Game_do_ai_vis off\n"); } } break; case KEY_PAD6: { if (AI_debug_robot_do) { AI_debug_robot_do = false; - mprintf((0, "AI Debug Info Off\n")); + mprintf(0, "AI Debug Info Off\n"); } else { AI_debug_robot_do = true; - mprintf((0, "AI Debug Info On\n")); + mprintf(0, "AI Debug Info On\n"); } } break; @@ -2066,7 +2066,7 @@ void ProcessTestKeys(int key) { if (!killed_something) AddHUDMessage("Nothing to kill!"); else - mprintf((0, "Killed %d objects of type %s!\n", killed_count, Object_info[Objects[i].id].name)); + mprintf(0, "Killed %d objects of type %s!\n", killed_count, Object_info[Objects[i].id].name); } break; /* ************************************************** @@ -2176,25 +2176,25 @@ void ProcessTestKeys(int key) { switch (fate) { case HIT_NONE: - mprintf((0, "Hit nothing\n")); + mprintf(0, "Hit nothing\n"); break; case HIT_WALL: - mprintf((0, "Hit wall\n")); + mprintf(0, "Hit wall\n"); break; case HIT_OBJECT: - mprintf((0, "Hit Object %d\n", hit_info.hit_object)); + mprintf(0, "Hit Object %d\n", hit_info.hit_object); break; case HIT_TERRAIN: - mprintf((0, "Hit Terrain %d\n", CELLNUM(hit_info.hit_room))); + mprintf(0, "Hit Terrain %d\n", CELLNUM(hit_info.hit_room)); break; case HIT_OUT_OF_TERRAIN_BOUNDS: - mprintf((0, "Hit nothing: Leaving Terrain\n")); + mprintf(0, "Hit nothing: Leaving Terrain\n"); break; case HIT_SPHERE_2_POLY_OBJECT: - mprintf((0, "Hit Poly_object\n")); + mprintf(0, "Hit Poly_object\n"); break; default: - mprintf((0, "Hit %d not printed, add to list\n", fate)); + mprintf(0, "Hit %d not printed, add to list\n", fate); break; } @@ -2227,9 +2227,9 @@ void ProcessTestKeys(int key) { case KEY_F9: { vector vec = Player_object->pos + (Player_object->orient.fvec * 20); if (BSPRayOccluded(&Player_object->pos, &vec, MineBSP.root)) - mprintf((0, "Occluded!\n")); + mprintf(0, "Occluded!\n"); else - mprintf((0, "NOT occluded!\n")); + mprintf(0, "NOT occluded!\n"); } break; case KEY_F10: @@ -2281,7 +2281,7 @@ void ProcessTestKeys(int key) { float t = 5.0f; int m = 5; - mprintf((0, "Matcen alive!\n")); + mprintf(0, "Matcen alive!\n"); vector centerPt = Player_object->pos + (Player_object->orient.fvec * 2.0f); Matcen[m_id]->SetAttachType(MT_ROOM); @@ -2301,7 +2301,7 @@ void ProcessTestKeys(int key) { Matcen[m_id]->SetStatus(MSTAT_ACTIVE | MSTAT_RANDOM_PROD_ORDER, true); } else { - mprintf((0, "Nope!\n")); + mprintf(0, "Nope!\n"); } } break; @@ -2356,17 +2356,17 @@ void ProcessTestKeys(int key) { Game_show_portal_vis_pnts = 1 - Game_show_portal_vis_pnts; - mprintf((0, "Vis info for room %d\n", Player_object->roomnum)); + mprintf(0, "Vis info for room %d\n", Player_object->roomnum); for (i = 0; i <= Highest_room_index; i++) { if (BOA_IsVisible(i, Player_object->roomnum)) { - mprintf((0, "%d can see you in %d\n", i, Player_object->roomnum)); + mprintf(0, "%d can see you in %d\n", i, Player_object->roomnum); } } for (i = Highest_room_index + 1; i <= Highest_room_index + 8; i++) { if (BOA_IsVisible(i, Player_object->roomnum)) { - mprintf((0, "Terrain %d can see you in %d\n", i - Highest_room_index - 1, Player_object->roomnum)); + mprintf(0, "Terrain %d can see you in %d\n", i - Highest_room_index - 1, Player_object->roomnum); } } } @@ -2767,10 +2767,10 @@ void CalcFrameTime(void) { last_timer = current_timer; if (Min_frametime > Frametime) { - mprintf((0, "This was the fastest frame yet!\n")); + mprintf(0, "This was the fastest frame yet!\n"); Min_frametime = Frametime - Demo_frame_ofs; } else if (Max_frametime < Frametime) { - mprintf((0, "This was the slowest frame yet!\n")); + mprintf(0, "This was the slowest frame yet!\n"); Max_frametime = Frametime - Demo_frame_ofs; } Frames_counted++; @@ -2781,7 +2781,7 @@ void CalcFrameTime(void) { void InitFrameTime(void) { if (timer_paused) { - mprintf((1, "Timer paused in InitFrameTime()\n")); + mprintf(1, "Timer paused in InitFrameTime()\n"); } last_timer = timer_GetMSTime(); timer_paused = 0; @@ -2789,7 +2789,7 @@ void InitFrameTime(void) { // Pauses game void PauseGame() { - mprintf((0, "Game paused.\n")); + mprintf(0, "Game paused.\n"); Game_paused = true; D3MusicPause(); @@ -2803,7 +2803,7 @@ void ResumeGame() { Game_paused = false; Sound_system.ResumeSounds(); D3MusicResume(); - mprintf((0, "Game resumed.\n")); + mprintf(0, "Game resumed.\n"); } // Data for terrain sound @@ -2895,7 +2895,7 @@ void GameFrame(void) { bool is_game_idle = !Descent->active(); if (Tracking_FVI) { - mprintf((0, "Beginning frame!\n")); + mprintf(0, "Beginning frame!\n"); } // Begin Gameloop stuff @@ -2916,12 +2916,12 @@ void GameFrame(void) { static float netstat_time = 0; nw_GetNetworkStats(&netstat); - mprintf_at((5, 0, 0, "TCP/IP Network Stats:")); - mprintf_at((5, 1, 0, "TCP: tx: %d/%d rtx: %d/%d rx: %d/%d", netstat.tcp_total_packets_sent, - netstat.tcp_total_bytes_sent, netstat.tcp_total_packets_resent, netstat.tcp_total_bytes_resent, - netstat.tcp_total_packets_rec, netstat.tcp_total_bytes_rec)); - mprintf_at((5, 2, 0, "UDP: tx: %d/%d rx: %d/%d", netstat.udp_total_packets_sent, netstat.udp_total_bytes_sent, - netstat.udp_total_packets_rec, netstat.udp_total_bytes_rec)); + mprintf_at(5, 0, 0, "TCP/IP Network Stats:"); + mprintf_at(5, 1, 0, "TCP: tx: %d/%d rtx: %d/%d rx: %d/%d", netstat.tcp_total_packets_sent, + netstat.tcp_total_bytes_sent, netstat.tcp_total_packets_resent, netstat.tcp_total_bytes_resent, + netstat.tcp_total_packets_rec, netstat.tcp_total_bytes_rec); + mprintf_at(5, 2, 0, "UDP: tx: %d/%d rx: %d/%d", netstat.udp_total_packets_sent, netstat.udp_total_bytes_sent, + netstat.udp_total_packets_rec, netstat.udp_total_bytes_rec); if (!netstat_init) { netstat_time = timer_GetTime(); @@ -2943,8 +2943,8 @@ void GameFrame(void) { udp_rx = ((float)(netstat.udp_total_bytes_rec - old_netstat.udp_total_bytes_rec)) / time_diff; udp_tx = ((float)(netstat.udp_total_bytes_sent - old_netstat.udp_total_bytes_sent)) / time_diff; - mprintf_at((5, 3, 0, "TCP/s: TX: % 5.1f RTX: % 5.1f RX: % 5.1f", tcp_tx, tcp_rtx, tcp_rx)); - mprintf_at((5, 4, 0, "UDP/s: TX: % 5.1f RX: % 5.1f", udp_tx, udp_rx)); + mprintf_at(5, 3, 0, "TCP/s: TX: % 5.1f RTX: % 5.1f RX: % 5.1f", tcp_tx, tcp_rtx, tcp_rx); + mprintf_at(5, 4, 0, "UDP/s: TX: % 5.1f RX: % 5.1f", udp_tx, udp_rx); old_netstat = netstat; netstat_time = newt; @@ -3113,7 +3113,7 @@ void GameFrame(void) { current_timer = timer_GetMSTime(); if ((current_timer - last_timer) < Min_allowed_frametime) { sleeptime = (uint32_t)Min_allowed_frametime - (current_timer - last_timer); - // mprintf((0,"Sleeping for %d ms\n",sleeptime)); + // mprintf(0,"Sleeping for %d ms\n",sleeptime); Sleep(sleeptime); } @@ -3158,20 +3158,20 @@ void GameFrame(void) { /* if (frame_info.ai_time>.1) - mprintf ((0,"NOTE: AI frame took longer than .1 seconds! %f\n",frame_info.ai_time)); + mprintf(0,"NOTE: AI frame took longer than .1 seconds! %f\n",frame_info.ai_time); if (frame_info.render_time>.1) - mprintf ((0,"NOTE: Render frame took longer than .1 seconds! %f\n",frame_info.render_time)); + mprintf(0,"NOTE: Render frame took longer than .1 seconds! %f\n",frame_info.render_time); if (frame_info.multi_time>.1) - mprintf ((0,"NOTE: Multi frame took longer than .1 seconds! %f\n",frame_info.multi_time)); + mprintf(0,"NOTE: Multi frame took longer than .1 seconds! %f\n",frame_info.multi_time); if (frame_info.obj_time>.1) - mprintf ((0,"NOTE: Object frame took longer than .1 seconds! %f\n",frame_info.obj_time)); + mprintf(0,"NOTE: Object frame took longer than .1 seconds! %f\n",frame_info.obj_time); */ #endif - mprintf_at((1, 0, 39, "Pn %05d, L %05d", Physics_normal_counter, Physics_normal_looping_counter)); - mprintf_at((1, 1, 39, "Pw %05d, L %05d", Physics_walking_counter, Physics_walking_looping_counter)); - mprintf_at((1, 2, 39, "Pv %05d", Physics_vis_counter)); - mprintf_at((1, 3, 39, "Fc %05d, R %05d", FVI_counter, FVI_room_counter)); + mprintf_at(1, 0, 39, "Pn %05d, L %05d", Physics_normal_counter, Physics_normal_looping_counter); + mprintf_at(1, 1, 39, "Pw %05d, L %05d", Physics_walking_counter, Physics_walking_looping_counter); + mprintf_at(1, 2, 39, "Pv %05d", Physics_vis_counter); + mprintf_at(1, 3, 39, "Fc %05d, R %05d", FVI_counter, FVI_room_counter); #ifdef D3_FAST if (FrameCount > 20) @@ -3195,7 +3195,7 @@ void GameFrame(void) { #endif if (Tracking_FVI) { - mprintf((0, "Ending frame!\n")); + mprintf(0, "Ending frame!\n"); } if (!is_game_idle) { diff --git a/Descent3/Inventory.cpp b/Descent3/Inventory.cpp index e9294f36..bb346aac 100644 --- a/Descent3/Inventory.cpp +++ b/Descent3/Inventory.cpp @@ -311,7 +311,7 @@ // constructor Inventory::Inventory(void) { - // mprintf((0,"Inventory System: Initialize\n")); + // mprintf(0,"Inventory System: Initialize\n"); root = NULL; count = 0; pos = NULL; @@ -395,13 +395,13 @@ void Inventory::Reset(bool in_game, int reset_stage) { bool Inventory::AddObject(int object_handle, int flags, const char *description) { // make sure we can fit another object if (count >= MAX_UNIQUE_INVEN_ITEMS) { - mprintf((0, "Max unique count hit on add to inventory\n")); + mprintf(0, "Max unique count hit on add to inventory\n"); return false; } object *obj = ObjGet(object_handle); if (!obj) { - mprintf((0, "INVEN: Invalid object trying to be added\n")); + mprintf(0, "INVEN: Invalid object trying to be added\n"); return false; } @@ -503,12 +503,12 @@ bool Inventory::AddObject(int object_handle, int flags, const char *description) bool Inventory::Add(int type, int id, object *parent, int aux_type, int aux_id, int flags, const char *description) { // make sure we can fit another object if (count >= MAX_UNIQUE_INVEN_ITEMS) { - mprintf((0, "Max unique count hit on add to inventory\n")); + mprintf(0, "Max unique count hit on add to inventory\n"); return false; } if ((type < 0) || (type == OBJ_NONE)) { - mprintf((0, "Invalid type on add to inventory\n")); + mprintf(0, "Invalid type on add to inventory\n"); return false; } @@ -528,7 +528,7 @@ bool Inventory::Add(int type, int id, object *parent, int aux_type, int aux_id, bool Inventory::AddCounterMeasure(int id, int aux_type, int aux_id, int flags, const char *description) { // make sure we can fit another object if (count >= MAX_UNIQUE_INVEN_ITEMS) { - mprintf((0, "Hit max unique in counter measure add\n")); + mprintf(0, "Hit max unique in counter measure add\n"); return false; } @@ -560,7 +560,7 @@ bool Inventory::AddCounterMeasure(int id, int aux_type, int aux_id, int flags, c } else { // there is an item of that type/id already, just increase it's count newnode->count++; - // mprintf((0,"Inventory: Item #%d (%s) Count increased to %d\n",count,newnode->name,newnode->count)); + // mprintf(0,"Inventory: Item #%d (%s) Count increased to %d\n",count,newnode->name,newnode->count); } } @@ -592,7 +592,7 @@ bool Inventory::AddCounterMeasure(int id, int aux_type, int aux_id, int flags, c } count++; - // mprintf((0,"Inventory: Item #%d Added Countermeasure (%s) ID=%d\n",count,newnode->name,newnode->id)); + // mprintf(0,"Inventory: Item #%d Added Countermeasure (%s) ID=%d\n",count,newnode->name,newnode->id); } pos = newnode; @@ -740,13 +740,13 @@ bool Inventory::Use(int type, int id, object *parent) { // if type is OBJ_WEAPON then it's a countermeasure if (type == OBJ_WEAPON) { - mprintf((0, "CounterMeasures: Use\n")); + mprintf(0, "CounterMeasures: Use\n"); // countermeasure CreateCountermeasureFromObject(player, id); Remove(node->type, node->id); ret = true; } else { - mprintf((0, "Inventory: Use\n")); + mprintf(0, "Inventory: Use\n"); // regular // recreate the object int objnum; @@ -827,12 +827,12 @@ bool Inventory::Use(int type, int id, object *parent) { // sends a request to the server to use a particular item in the inventory void Inventory::SendRequestToServerToUse(int type, int id) { - // mprintf((0,"Sending request to server for T=%d ID=%d\n",type,id)); + // mprintf(0,"Sending request to server for T=%d ID=%d\n",type,id); inven_item *node = FindItem(type, id); if (node) { MultiSendClientInventoryUseItem(type, id); } else { - mprintf((0, "Sorry couldn't find it in your inventory\n")); + mprintf(0, "Sorry couldn't find it in your inventory\n"); } } @@ -888,7 +888,7 @@ bool Inventory::Remove(int type, int id) { RemoveNode(node); } else { node->count--; - mprintf((0, "Inventory System: Remove\n")); + mprintf(0, "Inventory System: Remove\n"); if (node->count <= 0) RemoveNode(node); @@ -958,7 +958,7 @@ inven_item *Inventory::FindItem(int type, int id) { while (counter) { if ((current->type == type) && (current->id == id)) // we got a match { - // mprintf((0,"Inventory: FindItem found Type(%d) ID(%d)\n",type,id)); + // mprintf(0,"Inventory: FindItem found Type(%d) ID(%d)\n",type,id); return current; } @@ -966,19 +966,19 @@ inven_item *Inventory::FindItem(int type, int id) { counter--; } - // mprintf((0,"Inventory: FindItem couldn't find Type(%d) ID(%d)\n",type,id)); + // mprintf(0,"Inventory: FindItem couldn't find Type(%d) ID(%d)\n",type,id); return NULL; } // returns how many items are in the inventory int Inventory::Size(void) { - // mprintf((0,"Inventory System: Size\n")); + // mprintf(0,"Inventory System: Size\n"); return count; } // returns true if there is an item in the inventory with the given type/id bool Inventory::CheckItem(int type, int id) { - // mprintf((0,"Inventory System: CheckItem\n")); + // mprintf(0,"Inventory System: CheckItem\n"); if (FindItem(type, id)) return true; else @@ -1009,7 +1009,7 @@ int Inventory::SaveInventory(CFILE *file) { object *obj = ObjGet(curr->type); ASSERT(obj); if (!obj) { - mprintf((0, "Invalid object saving inventory\n")); + mprintf(0, "Invalid object saving inventory\n"); curr = curr->next; num_items--; pos_count++; @@ -1078,7 +1078,7 @@ int Inventory::ReadInventory(CFILE *file) { object *obj = ObjGet(t); ASSERT(obj); if (!obj) { - mprintf((0, "Invalid object restoring inventory\n")); + mprintf(0, "Invalid object restoring inventory\n"); // skip this object cf_ReadInt(file); cf_ReadInt(file); @@ -1229,7 +1229,7 @@ bool Inventory::GetAuxPosTypeID(int &type, int &id) { // returns the description of the item at the current position char *Inventory::GetPosDescription(void) { - // mprintf((0,"Getting Pos Description (%s)\n",pos->description)); + // mprintf(0,"Getting Pos Description (%s)\n",pos->description); if (!pos) return NULL; return pos->description; @@ -1251,7 +1251,7 @@ char *Inventory::GetPosIconName(void) { // returns the count of the item at the current position int Inventory::GetPosCount(void) { - // mprintf((0,"Getting Pos Count (%d)\n",pos->count)); + // mprintf(0,"Getting Pos Count (%d)\n",pos->count); if (!pos) return 0; @@ -1282,7 +1282,7 @@ bool Inventory::GetPosInfo(uint16_t &iflags, int &flags) { // goes to a position in the list void Inventory::GotoPos(int newpos) { - // mprintf((0,"Going to Pos (%d)\n",newpos)); + // mprintf(0,"Going to Pos (%d)\n",newpos); ResetPos(); int i; for (i = 0; i < newpos; i++) { @@ -1527,7 +1527,7 @@ void InventoryRemoveObject(int objhandle) { for (int i = 0; i < MAX_PLAYERS; i++) { if (Players[i].inventory.CheckItem(objhandle, -1)) { // this player has it!! - mprintf((0, "INVEN: Removing dead object from %d\n", i)); + mprintf(0, "INVEN: Removing dead object from %d\n", i); Players[i].inventory.Remove(objhandle, -1); return; } diff --git a/Descent3/LoadLevel.cpp b/Descent3/LoadLevel.cpp index 2de045ab..d46ee044 100644 --- a/Descent3/LoadLevel.cpp +++ b/Descent3/LoadLevel.cpp @@ -1551,8 +1551,7 @@ void ConvertObject(int *type, int *id) { ASSERT(object_convert[convert_to].id >= 0); if (object_convert[convert_to].id >= 0) { - mprintf( - (0, "LEVELLOAD: Converting: '%s' -> '%s'\n", object_convert[i].name, object_convert[convert_to].name)); + mprintf(0, "LEVELLOAD: Converting: '%s' -> '%s'\n", object_convert[i].name, object_convert[convert_to].name); new_id = object_convert[convert_to].id; new_type = object_convert[convert_to].type; @@ -1797,7 +1796,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) { num_models = cf_ReadByte(ifile); if (pm->n_models != num_models) { model_changed = 1; - mprintf((0, "Polymodel %s has changed since this level was lit!\n", pm->name)); + mprintf(0, "Polymodel %s has changed since this level was lit!\n", pm->name); } if (!model_changed) @@ -1886,7 +1885,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) { } if (clear_lightmaps) { - mprintf((0, "Freeing lightmaps because model %s has changed since this level was saved!\n", pm->name)); + mprintf(0, "Freeing lightmaps because model %s has changed since this level was saved!\n", pm->name); ClearObjectLightmaps(objp); } } @@ -2212,7 +2211,7 @@ void RemoveDegenerateFaces(room *rp) { face *fp = &rp->faces[f]; if ((fp->normal.x == 0.0) && (fp->normal.y == 0.0) && (fp->normal.z == 0.0)) { - mprintf((0, "Deleting face %d from room %d\n", f, ROOMNUM(rp))); + mprintf(0, "Deleting face %d from room %d\n", f, ROOMNUM(rp)); DeleteRoomFace(rp, f); n_degenerate_faces_removed++; } @@ -2500,7 +2499,7 @@ int ReadRoom(CFILE *ifile, room *rp, int version) { // Check for bad normal if (!t) { - mprintf((1, "WARNING: Room %d face %d has bad normal!\n", rp - Rooms, i)); + mprintf(1, "WARNING: Room %d face %d has bad normal!\n", rp - Rooms, i); } } @@ -2673,7 +2672,7 @@ void ReadNewLightmapChunk(CFILE *fp, int version) { nummaps = cf_ReadInt(fp); - mprintf((0, "Reading %d unique lightmaps\n", nummaps)); + mprintf(0, "Reading %d unique lightmaps\n", nummaps); for (i = 0; i < nummaps; i++) { int w, h; @@ -3048,7 +3047,7 @@ void ReadBOAChunk(CFILE *fp, int version) { if (version < 62) { cfseek(fp, sizeof(int16_t) * max_rooms * max_rooms, SEEK_CUR); - mprintf((0, "We will need to remake boa. New cost structure added\n")); + mprintf(0, "We will need to remake boa. New cost structure added\n"); BOA_AABB_checksum = BOA_mine_checksum = 0; } else { max_path_portals = cf_ReadInt(fp); @@ -3063,7 +3062,7 @@ void ReadBOAChunk(CFILE *fp, int version) { cfseek(fp, max_rooms * sizeof(float), SEEK_CUR); } - mprintf((0, "We will need to remake boa. Data size changed\n")); + mprintf(0, "We will need to remake boa. Data size changed\n"); BOA_AABB_checksum = BOA_mine_checksum = 0; } else { for (i = 0; i <= max_rooms; i++) { @@ -3082,7 +3081,7 @@ void ReadBOAChunk(CFILE *fp, int version) { BOA_num_terrain_regions = cf_ReadInt(fp); if (version < 112) { - mprintf((0, "We will need to remake boa.\n")); + mprintf(0, "We will need to remake boa.\n"); BOA_AABB_checksum = BOA_mine_checksum = 0; } else { int i, j; @@ -3721,8 +3720,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { cf_ReadBytes((uint8_t *)chunk_name, 4, ifile); chunk_start = cftell(ifile); chunk_size = cf_ReadInt(ifile); - mprintf( - (0, "Chunk: %c%c%c%c, size=%d\n", chunk_name[0], chunk_name[1], chunk_name[2], chunk_name[3], chunk_size)); + mprintf(0, "Chunk: %c%c%c%c, size=%d\n", chunk_name[0], chunk_name[1], chunk_name[2], chunk_name[3], chunk_size); if (ISCHUNK(CHUNK_TEXTURE_NAMES)) ReadTextureList(ifile); @@ -3762,7 +3760,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { roomnum = (version >= 96) ? cf_ReadShort(ifile) : i; ReadRoom(ifile, &Rooms[roomnum], version); } - mprintf((1, "%d degenerate faces removed\n", n_degenerate_faces_removed)); + mprintf(1, "%d degenerate faces removed\n", n_degenerate_faces_removed); Highest_room_index = roomnum; ASSERT(Highest_room_index < MAX_ROOMS); @@ -3825,8 +3823,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { Objects[objnum].type = OBJ_NONE; // kill the object } else { if (!ROOMNUM_OUTSIDE(roomnum) && Rooms[roomnum].flags & RF_EXTERNAL) { - mprintf((0, "Internal object %d linked to external room %d (type = %d)!!!\n", objnum, roomnum, - Objects[objnum].type)); + mprintf(0, "Internal object %d linked to external room %d (type = %d)!!!\n", objnum, roomnum, Objects[objnum].type); if (Objects[objnum].type == OBJ_VIEWER) Objects[objnum].type = OBJ_NONE; // kill the object else { @@ -4027,8 +4024,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { } #endif // ifdef EDITOR else { // unknown chunk - mprintf((0, " Unknown chunk: %c%c%c%c, size=%d\n", chunk_name[0], chunk_name[1], chunk_name[2], chunk_name[3], - chunk_size)); + mprintf(0, " Unknown chunk: %c%c%c%c, size=%d\n", chunk_name[0], chunk_name[1], chunk_name[2], chunk_name[3], chunk_size); } // Go to end of chunk @@ -4039,7 +4035,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { } // try catch (cfile_error *cfe) { - mprintf((0, "Error reading: file = <%s>, error = \"%s\"\n", cfe->file->name, cfe->msg)); + mprintf(0, "Error reading: file = <%s>, error = \"%s\"\n", cfe->file->name, cfe->msg); ASSERT(cfe->read_write == CFE_READING); #if (defined(EDITOR) || defined(NEWEDITOR)) if (GetFunctionMode() == EDITOR_MODE) @@ -4136,7 +4132,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { #ifndef NEWEDITOR CountDataToPageIn(); #endif - // mprintf((0,"%d bytes of data to page in...\n",total)); + // mprintf(0,"%d bytes of data to page in...\n",total); end_loadlevel: #ifdef EDITOR @@ -4153,7 +4149,7 @@ end_loadlevel: } // Debug log the current sum - mprintf((0, "End of load level checksum = %s\n", GetCurrentSumString())); + mprintf(0, "End of load level checksum = %s\n", GetCurrentSumString()); // Done return retval; } @@ -4222,7 +4218,7 @@ int WriteObject(CFILE *ofile, object *objp) { // If there is lightmap data for this object, write it out. if (objp->lighting_render_type == LRT_LIGHTMAPS) { if (objp->lm_object.used == 0) { - mprintf((0, "Warning: Object %d is set for lightmaps but has no lightmap data!\n", objp - Objects)); + mprintf(0, "Warning: Object %d is set for lightmaps but has no lightmap data!\n", objp - Objects); cf_WriteByte(ofile, 0); } else { cf_WriteByte(ofile, 1); @@ -4294,7 +4290,7 @@ int WriteFace(CFILE *ofile, face *fp) { if ((fp->flags & FF_LIGHTMAP) && (fp->lmi_handle == BAD_LMI_INDEX || LightmapInfoRemap[fp->lmi_handle] == BAD_LMI_INDEX)) { fp->flags &= ~FF_LIGHTMAP; - mprintf((0, "Almost saved a bogus lightmap!\n")); + mprintf(0, "Almost saved a bogus lightmap!\n"); } cf_WriteShort(ofile, fp->flags); @@ -4315,7 +4311,7 @@ int WriteFace(CFILE *ofile, face *fp) { if (fp->light_multiple == 186) { fp->light_multiple = 4; // Get Jason, I'm looking for this bug! Its safe to go past it, but I'm just on the lookout - mprintf((0, "Bogus light multiple detected...bashing!\n")); + mprintf(0, "Bogus light multiple detected...bashing!\n"); } cf_WriteByte(ofile, fp->light_multiple); @@ -5297,7 +5293,7 @@ int SaveLevel(char *filename, bool f_save_room_AABB) { EndChunk(ofile, chunk_start_pos); } catch (cfile_error *cfe) { - mprintf((0, "Error writing: file = <%s>, msg = \"%s\"\n", cfe->file->name, cfe->msg)); + mprintf(0, "Error writing: file = <%s>, msg = \"%s\"\n", cfe->file->name, cfe->msg); ASSERT(cfe->read_write == CFE_WRITING); EditorMessageBox("Error writing file %s: %s", cfe->file->name, cfe->msg); cfclose(ofile); @@ -5626,7 +5622,7 @@ void AlmostPageInAllData() { AlmostPageInLevelTexture(FindTextureName("LightFlareStar")); AlmostPageInLevelTexture(FindTextureName("LightFlare")); - // mprintf((0,"%d bytes to page in for the ship.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for the ship.\n",need_to_page_in); // Get static fireballs for (i = 0; i < NUM_FIREBALLS; i++) { char name[PAGENAME_LEN]; @@ -5637,7 +5633,7 @@ void AlmostPageInAllData() { if (id != -1) AlmostPageInLevelTexture(id); } - // mprintf((0,"%d bytes to page in for fireballs.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for fireballs.\n",need_to_page_in); // Get static sounds for (i = 0; i < NUM_STATIC_SOUNDS; i++) { int sid = FindSoundName(IGNORE_TABLE(Static_sound_names[i])); @@ -5645,7 +5641,7 @@ void AlmostPageInAllData() { if (sid != -1) AlmostPageInSound(sid); } - // mprintf((0,"%d bytes to page in for static sounds.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for static sounds.\n",need_to_page_in); // First get textures for (i = 0; i <= Highest_room_index; i++) { if (!Rooms[i].used) @@ -5656,7 +5652,7 @@ void AlmostPageInAllData() { AlmostPageInLevelTexture(rp->faces[t].tmap); } } - // mprintf((0,"%d bytes to page in for room textures.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for room textures.\n",need_to_page_in); // Touch all terrain textures for (i = 0; i < TERRAIN_TEX_WIDTH * TERRAIN_TEX_DEPTH; i++) { AlmostPageInLevelTexture(Terrain_tex_seg[i].tex_index); @@ -5668,7 +5664,7 @@ void AlmostPageInAllData() { for (i = 0; i < Terrain_sky.num_satellites; i++) AlmostPageInLevelTexture(Terrain_sky.satellite_texture[i]); - // mprintf((0,"%d bytes to page in for the terrain.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for the terrain.\n",need_to_page_in); // Touch all objects for (i = 0; i <= Highest_object_index; i++) { object *obj = &Objects[i]; @@ -5683,7 +5679,7 @@ void AlmostPageInAllData() { continue; } } - // mprintf((0,"%d bytes to page in for objects.\n",need_to_page_in)); + // mprintf(0,"%d bytes to page in for objects.\n",need_to_page_in); } // Go through all the data needing to be paged in, add it all up. @@ -5736,7 +5732,7 @@ char *LocalizeLevelName(char *level) { Localization_SetLanguage(LANGUAGE_ENGLISH); // Save the current language, then bash it to english if (!CreateStringTable("level_names.str", &english_names, &num_english_names)) { - mprintf((0, "Couldn't open level_names stringtable!\n")); + mprintf(0, "Couldn't open level_names stringtable!\n"); Localization_SetLanguage(save_lang); strcpy(local_name, level); return local_name; @@ -5746,7 +5742,7 @@ char *LocalizeLevelName(char *level) { Localization_SetLanguage(save_lang); if (!CreateStringTable("level_names.str", &local_names, &num_local_names)) { - mprintf((0, "Couldn't open level_names stringtable!\n")); + mprintf(0, "Couldn't open level_names stringtable!\n"); // destroy the english stringtable... DestroyStringTable(english_names, num_english_names); diff --git a/Descent3/Mission.cpp b/Descent3/Mission.cpp index d4df95b6..2d23b19f 100644 --- a/Descent3/Mission.cpp +++ b/Descent3/Mission.cpp @@ -727,7 +727,7 @@ static inline char *MN3_TO_MSN_NAME(const char *mn3name, char *msnname) { // High level mission stuff /////////////////////////////////////////////////////////////////////////////// void InitMission() { - mprintf((0, "In InitMission()\n")); + mprintf(0, "In InitMission()\n"); Current_mission.num_levels = 0; Current_mission.cur_level = 0; memset(Current_mission.desc, 0, sizeof(Current_mission.desc)); @@ -751,7 +751,7 @@ void InitMission() { } // reset all states for a mission void ResetMission() { - mprintf((0, "In ResetMission()\n")); + mprintf(0, "In ResetMission()\n"); FreeMission(); Current_mission.num_levels = 0; Current_mission.cur_level = 0; @@ -880,7 +880,7 @@ bool DemoMission(int mode = 0) { bool LoadMission(const char *mssn) { Times_game_restored = 0; - mprintf((0, "In LoadMission()\n")); + mprintf(0, "In LoadMission()\n"); // ShowProgressScreen(TXT_LOADINGLEVEL); #if (defined(OEM) || defined(DEMO)) #ifdef OEM @@ -1015,7 +1015,7 @@ bool LoadMission(const char *mssn) { if (Net_msn_URLs.URL[a][0] == '\0') { strncpy(Net_msn_URLs.URL[a], operand, MAX_MISSION_URL_LEN - 1); Net_msn_URLs.URL[a][MAX_MISSION_URL_LEN - 1] = '\0'; - mprintf((0, "Found a Mission URL: %s\n", operand)); + mprintf(0, "Found a Mission URL: %s\n", operand); break; } } @@ -1031,7 +1031,7 @@ bool LoadMission(const char *mssn) { // ok the ship exists, make this guy the new default ship PlayerResetShipPermissions(-1, false); PlayerSetShipPermission(-1, operand, true); - mprintf((0, "MAKING %s THE NEW DEFAULT SHIP!\n", operand)); + mprintf(0, "MAKING %s THE NEW DEFAULT SHIP!\n", operand); } else { Int3(); } @@ -1385,7 +1385,7 @@ void LoadLevelProgress(int step, float percent, const char *chunk) { } lvl_percent_loaded = 1.0f; pag_percent_loaded = 1.0f; - mprintf((0, "Prepare for Descent goes here...\n")); + mprintf(0, "Prepare for Descent goes here...\n"); // ShowProgressScreen(TXT_PREPARE_FOR_DESCENT,NULL,true); // return; break; @@ -1402,7 +1402,7 @@ void LoadLevelProgress(int step, float percent, const char *chunk) { return; } break; default: - mprintf((0, "Unknown step in LoadLevelProgress()\n")); + mprintf(0, "Unknown step in LoadLevelProgress()\n"); Int3(); } if (Dedicated_server) { @@ -1649,7 +1649,7 @@ bool Skip_next_movie = false; void DoMissionMovie(const char *movie) { char temppath[PSPATHNAME_LEN]; if (PROGRAM(windowed)) { - mprintf((0, "Skipping movie...can't do in windowed mode!\n")); + mprintf(0, "Skipping movie...can't do in windowed mode!\n"); return; } // Don't play this movie the first time through. This is a horrible hack. @@ -1680,7 +1680,7 @@ bool InitMissionScript() { //@@ if (!fp) { //@@ DoMessageBox("Error", "Unable to find mission script.", MSGBOX_OK, UICOL_WINDOW_TITLE, // UICOL_TEXT_NORMAL); - //@@ mprintf((0, "Unable to open default script. Loading null script...\n")); + //@@ mprintf(0, "Unable to open default script. Loading null script...\n"); //@@ return false; //@@ } //@@ else { @@ -1688,7 +1688,7 @@ bool InitMissionScript() { //@@ if (!Current_mission.d3xmod) { //@@ DoMessageBox("Error", "Unable to find mission script.", MSGBOX_OK, UICOL_WINDOW_TITLE, // UICOL_TEXT_NORMAL); - //@@ mprintf((0, "Unable to open default script. Loading null script...\n")); + //@@ mprintf(0, "Unable to open default script. Loading null script...\n"); //@@ return false; //@@ } //@@ cfclose(fp); @@ -1737,7 +1737,7 @@ bool GetMissionInfo(const char *msnfile, tMissionInfo *msn) { } fp = cfopen(msnfile, "rt"); if (!fp) { - mprintf((0, "Failed to open mission file %s in GetMissionInfo.\n", msnfile)); + mprintf(0, "Failed to open mission file %s in GetMissionInfo.\n", msnfile); return false; } msn->multi = true; @@ -1802,7 +1802,7 @@ const char *GetMissionName(const char *mission) { if (GetMissionInfo(mission, &msninfo)) { strcpy(msnname, msninfo.name); } else { - mprintf((0, "MISSION:GetMissionName failed from call to GetMissionInfo\n")); + mprintf(0, "MISSION:GetMissionName failed from call to GetMissionInfo\n"); } return msnname; } @@ -1886,7 +1886,7 @@ bool mn3_GetInfo(const char *mn3file, tMissionInfo *msn) { } handle = cf_OpenLibrary(pathname); if (handle == 0) { - mprintf((0, "MISSION: MN3 failed to open.\n")); + mprintf(0, "MISSION: MN3 failed to open.\n"); return false; } MN3_TO_MSN_NAME(mn3file, filename); @@ -1936,7 +1936,7 @@ int MissionGetKeywords(const char *mission, char *keywords) { memset(msn_keywords, 0, sizeof(msn_keywords)); memset(mod_keywords, 0, sizeof(mod_keywords)); - mprintf((0, "MissionGetKeywords(%s,%s)\n", mission, keywords)); + mprintf(0, "MissionGetKeywords(%s,%s)\n", mission, keywords); if (!GetMissionInfo(mission, &msn_info)) { return -1; } @@ -1998,7 +1998,7 @@ int MissionGetKeywords(const char *mission, char *keywords) { } // We never found one we needed, so return -1; if (!found_keyword) { - mprintf((0, "%s keyword needed in %s not found!\n", mod_keywords[i], mission)); + mprintf(0, "%s keyword needed in %s not found!\n", mod_keywords[i], mission); return -1; } } @@ -2007,11 +2007,11 @@ int MissionGetKeywords(const char *mission, char *keywords) { teams = goals; } if (teams < goalsneeded) { - mprintf((0, "Not enough goals in this level!\n")); + mprintf(0, "Not enough goals in this level!\n"); teams = -1; } if (goals < goalsneeded) { - mprintf((0, "Not enough goals in this level!\n")); + mprintf(0, "Not enough goals in this level!\n"); teams = -1; } return teams; diff --git a/Descent3/OsirisLoadandBind.cpp b/Descent3/OsirisLoadandBind.cpp index 328b3b5b..471c64f1 100644 --- a/Descent3/OsirisLoadandBind.cpp +++ b/Descent3/OsirisLoadandBind.cpp @@ -565,7 +565,7 @@ static bool Osiris_level_script_loaded = false; // Purpose: // Closes down the OSIRIS module loader and handling system void Osiris_ShutdownModuleLoader(void) { - mprintf((0, "OSIRIS: Shutting down module manager\n")); + mprintf(0, "OSIRIS: Shutting down module manager\n"); int i; for (i = 0; i < MAX_LOADED_MODULES; i++) { Osiris_FreeModule(i); @@ -576,7 +576,7 @@ void Osiris_ShutdownModuleLoader(void) { // Purpose: // Initializes the OSIRIS module loader and handling system void Osiris_InitModuleLoader(void) { - mprintf((0, "OSIRIS: Initializing module manager\n")); + mprintf(0, "OSIRIS: Initializing module manager\n"); int i; for (i = 0; i < MAX_LOADED_MODULES; i++) { OSIRIS_loaded_modules[i].flags = 0; @@ -795,8 +795,7 @@ void Osiris_UnloadModule(int module_id) { if (OSIRIS_loaded_modules[module_id].flags & OSIMF_INUSE) { // the module is in use if (Show_osiris_debug) { - mprintf( - (0, "OSIRIS: Decrementing reference count for module (%s)\n", OSIRIS_loaded_modules[module_id].module_name)); + mprintf(0, "OSIRIS: Decrementing reference count for module (%s)\n", OSIRIS_loaded_modules[module_id].module_name); } OSIRIS_loaded_modules[module_id].reference_count--; @@ -810,19 +809,19 @@ void Osiris_UnloadModule(int module_id) { ASSERT(!(OSIRIS_loaded_modules[module_id].flags & OSIMF_DLLELSEWHERE)); // mission modules cannot be set static // do not unload this module, due to the forced stay in memory - mprintf((0, "OSIRIS: Module (%s) staying in memory due to static flag\n", - OSIRIS_loaded_modules[module_id].module_name)); + mprintf(0, "OSIRIS: Module (%s) staying in memory due to static flag\n", + OSIRIS_loaded_modules[module_id].module_name); } else { // time to unload this module if (Show_osiris_debug) { - mprintf((0, "OSIRIS: Module (%s) reference count is at 0, unloading\n", - OSIRIS_loaded_modules[module_id].module_name)); + mprintf(0, "OSIRIS: Module (%s) reference count is at 0, unloading\n", + OSIRIS_loaded_modules[module_id].module_name); } Osiris_FreeModule(module_id); } } } else { - mprintf((0, "OSIRIS: Trying to unload a module (%d) that is not in use!\n", module_id)); + mprintf(0, "OSIRIS: Trying to unload a module (%d) that is not in use!\n", module_id); Int3(); } } @@ -865,7 +864,7 @@ void Osiris_UnloadLevelModule(void) { if (OSIRIS_loaded_modules[j].flags & OSIMF_INUSE && OSIRIS_loaded_modules[j].flags & OSIMF_NOUNLOAD) { // unload this module - mprintf((0, "OSIRIS: Unloading static module (%s) due to level end\n", OSIRIS_loaded_modules[j].module_name)); + mprintf(0, "OSIRIS: Unloading static module (%s) due to level end\n", OSIRIS_loaded_modules[j].module_name); Osiris_FreeModule(j); } @@ -957,7 +956,7 @@ int Osiris_LoadLevelModule(char *module_name) { ASSERT(!tOSIRISCurrentLevel.level_loaded); if (tOSIRISCurrentLevel.level_loaded) { - mprintf((0, "OSIRIS: Trying to load a level dll, when one has already been loaded\n")); + mprintf(0, "OSIRIS: Trying to load a level dll, when one has already been loaded\n"); return tOSIRISCurrentLevel.dll_id; } @@ -967,8 +966,8 @@ int Osiris_LoadLevelModule(char *module_name) { // the module is already loaded OSIRIS_loaded_modules[loaded_id].reference_count++; if (Show_osiris_debug) { - mprintf((0, "OSIRIS: Level Module (%s) reference count increased to %d\n", module_name, - OSIRIS_loaded_modules[loaded_id].reference_count)); + mprintf(0, "OSIRIS: Level Module (%s) reference count increased to %d\n", module_name, + OSIRIS_loaded_modules[loaded_id].reference_count); } return loaded_id; } @@ -983,7 +982,7 @@ int Osiris_LoadLevelModule(char *module_name) { if (loaded_id >= MAX_LOADED_MODULES) { // no slots available - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s): No available slots\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s): No available slots\n", module_name); Int3(); return -4; } @@ -995,7 +994,7 @@ int Osiris_LoadLevelModule(char *module_name) { switch (ret_val) { case -2: // the module does not exist - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s): Module doesn't exist\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s): Module doesn't exist\n", module_name); return -1; break; case -1: @@ -1003,7 +1002,7 @@ int Osiris_LoadLevelModule(char *module_name) { break; default: // the module was an extracted file - mprintf((0, "OSIRIS: Found module (%s) in a temp file\n", basename)); + mprintf(0, "OSIRIS: Found module (%s) in a temp file\n", basename); OSIRIS_loaded_modules[loaded_id].flags |= OSIMF_INTEMPDIR; OSIRIS_loaded_modules[loaded_id].extracted_id = ret_val; break; @@ -1012,7 +1011,7 @@ int Osiris_LoadLevelModule(char *module_name) { // the module exists, now attempt to load it if (!mod_LoadModule(&OSIRIS_loaded_modules[loaded_id].mod, fullpath)) { // there was an error trying to load the module - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s): Unable to load module\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s): Unable to load module\n", module_name); Int3(); return -3; } @@ -1056,7 +1055,7 @@ int Osiris_LoadLevelModule(char *module_name) { !osm->GetCOScriptList || !osm->CreateInstance || !osm->DestroyInstance || !osm->SaveRestoreState || !osm->CallInstanceEvent) { // there was an error importing a function - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s) couldn't import function.\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s) couldn't import function.\n", module_name); Int3(); osm->flags = 0; if (osm->module_name) @@ -1075,7 +1074,7 @@ int Osiris_LoadLevelModule(char *module_name) { // there is a string table, load it up bool ret = CreateStringTable(stringtablename, &osm->string_table, &osm->strings_loaded); if (!ret) { - mprintf((0, "OSIRIS: Unable to load string table (%s) for (%s)\n", stringtablename, basename)); + mprintf(0, "OSIRIS: Unable to load string table (%s) for (%s)\n", stringtablename, basename); Int3(); osm->string_table = NULL; osm->strings_loaded = 0; @@ -1094,7 +1093,7 @@ int Osiris_LoadLevelModule(char *module_name) { // when we get to this point we nearly have a loaded module, we just need to initialize it if (!osm->InitializeDLL(&Osiris_module_init)) { // there was an error initializing the module - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s) error initializing module.\n", basename)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s) error initializing module.\n", basename); if (osm->string_table) { DestroyStringTable(osm->string_table, osm->strings_loaded); } @@ -1121,7 +1120,7 @@ int Osiris_LoadLevelModule(char *module_name) { // the trigger was found instance = osm->CreateInstance(script_id); if (!instance) { - mprintf((0, "OSIRIS: Unable to create instance for trigger script (%d)\n", i)); + mprintf(0, "OSIRIS: Unable to create instance for trigger script (%d)\n", i); } else { Triggers[i].osiris_script.script_id = script_id; Triggers[i].osiris_script.script_instance = instance; @@ -1137,8 +1136,8 @@ int Osiris_LoadLevelModule(char *module_name) { tOSIRISCurrentLevel.instance = OSIRIS_loaded_modules[loaded_id].CreateInstance(0); // level scripts always have id of 0 in a level dll - mprintf((0, "OSIRIS: Level Module (%s) loaded successfully (%d custom handles)\n", basename, - tOSIRISCurrentLevel.num_customs)); + mprintf(0, "OSIRIS: Level Module (%s) loaded successfully (%d custom handles)\n", basename, + tOSIRISCurrentLevel.num_customs); Osiris_level_script_loaded = true; return loaded_id; } @@ -1161,8 +1160,8 @@ int Osiris_LoadGameModule(char *module_name) { // the module is already loaded OSIRIS_loaded_modules[loaded_id].reference_count++; if (Show_osiris_debug) { - mprintf((0, "OSIRIS: Game Module (%s) reference count increased to %d\n", module_name, - OSIRIS_loaded_modules[loaded_id].reference_count)); + mprintf(0, "OSIRIS: Game Module (%s) reference count increased to %d\n", module_name, + OSIRIS_loaded_modules[loaded_id].reference_count); } return loaded_id; } @@ -1177,7 +1176,7 @@ int Osiris_LoadGameModule(char *module_name) { if (loaded_id >= MAX_LOADED_MODULES) { // no slots available - mprintf((0, "OSIRIS: Osiris_LoadGameModule(%s): No available slots\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadGameModule(%s): No available slots\n", module_name); Int3(); return -4; } @@ -1189,7 +1188,7 @@ int Osiris_LoadGameModule(char *module_name) { switch (ret_val) { case -2: // the module does not exist - mprintf((0, "OSIRIS: Osiris_LoadLevelModule(%s): Module doesn't exist\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadLevelModule(%s): Module doesn't exist\n", module_name); return -1; break; case -1: @@ -1197,7 +1196,7 @@ int Osiris_LoadGameModule(char *module_name) { break; default: // the module was an extracted file - mprintf((0, "OSIRIS: Found module (%s) in a temp file\n", basename)); + mprintf(0, "OSIRIS: Found module (%s) in a temp file\n", basename); OSIRIS_loaded_modules[loaded_id].flags |= OSIMF_INTEMPDIR; OSIRIS_loaded_modules[loaded_id].extracted_id = ret_val; break; @@ -1206,7 +1205,7 @@ int Osiris_LoadGameModule(char *module_name) { // the module exists, now attempt to load it if (!mod_LoadModule(&OSIRIS_loaded_modules[loaded_id].mod, fullpath)) { // there was an error trying to load the module - mprintf((0, "OSIRIS: Osiris_LoadGameModule(%s): Unable to load module\n", module_name)); + mprintf(0, "OSIRIS: Osiris_LoadGameModule(%s): Unable to load module\n", module_name); Int3(); return -3; } @@ -1247,7 +1246,7 @@ int Osiris_LoadGameModule(char *module_name) { if (!osm->InitializeDLL || !osm->ShutdownDLL || !osm->GetGOScriptID || !osm->CreateInstance || !osm->DestroyInstance || !osm->SaveRestoreState || !osm->CallInstanceEvent) { // there was an error importing a function - mprintf((0, "OSIRIS: Osiris_LoadGameModule(%s) couldn't import function.\n", basename)); + mprintf(0, "OSIRIS: Osiris_LoadGameModule(%s) couldn't import function.\n", basename); Int3(); osm->flags = 0; if (osm->module_name) @@ -1266,7 +1265,7 @@ int Osiris_LoadGameModule(char *module_name) { // there is a string table, load it up bool ret = CreateStringTable(stringtablename, &osm->string_table, &osm->strings_loaded); if (!ret) { - mprintf((0, "OSIRIS: Unable to load string table (%s) for (%s)\n", stringtablename, basename)); + mprintf(0, "OSIRIS: Unable to load string table (%s) for (%s)\n", stringtablename, basename); Int3(); osm->string_table = NULL; osm->strings_loaded = 0; @@ -1284,7 +1283,7 @@ int Osiris_LoadGameModule(char *module_name) { // when we get to this point we nearly have a loaded module, we just need to initialize it if (!osm->InitializeDLL(&Osiris_module_init)) { // there was an error initializing the module - mprintf((0, "OSIRIS: Osiris_LoadGameModule(%s) error initializing module.\n", basename)); + mprintf(0, "OSIRIS: Osiris_LoadGameModule(%s) error initializing module.\n", basename); if (osm->string_table) { DestroyStringTable(osm->string_table, osm->strings_loaded); } @@ -1300,12 +1299,12 @@ int Osiris_LoadGameModule(char *module_name) { if (Osiris_module_init.module_is_static) { // the module is requesting to be static - mprintf((0, "OSIRIS: Module (%s) is requesting to be static\n", osm->module_name)); + mprintf(0, "OSIRIS: Module (%s) is requesting to be static\n", osm->module_name); osm->flags |= OSIMF_NOUNLOAD; } // we have a successful module load - mprintf((0, "OSIRIS: Game Module (%s) loaded successfully\n", basename)); + mprintf(0, "OSIRIS: Game Module (%s) loaded successfully\n", basename); return loaded_id; } @@ -1340,7 +1339,7 @@ int Osiris_LoadMissionModule(module *module_handle, const char *filename) { if (loaded_id >= MAX_LOADED_MODULES) { // no slots available - mprintf((0, "OSIRIS: Osiris_LoadMissionModule(%s): No available slots\n", filename)); + mprintf(0, "OSIRIS: Osiris_LoadMissionModule(%s): No available slots\n", filename); Int3(); return -4; } @@ -1348,7 +1347,7 @@ int Osiris_LoadMissionModule(module *module_handle, const char *filename) { // make sure the module exists so we can load it if (!module_handle->handle) { // the module does not exist - mprintf((0, "OSIRIS: Osiris_LoadMissionModule(%s): Module doesn't exist\n", filename)); + mprintf(0, "OSIRIS: Osiris_LoadMissionModule(%s): Module doesn't exist\n", filename); // Int3(); return -1; } @@ -1388,7 +1387,7 @@ int Osiris_LoadMissionModule(module *module_handle, const char *filename) { if (!osm->GetGOScriptID || !osm->CreateInstance || !osm->DestroyInstance || !osm->SaveRestoreState || !osm->CallInstanceEvent) { // there was an error importing a function - mprintf((0, "OSIRIS: Osiris_LoadMissionModule(%s) couldn't import function.\n", filename)); + mprintf(0, "OSIRIS: Osiris_LoadMissionModule(%s) couldn't import function.\n", filename); osm->flags = 0; tOSIRISCurrentMission.mission_loaded = false; Int3(); @@ -1400,7 +1399,7 @@ int Osiris_LoadMissionModule(module *module_handle, const char *filename) { tOSIRISCurrentMission.mission_loaded = true; tOSIRISCurrentMission.dll_id = loaded_id; if (Show_osiris_debug) { - mprintf((0, "OSIRIS: Mission Game Module (%s) loaded successfully\n", filename)); + mprintf(0, "OSIRIS: Mission Game Module (%s) loaded successfully\n", filename); } return loaded_id; } @@ -1503,14 +1502,14 @@ bool Osiris_BindScriptsToObject(object *obj) { if (dll_id < 0) { // there was an error finding this object's dll if (Show_osiris_debug) { - mprintf((0, "OSIRIS: Unable to load module (%s) to bind to object (%s)\n", default_module_name, page_name)); + mprintf(0, "OSIRIS: Unable to load module (%s) to bind to object (%s)\n", default_module_name, page_name); } } else { // allocate the memory for the object's scripts obj->osiris_script = (tOSIRISScript *)mem_malloc(sizeof(tOSIRISScript)); if (!obj->osiris_script) { // out of memory - mprintf((0, "OSIRIS: Out of memory trying to bind script\n")); + mprintf(0, "OSIRIS: Out of memory trying to bind script\n"); return false; } @@ -1525,7 +1524,7 @@ bool Osiris_BindScriptsToObject(object *obj) { if (gos_id == -1) { // the default script for this object does not exist in the dll set for it - mprintf((0, "OSIRIS: Unable to find GOS ID for (%s) in (%s)!\n", page_name, default_module_name)); + mprintf(0, "OSIRIS: Unable to find GOS ID for (%s) in (%s)!\n", page_name, default_module_name); Int3(); Osiris_UnloadModule(dll_id); } else { @@ -1535,7 +1534,7 @@ bool Osiris_BindScriptsToObject(object *obj) { gos_instance = OSIRIS_loaded_modules[dll_id].CreateInstance(gos_id); if (!gos_instance) { // we had an error obtaining the instance of the GOS...ugh - mprintf((0, "OSIRIS: Unable to create GOS instance for (%s)\n", page_name)); + mprintf(0, "OSIRIS: Unable to create GOS instance for (%s)\n", page_name); Int3(); Osiris_UnloadModule(dll_id); } else { @@ -1588,7 +1587,7 @@ bool Osiris_BindScriptsToObject(object *obj) { obj->osiris_script = (tOSIRISScript *)mem_malloc(sizeof(tOSIRISScript)); if (!obj->osiris_script) { // out of memory - mprintf((0, "OSIRIS: Out of memory trying to bind script\n")); + mprintf(0, "OSIRIS: Out of memory trying to bind script\n"); return false; } @@ -1603,7 +1602,7 @@ bool Osiris_BindScriptsToObject(object *obj) { gos_instance = OSIRIS_loaded_modules[dll_id].CreateInstance(gos_id); if (!gos_instance) { // we had an error obtaining the instance of the GOS...ick - mprintf((0, "OSIRIS: Unable to create GOS instance from level dll for (%s)\n", page_name)); + mprintf(0, "OSIRIS: Unable to create GOS instance from level dll for (%s)\n", page_name); Int3(); } else { // ok, we got a valid instance @@ -1645,7 +1644,7 @@ bool Osiris_BindScriptsToObject(object *obj) { obj->osiris_script = (tOSIRISScript *)mem_malloc(sizeof(tOSIRISScript)); if (!obj->osiris_script) { // out of memory - mprintf((0, "OSIRIS: Out of memory trying to bind script\n")); + mprintf(0, "OSIRIS: Out of memory trying to bind script\n"); return false; } @@ -1659,8 +1658,8 @@ bool Osiris_BindScriptsToObject(object *obj) { gos_instance = OSIRIS_loaded_modules[dll_id].CreateInstance(gos_id); if (!gos_instance) { // we had an error obtaining the instance of the COS...doh! - mprintf((0, "OSIRIS: Unable to create COS instance from level dll for (%s)\n", - (page_name) ? (page_name) : "")); + mprintf(0, "OSIRIS: Unable to create COS instance from level dll for (%s)\n", + (page_name) ? (page_name) : ""); Int3(); } else { // ok, everything is valid @@ -1687,7 +1686,7 @@ bool Osiris_BindScriptsToObject(object *obj) { #endif if (iscustomonly) { - mprintf((0, "OSIRIS: Attached custom script to 'custom only' object 0x%x\n", obj->handle)); + mprintf(0, "OSIRIS: Attached custom script to 'custom only' object 0x%x\n", obj->handle); } } } @@ -1715,7 +1714,7 @@ bool Osiris_BindScriptsToObject(object *obj) { obj->osiris_script = (tOSIRISScript *)mem_malloc(sizeof(tOSIRISScript)); if (!obj->osiris_script) { // out of memory - mprintf((0, "OSIRIS: Out of memory trying to bind script\n")); + mprintf(0, "OSIRIS: Out of memory trying to bind script\n"); return false; } @@ -1730,7 +1729,7 @@ bool Osiris_BindScriptsToObject(object *obj) { gos_instance = OSIRIS_loaded_modules[dll_id].CreateInstance(gos_id); if (!gos_instance) { // we had an error obtaining the instance of the GOS...ick - mprintf((0, "OSIRIS: Unable to create GOS instance from mission dll for (%s)\n", page_name)); + mprintf(0, "OSIRIS: Unable to create GOS instance from mission dll for (%s)\n", page_name); Int3(); } else { // ok, we got a valid instance @@ -2137,7 +2136,7 @@ bool Osiris_CallEvent(object *obj, int event, tOSIRISEventInfo *data) { } if (!obj->osiris_script) { - // mprintf((0,"OSIRIS: Unhandled event (%d) for object id=%d\n",event,obj->id)); + // mprintf(0,"OSIRIS: Unhandled event (%d) for object id=%d\n",event,obj->id); return true; // no script for this object...hmm } @@ -2325,7 +2324,7 @@ void Osiris_ProcessTimers(void) { Osiris_CallEvent(obj, EVT_TIMERCANCEL, &ei); } - mprintf((0, "OSIRIS TIMER: Cancelling Timer (%d/%d)\n", OsirisTimers[i].handle, i)); + mprintf(0, "OSIRIS TIMER: Cancelling Timer (%d/%d)\n", OsirisTimers[i].handle, i); continue; } } @@ -2672,7 +2671,7 @@ void Osiris_SaveSystemState(CFILE *file) { int save_end = cftell(file); - mprintf((0, "Osiris: Save state, %d bytes written\n", save_end - save_start)); + mprintf(0, "Osiris: Save state, %d bytes written\n", save_end - save_start); cfseek(file, checksum_pos, SEEK_SET); cf_WriteInt(file, save_end - save_start); // write out 'checksum' @@ -2691,7 +2690,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { cf_ReadString(tag, 256, file); if (strcmp(tag, "OSIRIS")) { // Things aren't right...our tag is not here - mprintf((0, "Missing OSIRIS tag\n")); + mprintf(0, "Missing OSIRIS tag\n"); Int3(); return false; } @@ -2747,10 +2746,10 @@ bool Osiris_RestoreSystemState(CFILE *file) { // when the state was saved. This means that things are not going to be restored exactly for // sure. We'll skip over those that are not loaded. We're int3 here because I want to know // when this happens. - mprintf((0, + mprintf(0, "OSIRIS: Restoring global state, the number of loaded modules is not the same as the restored count (%d " "vs. %d)\n", - loaded_module_count, read_module_count)); + loaded_module_count, read_module_count); if (Demo_flags != DF_PLAYBACK) { Int3(); } @@ -2773,7 +2772,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { module_handle = Osiris_FindLoadedModule(read_module_name); if (module_handle == -1) { - mprintf((0, "OSIRIS: The module (%s) was not found while trying to restore the state\n", read_module_name)); + mprintf(0, "OSIRIS: The module (%s) was not found while trying to restore the state\n", read_module_name); if (Demo_flags != DF_PLAYBACK) { Int3(); } @@ -2806,7 +2805,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { int restore_end = cftell(file); - mprintf((0, "Osiris: Restore state, %d bytes read\n", restore_end - restore_start)); + mprintf(0, "Osiris: Restore state, %d bytes read\n", restore_end - restore_start); ASSERT(num_bytes_to_be_restored == (restore_end - restore_start)); if (num_bytes_to_be_restored == (restore_end - restore_start)) @@ -3124,7 +3123,7 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) { if (library_handle == 0) return 0; - mprintf((0, "OSIRIS: Extracting Scripts From Hog\n")); + mprintf(0, "OSIRIS: Extracting Scripts From Hog\n"); char filename[_MAX_PATH], temp_filename[_MAX_PATH]; char tempdir[_MAX_PATH], temp_file[_MAX_PATH], temp_fileext[_MAX_EXT]; @@ -3156,15 +3155,15 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) { int index; index = _getfreeextractslot(); if (index == -1) { - mprintf((0, "OSIRIS: Out of slots extracting scripts!!!!!!!!\n")); + mprintf(0, "OSIRIS: Out of slots extracting scripts!!!!!!!!\n"); Int3(); goto ex_error; } - mprintf((0, "Search started\n")); + mprintf(0, "Search started\n"); if (cf_LibraryFindFirst(library_handle, script_extension, filename)) { - mprintf((0, " Found: %s...", filename)); + mprintf(0, " Found: %s...", filename); if (!ddio_GetTempFileName(tempdir, "d3s", temp_filename)) Int3(); else { @@ -3182,18 +3181,18 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) { } // extract it out - mprintf((0, "Extracting...")); + mprintf(0, "Extracting..."); _extractscript(filename, temp_filename); - mprintf((0, "Done\n")); + mprintf(0, "Done\n"); count++; while (cf_LibraryFindNext(filename)) { - mprintf((0, " Found: %s...", filename)); + mprintf(0, " Found: %s...", filename); index = _getfreeextractslot(); if (index == -1) { - mprintf((0, "OSIRIS: Out of slots extracting scripts!!!!!!!!\n")); + mprintf(0, "OSIRIS: Out of slots extracting scripts!!!!!!!!\n"); Int3(); goto ex_error; } @@ -3216,9 +3215,9 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) { } // extract it out - mprintf((0, "Extracting...")); + mprintf(0, "Extracting..."); _extractscript(filename, temp_filename); - mprintf((0, "Done\n")); + mprintf(0, "Done\n"); count++; } @@ -3226,7 +3225,7 @@ int Osiris_ExtractScriptsFromHog(int library_handle, bool is_mission_hog) { } } - mprintf((0, "Done Extracting\n")); + mprintf(0, "Done Extracting\n"); ex_error: cf_LibraryFindClose(); @@ -3242,7 +3241,7 @@ ex_error: } void Osiris_ClearExtractedScripts(bool mission_only) { - mprintf((0, "OSIRIS: Removing Extracted DLLs\n")); + mprintf(0, "OSIRIS: Removing Extracted DLLs\n"); char fullpath[_MAX_PATH]; if (!OSIRIS_Extracted_script_dir) { @@ -3422,7 +3421,7 @@ void Osiris_InitOMMS(void) { } void Osiris_CloseOMMS(void) { - mprintf((0, "OSIRIS: Reseting OMMS memory\n")); + mprintf(0, "OSIRIS: Reseting OMMS memory\n"); tOMMSHashNode *curr = OMMS_Hash_node_root; @@ -3701,7 +3700,7 @@ free_mem: if (!node_to_free) return; - mprintf((0, "OMMS: deleting uid 0x%x\n", node_to_free->unique_id)); + mprintf(0, "OMMS: deleting uid 0x%x\n", node_to_free->unique_id); if (node_to_free->memory_ptr) mem_free(node_to_free->memory_ptr); mem_free(node_to_free); @@ -3801,7 +3800,7 @@ OMMSHANDLE Osiris_OMMS_Malloc(size_t amount_of_memory, uint32_t unique_identifie node->size_of_memory = amount_of_memory; node->unique_id = unique_identifier; - mprintf((0, "OMMS: malloc handle (0x%x%x) size = %d\n", hash->base_id, node->id, node->size_of_memory)); + mprintf(0, "OMMS: malloc handle (0x%x%x) size = %d\n", hash->base_id, node->id, node->size_of_memory); return ((hash->base_id << 16) | (node->id)); } diff --git a/Descent3/PilotPicsAPI.cpp b/Descent3/PilotPicsAPI.cpp index 50e3c22b..07a7c827 100644 --- a/Descent3/PilotPicsAPI.cpp +++ b/Descent3/PilotPicsAPI.cpp @@ -126,7 +126,7 @@ static int PPic_GetOffsetByID(uint16_t pilot_id); // --------------------------------------------------------- bool PPic_InitDatabase(void) { if (PilotPic_init) { - mprintf((0, "PPIC: InitDatabase already called\n")); + mprintf(0, "PPIC: InitDatabase already called\n"); return true; } @@ -139,7 +139,7 @@ bool PPic_InitDatabase(void) { if (PilotPic_database_hog_handle == 0) { // there was an error opening the hog database // ----------------------------------------- - mprintf((0, "PPIC: Error opening %s database\n", PILOTPIC_DATABASE_HOG)); + mprintf(0, "PPIC: Error opening %s database\n", PILOTPIC_DATABASE_HOG); PilotPic_database_index_handle = NULL; return false; } @@ -151,7 +151,7 @@ bool PPic_InitDatabase(void) { if (PilotPic_database_index_handle == NULL) { // there was an error opening the database index // --------------------------------------------- - mprintf((0, "PPIC: Error opening database index '%s'\n", PILOTPIC_DATABASE_INDEX)); + mprintf(0, "PPIC: Error opening database index '%s'\n", PILOTPIC_DATABASE_INDEX); cf_CloseLibrary(PilotPic_database_hog_handle); PilotPic_database_hog_handle = 0; return false; @@ -163,7 +163,7 @@ bool PPic_InitDatabase(void) { if (!PPic_BuildDatabases()) { // there was an error building the databases // ----------------------------------------- - mprintf((0, "PPIC: Error building databases\n")); + mprintf(0, "PPIC: Error building databases\n"); cfclose(PilotPic_database_index_handle); PilotPic_database_index_handle = NULL; cf_CloseLibrary(PilotPic_database_hog_handle); @@ -499,7 +499,7 @@ bool PPic_BuildDatabases(void) { PilotPic_count = cf_ReadInt(file); if (PilotPic_count < 0) { // hmm a negative! - mprintf((0, "PPIC: Invalid number of pilot pictures (%d)\n", PilotPic_count)); + mprintf(0, "PPIC: Invalid number of pilot pictures (%d)\n", PilotPic_count); Int3(); PilotPic_count = 0; cf_Rewind(file); @@ -507,7 +507,7 @@ bool PPic_BuildDatabases(void) { } if (PilotPic_count > 65535) { // too many!!!! - mprintf((0, "PPIC: Invalid number of pilot pictures (%d)\n", PilotPic_count)); + mprintf(0, "PPIC: Invalid number of pilot pictures (%d)\n", PilotPic_count); Int3(); PilotPic_count = 0; cf_Rewind(file); @@ -520,7 +520,7 @@ bool PPic_BuildDatabases(void) { Sorted_Pilot_id_to_offset = (uint16_t *)mem_malloc(sizeof(uint16_t) * PilotPic_count); if (!Pilot_id_to_offset) { // out of memory!!! - mprintf((0, "PPIC: Out of memory allocating index database\n")); + mprintf(0, "PPIC: Out of memory allocating index database\n"); Int3(); PilotPic_count = 0; cf_Rewind(file); @@ -547,7 +547,7 @@ bool PPic_BuildDatabases(void) { cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; if (name_size >= PILOT_STRING_SIZE) { - mprintf((0, "PPIC: Too big: (%s)%d %d", name_buffer, count, name_size)); + mprintf(0, "PPIC: Too big: (%s)%d %d", name_buffer, count, name_size); } // next read in pilot_id diff --git a/Descent3/Player.cpp b/Descent3/Player.cpp index e0ff39b8..abbf567b 100644 --- a/Descent3/Player.cpp +++ b/Descent3/Player.cpp @@ -1237,7 +1237,7 @@ void FindPlayerStarts() { unique++; } - mprintf((0, "There are %d unique start positions in this level\n", unique)); + mprintf(0, "There are %d unique start positions in this level\n", unique); // Now create the extra players if (Game_mode & GM_MULTI) { @@ -1306,7 +1306,7 @@ int PlayerGetRandomStartPosition(int slot) { if (Team_game) { int team = PlayerGetTeam(slot); - mprintf((0, "Picking team start position, team=%d.\n", team)); + mprintf(0, "Picking team start position, team=%d.\n", team); int num_avail = 0; int avail_array[MAX_PLAYERS]; @@ -1332,7 +1332,7 @@ int PlayerGetRandomStartPosition(int slot) { int num; int done = 0; int badcount = 0; - mprintf((0, "Picking non-team start position.\n")); + mprintf(0, "Picking non-team start position.\n"); while (!done) { num = ps_rand() % (Highest_player_start + 1); if (Players[num].start_roomnum != -1) { @@ -1354,7 +1354,7 @@ int PlayerGetRandomStartPosition(int slot) { badcount++; if (badcount >= 15) // give up after fifteen tries { - mprintf((0, "Stopping cuz I couldn't find a valid player position!\n")); + mprintf(0, "Stopping cuz I couldn't find a valid player position!\n"); done = 1; } } else @@ -1362,7 +1362,7 @@ int PlayerGetRandomStartPosition(int slot) { } } - mprintf((0, "Picked index for start position %d\n", num)); + mprintf(0, "Picked index for start position %d\n", num); return num; } @@ -2051,13 +2051,13 @@ static tDeathSeq Death[MAX_NET_PLAYERS]; void debug_deathtype(int slot, int damage) { if (Death[slot].fate == DEATH_INSTANT) - mprintf((0, "INSTANT DEATH ")); + mprintf(0, "INSTANT DEATH "); else if (Death[slot].fate == DEATH_FALL) - mprintf((0, "FALLING DEATH ")); + mprintf(0, "FALLING DEATH "); else if (Death[slot].fate == DEATH_BREAKUP) - mprintf((0, "BREAKUP DEATH ")); + mprintf(0, "BREAKUP DEATH "); else - mprintf((0, "UNKNOWN DEATH ")); + mprintf(0, "UNKNOWN DEATH "); } float MoveDeathCam(int slot, vector *vec, float distance); @@ -2141,7 +2141,7 @@ void StartPlayerDeath(int slot, float damage, bool melee, int fate) { if (slot == Player_num) { objnum = ObjCreate(OBJ_CAMERA, 0, playerobj->roomnum, &playerobj->pos, &playerobj->orient); if (objnum == -1) { - mprintf((0, "Failed to create death cam.\n")); + mprintf(0, "Failed to create death cam.\n"); Int3(); } else { Death[slot].camera = &Objects[objnum]; @@ -2189,7 +2189,7 @@ void StartPlayerDeath(int slot, float damage, bool melee, int fate) { Death[slot].dying_model = GetPolymodelPointer(playerobj->rtype.pobj_info.model_num); playerobj->rtype.pobj_info.subobj_flags = 0xffffffff; // playerobj->rtype.pobj_info.subobj_flags = ~(0xffffffff << (Death[slot].dying_model->n_models)); - // mprintf((0, "initflags=%08x\n", playerobj->rtype.pobj_info.subobj_flags)); + // mprintf(0, "initflags=%08x\n", playerobj->rtype.pobj_info.subobj_flags); } else { // This ship has no dying model so dont break up if (Death[slot].fate == DEATH_BREAKUP) @@ -2345,7 +2345,7 @@ void DoNewPlayerDeathFrame(int slot) { if (hit_data.hit_type[0] == HIT_WALL) { // death camera's view is obstructed, move the death cam - // mprintf((0, "Death cam view obstructed, changing view...\n")); + // mprintf(0, "Death cam view obstructed, changing view...\n"); vm_MakeRandomVector(&directional); MoveDeathCam(slot, &directional, MEDIAN_DEATHCAM_DIST); } @@ -2373,7 +2373,7 @@ void DoNewPlayerDeathFrame(int slot) { } else { PlayerShipBreakup(playerobj, 20.0f + (ps_rand() % 10)); Death[slot].breakup_count++; - // mprintf((0, "Breakup!\n")); + // mprintf(0, "Breakup!\n"); } } } @@ -2416,7 +2416,7 @@ void DoNewPlayerDeathFrame(int slot) { } } - // mprintf ((0,"Playerobj size=%f\n",playerobj->size)); + // mprintf(0,"Playerobj size=%f\n",playerobj->size); } #define TARGET_DEGREE (170 / 2) @@ -2759,7 +2759,7 @@ void PlayerSpewGuidebot(object *parent, int type, int id) { objnum = ObjCreate(OBJ_DEBRIS, 0, parent->roomnum, &parent->pos, &parent->orient); if (objnum < 0 || objnum > Highest_object_index) { - mprintf((0, "WARNING: No object slots. Dead GB not created!\n")); + mprintf(0, "WARNING: No object slots. Dead GB not created!\n"); return; } @@ -2850,7 +2850,7 @@ int PlayerSpewObject(object *parent, int type, int id, int timed, void *sinfo) { int objnum = ObjCreate(type, id, parent->roomnum, &parent->pos, NULL, parent->handle); if (objnum < 0) { - mprintf((0, "Couldn't spew object!\n")); + mprintf(0, "Couldn't spew object!\n"); return -1; } @@ -3234,14 +3234,13 @@ void PlayerShipSpewPartSub(object *obj, bsp_info *submodel, float magnitude) { VisEffects[visnum].lifeleft *= 2.0f; rand_vec = (-rand_vec) * (magnitude * 25.0f); phys_apply_force(obj, &rand_vec); - // mprintf((0, "Breakoff fireball size: %f, lifeleft: %f\n", Objects[objnum].size, - // Objects[objnum].lifeleft)); + // mprintf(0, "Breakoff fireball size: %f, lifeleft: %f\n", Objects[objnum].size, Objects[objnum].lifeleft); } } // mark subobject dead obj->rtype.pobj_info.subobj_flags &= (~(1 << subobjnum)); - // mprintf((0, "%d:sobj=%08x\n", subobjnum, obj->rtype.pobj_info.subobj_flags)); + // mprintf(0, "%d:sobj=%08x\n", subobjnum, obj->rtype.pobj_info.subobj_flags); } // Moves death camera a certain distance based off of direction from vec from @@ -3550,7 +3549,7 @@ void PlayerSwitchToObserver(int slot, int observer_mode, int piggy_objnum) { SetObjectControlType(obj, CT_NONE); Players[slot].piggy_objnum = piggy_objnum; Players[slot].piggy_sig = Objects[piggy_objnum].handle & HANDLE_COUNT_MASK; - mprintf((0, "Object %d is observing object %d!\n", obj - Objects, piggy_objnum)); + mprintf(0, "Object %d is observing object %d!\n", obj - Objects, piggy_objnum); } } @@ -3674,7 +3673,7 @@ bool PlayerResetShipPermissions(int pnum, bool set_default) { int perm; - mprintf((0, "Reseting ship permissions\n")); + mprintf(0, "Reseting ship permissions\n"); if (set_default) perm = Default_ship_permission; @@ -3765,7 +3764,7 @@ void DoEnergyToShields(int pnum) { // Sets the start position that the player will respawn at void PlayerAddWaypoint(int index) { ASSERT(Players[index].start_roomnum != -1); // Invalid start position specified - mprintf((0, "Current waypoint is now %d\n", index)); + mprintf(0, "Current waypoint is now %d\n", index); Current_waypoint = index; // A manual waypoint blows away all auto-waypoints @@ -3834,7 +3833,7 @@ void SetAutoWaypoint(object *objp) { if (!OBJECT_OUTSIDE(objp)) { // delete the next two lines if (pp->current_auto_waypoint_room != objp->roomnum) { - mprintf((0, "Setting auto-waypoint in room %d\n", objp->roomnum)); + mprintf(0, "Setting auto-waypoint in room %d\n", objp->roomnum); } pp->current_auto_waypoint_room = objp->roomnum; } @@ -3861,7 +3860,7 @@ void MovePlayerToWaypoint(object *objp) { } else { ASSERT(Current_waypoint != -1); - mprintf((0, "Resetting player ship to waypoint %d\n", Current_waypoint)); + mprintf(0, "Resetting player ship to waypoint %d\n", Current_waypoint); ObjSetPos(objp, &Players[Current_waypoint].start_pos, Players[Current_waypoint].start_roomnum, &Players[Current_waypoint].start_orient, false); } diff --git a/Descent3/SLEW.cpp b/Descent3/SLEW.cpp index 1deb2374..96a0cf27 100644 --- a/Descent3/SLEW.cpp +++ b/Descent3/SLEW.cpp @@ -310,8 +310,8 @@ int SlewFrame(object *obj, int movement_limitations) { ret_flags |= SLEW_KEY; if (key_timez0 || key_timez1) { - mprintf_at((1, 0, 0, "Timez0: %.2f ", key_timez0)); - mprintf_at((1, 1, 0, "Timez1: %.2f ", key_timez1)); + mprintf_at(1, 0, 0, "Timez0: %.2f ", key_timez0); + mprintf_at(1, 1, 0, "Timez1: %.2f ", key_timez1); } // adjust physics info of object accordingly to keyboard input. @@ -319,8 +319,7 @@ int SlewFrame(object *obj, int movement_limitations) { obj->mtype.phys_info.velocity.y += VEL_SPEED * (key_timey1 - key_timey0) * Slew_key_speed; obj->mtype.phys_info.velocity.z += VEL_SPEED * (key_timez1 - key_timez0) * Slew_key_speed; - // mprintf((0,"<%x %x %x> - // ",obj->mtype.phys_info.velocity.x,obj->mtype.phys_info.velocity.y,obj->mtype.phys_info.velocity.z)); + // mprintf(0,"<%x %x %x>",obj->mtype.phys_info.velocity.x,obj->mtype.phys_info.velocity.y,obj->mtype.phys_info.velocity.z)); rottime.x = key_timep1 - key_timep0; rottime.y = key_timeh1 - key_timeh0; @@ -342,8 +341,8 @@ int SlewFrame(object *obj, int movement_limitations) { joy_x = joystate.x; joy_y = joystate.y; btns = joystate.buttons; - mprintf_at((2, 1, 0, "JoyX: %d ", joy_x)); - mprintf_at((2, 2, 0, "JoyY: %d ", joy_y)); + mprintf_at(2, 1, 0, "JoyX: %d ", joy_x); + mprintf_at(2, 2, 0, "JoyY: %d ", joy_y); if (abs(joy_x) < JOY_NULL) joy_x = 0; @@ -354,9 +353,9 @@ int SlewFrame(object *obj, int movement_limitations) { joyy_moved = (abs(joy_y - old_joy_y) > JOY_NULL); //@@ if (joyx_moved) - //@@ mprintf((1,"SLEW: Joy X moved\n")); + //@@ mprintf(1,"SLEW: Joy X moved\n"); //@@ if (joyy_moved) - //@@ mprintf((1,"SLEW: Joy Y moved\n")); + //@@ mprintf(1,"SLEW: Joy Y moved\n"); if (btns) { if (!rotang.p) @@ -404,7 +403,7 @@ int SlewFrame(object *obj, int movement_limitations) { if (ret_flags & SLEW_MOVE) { // Get the new room bool outside_mine = ((obj->flags & OF_OUTSIDE_MINE) != 0); - mprintf((1, "SLEW: Moved\n")); + mprintf(1, "SLEW: Moved\n"); #ifdef EDITOR if (Editor_view_mode == VM_ROOM) { @@ -420,7 +419,7 @@ int SlewFrame(object *obj, int movement_limitations) { if (new_room != -1) { // back in the mine outside_mine = 0; - mprintf((0, "SLEW: Re-entered mine at room %d\n", new_room)); + mprintf(0, "SLEW: Re-entered mine at room %d\n", new_room); } else // not back in the mine new_room = obj->roomnum; } else { @@ -459,30 +458,30 @@ int SlewFrame(object *obj, int movement_limitations) { if (fate == HIT_WALL) { int t; - mprintf((0, "SLEW: hit wall\n")); + mprintf(0, "SLEW: hit wall\n"); // Check if we're in a room t = FindPointRoom(&new_pos); if (t != -1) { // We're in a room new_room = t; - mprintf((0, "SLEW: still in mine in room %d\n", new_room)); + mprintf(0, "SLEW: still in mine in room %d\n", new_room); } else { // Not in a room. Set a special flag outside_mine = 1; - mprintf((0, "SLEW: left mine from room %d\n", new_room)); + mprintf(0, "SLEW: left mine from room %d\n", new_room); } } if (new_room != obj->roomnum) { // if we've changed rooms, say so if (ROOMNUM_OUTSIDE(new_room)) if (was_outside) - mprintf((0, "SLEW: Moved to cell %d, BOA TR %d\n", CELLNUM(new_room), TERRAIN_REGION(new_room))); + mprintf(0, "SLEW: Moved to cell %d, BOA TR %d\n", CELLNUM(new_room), TERRAIN_REGION(new_room)); else - mprintf((0, "SLEW: Moved outside to cell %d\n", CELLNUM(new_room))); + mprintf(0, "SLEW: Moved outside to cell %d\n", CELLNUM(new_room)); else if (was_outside) - mprintf((0, "SLEW: Moved inside to room %d\n", new_room)); + mprintf(0, "SLEW: Moved inside to room %d\n", new_room); else - mprintf((0, "SLEW: Moved into room %d\n", new_room)); + mprintf(0, "SLEW: Moved into room %d\n", new_room); } } diff --git a/Descent3/TelCom.cpp b/Descent3/TelCom.cpp index 958dd5a1..f37b2c39 100644 --- a/Descent3/TelCom.cpp +++ b/Descent3/TelCom.cpp @@ -564,11 +564,11 @@ static int Telcom_mouse_x, Telcom_mouse_y; // Initializes the TelCom system, only to be called once during game initialization void TelComInit(void) { - mprintf((0, "Initializing TelCom System\n")); + mprintf(0, "Initializing TelCom System\n"); // load background screens if (!(cfexist(TELCOM_DISPLAY_OGF))) { - mprintf((0, "%s file not found, exiting TelCom Init\n", TELCOM_DISPLAY_OGF)); + mprintf(0, "%s file not found, exiting TelCom Init\n", TELCOM_DISPLAY_OGF); return; } @@ -800,7 +800,7 @@ bool TelComShow(bool ingame, bool ShipSelect) { uint8_t oldbil = Render_preferred_state.filtering; if (!TelCom_init) { - mprintf((0, "TELCOM SYSTEM WARNING: TelComInit() error!\n")); + mprintf(0, "TELCOM SYSTEM WARNING: TelComInit() error!\n"); return false; } @@ -812,9 +812,9 @@ bool TelComShow(bool ingame, bool ShipSelect) { int TelCom_bitmap = bm_AllocLoadFileBitmap(IGNORE_TABLE(TELCOM_DISPLAY_OGF), 0); if (!cfexist(HOTSPOT_DISPLAY)) { - mprintf((0, "Couldn't find HotSpot map, so I'm going to make one\n")); + mprintf(0, "Couldn't find HotSpot map, so I'm going to make one\n"); if (!cfexist(TELCOM_DISPLAY_TGA)) { - mprintf((0, "Unable to find %s to extract HotSqpots...skipping TelCom System\n", TELCOM_DISPLAY_TGA)); + mprintf(0, "Unable to find %s to extract HotSqpots...skipping TelCom System\n", TELCOM_DISPLAY_TGA); FreeViewports(); if (windowmap.wm) mem_free(windowmap.wm); @@ -940,7 +940,7 @@ void FreeTelComOnBitmaps(chunked_bitmap *array) { // This deactivates the TelCom system void TelComDeactivate(void) { - mprintf((0, "TelCom System being deactivated\n")); + mprintf(0, "TelCom System being deactivated\n"); FreeTelComOnBitmaps(hotspot_bitmaps); FreeHotSpotMapInternals(&hotspotmap); FreeViewports(); @@ -1554,7 +1554,7 @@ void TelcomRenderSetScreen(int screen) { ASSERT(screen >= 0 && screen < MAX_TELCOM_SCREENS); if (Telcom_system.Screen_state[screen] != SS_READY) { - mprintf((0, "Telcom Warning: Trying to set screen %d active when it isn't ready\n", screen)); + mprintf(0, "Telcom Warning: Trying to set screen %d active when it isn't ready\n", screen); return; } TC_current_screen = screen; @@ -1972,7 +1972,7 @@ void TelcomLoadHiLites(const char *filelist[], int monitor, int xoff, int yoff) TelcomHiLites[monitor] = (int *)mem_malloc(sizeof(int) * TelcomHiLiteCount[monitor]); if (!TelcomHiLites[monitor]) { - mprintf((0, "Unable to allocate memory for hilights monitor=%d\n", monitor)); + mprintf(0, "Unable to allocate memory for hilights monitor=%d\n", monitor); TelcomHiLiteCount[monitor] = 0; return; } @@ -2470,7 +2470,7 @@ void TelComSendEvent(int event_num, int parm1, int parm2) { } } - mprintf((0, "Warning: TelCom Event Queue Overflow\n")); + mprintf(0, "Warning: TelCom Event Queue Overflow\n"); } /* @@ -2571,7 +2571,7 @@ void TelComHandleAllEvents(tTelComInfo *tcs) { // handle the event switch (event.id) { case -1: - mprintf((0, "TelCom Error: Trying to process an event of type -1\n")); + mprintf(0, "TelCom Error: Trying to process an event of type -1\n"); Int3(); // Hey!! How'd we pop off a -1!!! Get Jeff break; case TEVT_TCQUIT: { @@ -2580,7 +2580,7 @@ void TelComHandleAllEvents(tTelComInfo *tcs) { } break; case TEVT_SCREENSHOT: { // take a screenshot - mprintf((0, "Taking Screenshot\n")); + mprintf(0, "Taking Screenshot\n"); DoScreenshot(); } break; case TEVT_TCNEXT: { @@ -2605,7 +2605,7 @@ void TelComHandleAllEvents(tTelComInfo *tcs) { TelComHandleKeyPress(event.parms[0], true, TC_current_screen); } break; default: - mprintf((0, "TelCom System Warning: Unhandled event %d\n", event.id)); + mprintf(0, "TelCom System Warning: Unhandled event %d\n", event.id); break; } } @@ -3077,7 +3077,7 @@ void TelComHandleKeyPress(int key, bool click, int screen_id) { break; } default: - mprintf((0, "TelCom Warning: Keypressed not valid\n")); + mprintf(0, "TelCom Warning: Keypressed not valid\n"); } } @@ -3314,11 +3314,11 @@ void TelcomStartSound(int sid) { // make sure the handle is there if (TelcomSounds[sid].handle == -1) { - mprintf((0, "TelCom Sound Warning: '%s' hasn't been loaded yet, trying to load\n", TCSoundFiles[sid])); + mprintf(0, "TelCom Sound Warning: '%s' hasn't been loaded yet, trying to load\n", TCSoundFiles[sid]); TelcomSounds[sid].handle = FindSoundName(IGNORE_TABLE(TCSoundFiles[sid])); if (TelcomSounds[sid].handle == -1) { - mprintf((0, "TelCom Sound Warning: 2nd try failed, bailing\n")); + mprintf(0, "TelCom Sound Warning: 2nd try failed, bailing\n"); return; } } @@ -3474,7 +3474,7 @@ void TelComSingleShipSelect(tTelComInfo *tcs) { int found_ships = TCSSCollectInfo(); if (found_ships < 2 || found_ships > 3) { // not supported - mprintf((0, "Skipping Single Player Ship Selecting, %d ships found\n", found_ships)); + mprintf(0, "Skipping Single Player Ship Selecting, %d ships found\n", found_ships); int ship_index_to_use = 0; int bit = 0x01; @@ -3565,7 +3565,7 @@ void TelComSingleShipSelect(tTelComInfo *tcs) { int focus_ship = -1; for (int j = 0; j < MAX_NUM_SHIPS; j++) { if (SSShips[j].found && SSShips[j].ship_index == Players[Player_num].ship_index) { - mprintf((0, "Current Ship: %s\n", Ships[SSShips[j].ship_index].name)); + mprintf(0, "Current Ship: %s\n", Ships[SSShips[j].ship_index].name); focus_ship = SSShips[j].efxnum; break; } @@ -3625,7 +3625,7 @@ void TelComSingleShipSelect(tTelComInfo *tcs) { TelcomRenderSetCallback(NULL); int ship_index_to_use = TCSSGetSelectedShipIndex(); - mprintf((0, "Selected: %s\n", Ships[ship_index_to_use].name)); + mprintf(0, "Selected: %s\n", Ships[ship_index_to_use].name); Players[Player_num].ship_index = ship_index_to_use; TelCom_ClearCustomKeyEvents(); @@ -3674,7 +3674,7 @@ int TCSSCollectInfo(void) { } } - mprintf((0, "Collecting Ship Info: %d ships available\n", found)); + mprintf(0, "Collecting Ship Info: %d ships available\n", found); TCShipSelect.ShipCount = found; return found; @@ -3707,7 +3707,7 @@ void TCSSButtonCallback(int efxnum) { } if (selected_id == -1) { - mprintf((0, "Invalid selected id for efxnum %d\n", efxnum)); + mprintf(0, "Invalid selected id for efxnum %d\n", efxnum); return; } @@ -3727,7 +3727,7 @@ void TCSSButtonCallback(int efxnum) { float size; TCShipSelect.ship_model = Ships[SSShips[selected_id].ship_index].model_handle; if (TCShipSelect.ship_model == -1) { - mprintf((0, "ship_model is -1\n")); + mprintf(0, "ship_model is -1\n"); Int3(); } @@ -3999,7 +3999,7 @@ void TelCom_SendSystemEvent(int event_num, int parm1, int parm2) { } } - mprintf((0, "Warning: TelCom System Event Queue Overflow\n")); + mprintf(0, "Warning: TelCom System Event Queue Overflow\n"); } /* diff --git a/Descent3/TelComEffects.cpp b/Descent3/TelComEffects.cpp index c29ad919..a57ae296 100644 --- a/Descent3/TelComEffects.cpp +++ b/Descent3/TelComEffects.cpp @@ -554,7 +554,7 @@ void RenderScreen(int screen, tTelComInfo *tsys, float Frametime) { node = TCEffects[node].next; } - // mprintf((0,"Effect Count: %d effects\n",count)); + // mprintf(0,"Effect Count: %d effects\n",count); } // Renders an effect @@ -623,7 +623,7 @@ void SendEventToEffect(int effect, int event, int parm1, int parm2) { } // if we got here than the event queue is filled up - mprintf((0, "Warning: Event queue filled up for effect %d\n", effect)); + mprintf(0, "Warning: Event queue filled up for effect %d\n", effect); } // Pops off an event for processesing, returns -1 if no event available @@ -962,7 +962,7 @@ int CreateButtonEffect(LPTCBUTTONDESC desc, int monitor, int screen, int id) { if (tce->buttoninfo.bm_handle == -1) { desc->w = desc->h = 0; tce->buttoninfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", desc->filename)); + mprintf(0, "Unable to load bmp '%s'\n", desc->filename); } else { desc->w = bm_w(tce->buttoninfo.bm_handle, 0); desc->h = bm_h(tce->buttoninfo.bm_handle, 0); @@ -973,7 +973,7 @@ int CreateButtonEffect(LPTCBUTTONDESC desc, int monitor, int screen, int id) { tce->buttoninfo.bmfocus_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(desc->filename_focus), 0); if (tce->buttoninfo.bmfocus_handle == -1) { tce->buttoninfo.bmfocus_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", desc->filename_focus)); + mprintf(0, "Unable to load bmp '%s'\n", desc->filename_focus); } else { bm_CreateChunkedBitmap(tce->buttoninfo.bmfocus_handle, &tce->buttoninfo.chunkfocus_bmp); } @@ -983,7 +983,7 @@ int CreateButtonEffect(LPTCBUTTONDESC desc, int monitor, int screen, int id) { if (desc->flasher) { tce->buttoninfo.flash_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(desc->flash_filename), 0); if (tce->buttoninfo.flash_handle == -1) { - mprintf((0, "Unable to load bmp '%s'\n", desc->flash_filename)); + mprintf(0, "Unable to load bmp '%s'\n", desc->flash_filename); } else { bm_CreateChunkedBitmap(tce->buttoninfo.flash_handle, &tce->buttoninfo.flash_chunk); } @@ -995,7 +995,7 @@ int CreateButtonEffect(LPTCBUTTONDESC desc, int monitor, int screen, int id) { if (desc->flasher) { tce->buttoninfo.flashfocus_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(desc->flash_filename_focus), 0); if (tce->buttoninfo.flashfocus_handle == -1) { - mprintf((0, "Unable to load bmp '%s'\n", desc->flash_filename_focus)); + mprintf(0, "Unable to load bmp '%s'\n", desc->flash_filename_focus); } else { bm_CreateChunkedBitmap(tce->buttoninfo.flashfocus_handle, &tce->buttoninfo.flashfocus_chunk); } @@ -1109,7 +1109,7 @@ bool CreateBmpStatic(tceffect *tce, const char *filename) { tce->bmpinfo.bm_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(filename), 0); if (tce->bmpinfo.bm_handle == -1) { tce->bmpinfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", filename)); + mprintf(0, "Unable to load bmp '%s'\n", filename); } else bm_CreateChunkedBitmap(tce->bmpinfo.bm_handle, &tce->bmpinfo.chunk_bmp); return true; @@ -1122,7 +1122,7 @@ bool CreateBmpBlur(tceffect *tce, const char *filename) { tce->bmpinfo.bm_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(filename), 0); if (tce->bmpinfo.bm_handle == -1) { tce->bmpinfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", filename)); + mprintf(0, "Unable to load bmp '%s'\n", filename); } else { tce->bmpinfo.temp_bmhandle = bm_AllocBitmap(bm_w(tce->bmpinfo.bm_handle, 0), bm_h(tce->bmpinfo.bm_handle, 0), 0); if (tce->bmpinfo.temp_bmhandle == -1) @@ -1147,7 +1147,7 @@ bool CreateBmpScanline(tceffect *tce, const char *filename) { tce->bmpinfo.temp_bmhandle = BAD_BITMAP_HANDLE; if (tce->bmpinfo.bm_handle == -1) { tce->bmpinfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", filename)); + mprintf(0, "Unable to load bmp '%s'\n", filename); } else { tce->bmpinfo.temp_bmhandle = bm_AllocBitmap(bm_w(tce->bmpinfo.bm_handle, 0), bm_h(tce->bmpinfo.bm_handle, 0), 0); if (tce->bmpinfo.temp_bmhandle == -1) @@ -1167,7 +1167,7 @@ bool CreateBmpInvert(tceffect *tce, const char *filename) { tce->bmpinfo.temp_bmhandle = BAD_BITMAP_HANDLE; if (tce->bmpinfo.bm_handle == -1) { tce->bmpinfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", filename)); + mprintf(0, "Unable to load bmp '%s'\n", filename); } else { tce->bmpinfo.temp_bmhandle = bm_AllocBitmap(bm_w(tce->bmpinfo.bm_handle, 0), bm_h(tce->bmpinfo.bm_handle, 0), 0); if (tce->bmpinfo.temp_bmhandle == -1) @@ -1188,7 +1188,7 @@ bool CreateBmpStretch(tceffect *tce, const char *filename) { tce->bmpinfo.bm_count = 0; if (tce->bmpinfo.bm_handle == -1) { tce->bmpinfo.bm_handle = BAD_BITMAP_HANDLE; - mprintf((0, "Unable to load bmp '%s'\n", filename)); + mprintf(0, "Unable to load bmp '%s'\n", filename); } else { // determine how many wide we need int src_w = bm_w(tce->bmpinfo.bm_handle, 0); @@ -1267,7 +1267,7 @@ bool CreateBackground(tceffect *tce) { return true; } bool CreateSound(tceffect *tce, const char *filename) { tce->soundinfo.handle = FindSoundName(IGNORE_TABLE(filename)); if (tce->soundinfo.handle == -1) { - mprintf((0, "Unable to find sound '%s'\n", filename)); + mprintf(0, "Unable to find sound '%s'\n", filename); } return true; } diff --git a/Descent3/TelcomEffectsRender.cpp b/Descent3/TelcomEffectsRender.cpp index c5f409b6..9061f1be 100644 --- a/Descent3/TelcomEffectsRender.cpp +++ b/Descent3/TelcomEffectsRender.cpp @@ -83,21 +83,21 @@ void RenderTextStatic(tceffect *tce, float frametime, int xoff, int yoff, bool o switch (evt.id) { case TEVT_SCROLLDOWN: if (tce->textinfo.scroll_d) { - // mprintf((0,"Down Baby Down!\n")); + // mprintf(0,"Down Baby Down!\n"); tce->textinfo.line_index++; } break; case TEVT_SCROLLUP: if (tce->textinfo.line_index > 0) { - // mprintf((0,"Up Baby Up!\n")); + // mprintf(0,"Up Baby Up!\n"); tce->textinfo.line_index--; } break; case TEVT_GAINFOCUS: { - // mprintf((0,"Text %d Gain Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Gain Focus\n",tce-TCEffects); } break; case TEVT_LOSTFOCUS: { - // mprintf((0,"Text %d Lost Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Lost Focus\n",tce-TCEffects); } break; } } @@ -159,21 +159,21 @@ void RenderTextType(tceffect *tce, float frametime, int xoff, int yoff, bool ok_ switch (evt.id) { case TEVT_SCROLLDOWN: if (tce->textinfo.scroll_d) { - // mprintf((0,"Down Baby Down!\n")); + // mprintf(0,"Down Baby Down!\n"); tce->textinfo.line_index++; } break; case TEVT_SCROLLUP: if (tce->textinfo.line_index > 0) { - // mprintf((0,"Up Baby Up!\n")); + // mprintf(0,"Up Baby Up!\n"); tce->textinfo.line_index--; } break; case TEVT_GAINFOCUS: { - // mprintf((0,"Text %d Gain Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Gain Focus\n",tce-TCEffects); } break; case TEVT_LOSTFOCUS: { - // mprintf((0,"Text %d Lost Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Lost Focus\n",tce-TCEffects); } break; } } @@ -300,21 +300,21 @@ void RenderTextFade(tceffect *tce, float frametime, int xoff, int yoff, bool ok_ switch (evt.id) { case TEVT_SCROLLDOWN: if (tce->textinfo.scroll_d) { - // mprintf((0,"Down Baby Down!\n")); + // mprintf(0,"Down Baby Down!\n"); tce->textinfo.line_index++; } break; case TEVT_SCROLLUP: if (tce->textinfo.line_index > 0) { - // mprintf((0,"Up Baby Up!\n")); + // mprintf(0,"Up Baby Up!\n"); tce->textinfo.line_index--; } break; case TEVT_GAINFOCUS: { - // mprintf((0,"Text %d Gain Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Gain Focus\n",tce-TCEffects); } break; case TEVT_LOSTFOCUS: { - // mprintf((0,"Text %d Lost Focus\n",tce-TCEffects)); + // mprintf(0,"Text %d Lost Focus\n",tce-TCEffects); } break; } } @@ -634,7 +634,7 @@ void RenderBmpInvert(tceffect *tce, float frametime, int xoff, int yoff, bool ok k = 1.0; changed = false; } else if (k < 0) { - mprintf((0, "k<0 on inverse bitmap...bashing (%.2f/%.2f)\n", tce->age, tce->speed)); + mprintf(0, "k<0 on inverse bitmap...bashing (%.2f/%.2f)\n", tce->age, tce->speed); if (tce->age < 0) Int3(); if (tce->speed < 0) @@ -896,11 +896,11 @@ void RenderButton(tceffect *tce, float frametime, int xoff, int yoff, bool ok_to switch (evt.id) { case TEVT_GAINFOCUS: { int num = tce - TCEffects; - // mprintf((0,"Button: Recv'd GAIN FOCUS Event (%d)\n",num)); + // mprintf(0,"Button: Recv'd GAIN FOCUS Event (%d)\n",num); } break; case TEVT_LOSTFOCUS: { int num = tce - TCEffects; - // mprintf((0,"Button: Recv'd LOST FOCUS Event (%d)\n",num)); + // mprintf(0,"Button: Recv'd LOST FOCUS Event (%d)\n",num); } break; case TEVT_MOUSEOVER: { if (tce->flags & OBF_GLOW) { @@ -931,48 +931,48 @@ void RenderButton(tceffect *tce, float frametime, int xoff, int yoff, bool ok_to // send out the event to the appropriate system/effect switch (tce->buttoninfo.button_type) { case BUTT_UPARROW: { - // mprintf((0,"Button: Telling Text to Scroll Up\n")); + // mprintf(0,"Button: Telling Text to Scroll Up\n"); int efxnum = GetEfxNumFromID(tce->buttoninfo.parent, tce->screen); if (efxnum != -1) { SendEventToEffect(efxnum, TEVT_SCROLLUP); } } break; case BUTT_DOWNARROW: { - // mprintf((0,"Button: Telling Text to Scroll Down\n")); + // mprintf(0,"Button: Telling Text to Scroll Down\n"); int efxnum = GetEfxNumFromID(tce->buttoninfo.parent, tce->screen); if (efxnum != -1) { SendEventToEffect(efxnum, TEVT_SCROLLDOWN); } } break; case BUTT_NEXTPAGE: - // mprintf((0,"Button: Telling TelCom to go to Next Page\n")); + // mprintf(0,"Button: Telling TelCom to go to Next Page\n"); TelComSendEvent(TEVT_TCNEXT); break; case BUTT_PREVPAGE: - // mprintf((0,"Button: Telling TelCom to go to Prev Page\n")); + // mprintf(0,"Button: Telling TelCom to go to Prev Page\n"); TelComSendEvent(TEVT_TCPREV); break; case BUTT_QUIT: - // mprintf((0,"Button: Telling TelCom to go to Quit\n")); + // mprintf(0,"Button: Telling TelCom to go to Quit\n"); TelComSendEvent(TEVT_TCQUIT); break; case BUTT_JUMP: - // mprintf((0,"Button: Telling TelCom to jump to %d\n",tce->buttoninfo.jump_page)); + // mprintf(0,"Button: Telling TelCom to jump to %d\n",tce->buttoninfo.jump_page); TelComSendEvent(TEVT_TCJUMP, tce->buttoninfo.jump_page); break; case BUTT_INTERNAL: - // mprintf((0,"Button: Calling internal callback\n")); + // mprintf(0,"Button: Calling internal callback\n"); if (tce->buttoninfo.internal) tce->buttoninfo.internal((int)(tce - TCEffects)); break; default: - mprintf((0, "Button: Invalid Button Type\n")); + mprintf(0, "Button: Invalid Button Type\n"); Int3(); // invalid button type // missing JUMP!!!!!!!!!!!!!!!! }; } break; default: { - mprintf((0, "Button: Recv'd Evt %d\n", evt.id)); + mprintf(0, "Button: Recv'd Evt %d\n", evt.id); } break; }; } diff --git a/Descent3/TerrainSearch.cpp b/Descent3/TerrainSearch.cpp index 53fc118b..a70a003d 100644 --- a/Descent3/TerrainSearch.cpp +++ b/Descent3/TerrainSearch.cpp @@ -437,7 +437,7 @@ __inline void CheckCellOccupancy(int x, int y, int *ccount, uint8_t lod) { int n, simplemul, i; if (*ccount >= MAX_CELLS_TO_RENDER) { - mprintf((0, "Trying to render too many cells! Cell limit=%d\n", MAX_CELLS_TO_RENDER)); + mprintf(0, "Trying to render too many cells! Cell limit=%d\n", MAX_CELLS_TO_RENDER); #ifndef NEWEDITOR Detail_settings.Terrain_render_distance = 80.0 * TERRAIN_SIZE; #endif diff --git a/Descent3/WeaponFire.cpp b/Descent3/WeaponFire.cpp index 1641f0cc..9b5fb5a7 100644 --- a/Descent3/WeaponFire.cpp +++ b/Descent3/WeaponFire.cpp @@ -1243,14 +1243,14 @@ int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num fate = fvi_FindIntersection(&fq, &hit_data); if (fate != HIT_NONE) { - mprintf((0, "Warning: Laser from parent=%d weapon point is in a wall or object, didn't fire!\n", OBJNUM(parent))); + mprintf(0, "Warning: Laser from parent=%d weapon point is in a wall or object, didn't fire!\n", OBJNUM(parent)); return -1; } objnum = ObjCreate(OBJ_WEAPON, weapon_num, hit_data.hit_room, pos, NULL, parent->handle); if (objnum < 0) { - mprintf((1, "Can't create laser - Out of objects!\n")); + mprintf(1, "Can't create laser - Out of objects!\n"); return -1; } @@ -1358,11 +1358,11 @@ int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num obj->ctype.laser_info.hit_face = hit_info.hit_face[0]; obj->ctype.laser_info.hit_status = WPC_HIT_WALL; - // mprintf((0, "WPC: Hit r%d rw%d w%d (%f,%f,%f)\n", hit_info.hit_room, - // hit_info.hit_face_room[0], hit_info.hit_face[0], XYZ(&hit_info.hit_wallnorm[0]))); + // mprintf(0, "WPC: Hit r%d rw%d w%d (%f,%f,%f)\n", hit_info.hit_room, + // hit_info.hit_face_room[0], hit_info.hit_face[0], XYZ(&hit_info.hit_wallnorm[0])); } else { obj->ctype.laser_info.hit_status = WPC_NO_COLLISIONS; - // mprintf((0, "WPC: No collisions\n")); + // mprintf(0, "WPC: No collisions\n"); } } } @@ -1739,7 +1739,7 @@ bool WeaponCalcGun(vector *gun_point, vector *gun_normal, object *obj, int gun_n bool f_good_gp = true; if (!(obj->flags & OF_POLYGON_OBJECT)) { - // mprintf ((0,"Object type %d is not a polyobj!\n",obj->type)); + // mprintf(0,"Object type %d is not a polyobj!\n",obj->type); if (gun_point) *gun_point = obj->pos; @@ -1752,7 +1752,7 @@ bool WeaponCalcGun(vector *gun_point, vector *gun_normal, object *obj, int gun_n pm = &Poly_models[obj->rtype.pobj_info.model_num]; if (pm->n_guns == 0) { - mprintf((0, "WARNING: Object with no weapons is firing.\n", gun_num)); + mprintf(0, "WARNING: Object with no weapons is firing.\n", gun_num); if (gun_point) *gun_point = obj->pos; @@ -1766,7 +1766,7 @@ bool WeaponCalcGun(vector *gun_point, vector *gun_normal, object *obj, int gun_n SetModelAnglesAndPos(pm, normalized_time); if (gun_num < 0 || gun_num >= pm->n_guns) { - mprintf((0, "WARNING: Bashing gun num %d to 0.\n", gun_num)); + mprintf(0, "WARNING: Bashing gun num %d to 0.\n", gun_num); if (gun_point) *gun_point = obj->pos; if (gun_normal) @@ -1842,7 +1842,7 @@ int FireWeaponFromObject(object *obj, int weapon_num, int gun_num, bool f_force_ if (gun_num >= pm->n_guns) { // We don't have a gun point for this gun! - mprintf((0, "Trying to fire from gun %d...we don't have that gun!\n", gun_num)); + mprintf(0, "Trying to fire from gun %d...we don't have that gun!\n", gun_num); laser_pos = obj->pos; laser_dir = obj->orient.fvec; } else { @@ -2655,7 +2655,7 @@ void DrawWeaponObject(object *obj) { // Stops any on/off weapons that are firing void StopOnOffWeapon(object *obj) { - // mprintf ((0,"Stopping on/off weapon!\n")); + // mprintf(0,"Stopping on/off weapon!\n"); obj->weapon_fire_flags &= ~WFF_ON_OFF; if (Demo_flags == DF_RECORDING) { @@ -2665,7 +2665,7 @@ void StopOnOffWeapon(object *obj) { // Starts an on/off weapon firing void StartOnOffWeapon(object *obj, uint8_t wb_index) { - // mprintf ((0,"Starting on/off weapon!\n")); + // mprintf(0,"Starting on/off weapon!\n"); obj->weapon_fire_flags |= WFF_ON_OFF; dynamic_wb_info *p_dwb = &obj->dynamic_wb[wb_index]; @@ -3224,7 +3224,7 @@ void CreateRobotSpawnFromWeapon(object *obj) { return; // clients do not create robots without the servers permission if (wp->robot_spawn_handle == -1) { - mprintf((0, "Trying to create an invalid robot spawn!\n")); + mprintf(0, "Trying to create an invalid robot spawn!\n"); return; } object *parent_obj = ObjGetUltimateParent(obj); diff --git a/Descent3/aipath.cpp b/Descent3/aipath.cpp index 98e3a1b8..a10ad9ad 100644 --- a/Descent3/aipath.cpp +++ b/Descent3/aipath.cpp @@ -43,12 +43,12 @@ static void AIUpdatePathInfo(q_item **node_list, int start, int end) { AIAltPathNumNodes = 0; - // mprintf((0, "start crash loop\n")); + // mprintf(0, "start crash loop\n"); while (cur_room != -1) { AIAltPath[AIAltPathNumNodes++] = cur_room; cur_room = node_list[cur_room]->parent; } - // mprintf((0, "end crash loop\n")); + // mprintf(0, "end crash loop\n"); // Reverse the list (so it is what we want) for (i = 0; i < (AIAltPathNumNodes >> 1); i++) { @@ -73,7 +73,7 @@ bool AIFindAltPath(object *obj, int i, int j, float *dist) { q_item *node_list[MAX_ROOMS + 8]; - // mprintf((0, "AI: Finding an alternate path from %d to %d\n", i, j)); + // mprintf(0, "AI: Finding an alternate path from %d to %d\n", i, j); if (i == -1 || j == -1) { delete start_node; @@ -173,7 +173,7 @@ bool AIFindAltPath(object *obj, int i, int j, float *dist) { // Mark as an impossible path. - // mprintf((0, "Found an impossible path\n")); + // mprintf(0, "Found an impossible path\n"); done: for (counter = 0; counter < MAX_ROOMS + 8; counter++) { @@ -201,7 +201,7 @@ done: } } - // mprintf((0, "Done\n")); + // mprintf(0, "Done\n"); return f_found; } @@ -356,14 +356,14 @@ void AIPathMoveTurnTowardsNode(object *obj, vector *mdir, bool *f_moved) { vector cur_pos; AIPathGetCurrentNodePos(aip, &cur_pos); - // mprintf((0, "Cur pos = %f,%f,%f\n", XYZ(&cur_pos))); + // mprintf(0, "Cur pos = %f,%f,%f\n", XYZ(&cur_pos)); - // mprintf((0, "1 R %d, Goal p %d, n %d\n", f_reverse, p, n)); + // mprintf(0, "1 R %d, Goal p %d, n %d\n", f_reverse, p, n); - // mprintf((0, "s %f, %f, %f\n", XYZ(&obj->pos))); - // mprintf((0, "l %f, %f, %f\n", XYZ(&obj->last_pos))); + // mprintf(0, "s %f, %f, %f\n", XYZ(&obj->pos)); + // mprintf(0, "l %f, %f, %f\n", XYZ(&obj->last_pos)); - // mprintf((0, "%d is at Node %d\n", OBJNUM(obj), n)); + // mprintf(0, "%d is at Node %d\n", OBJNUM(obj), n); bool f_force_complete_stopping = false; @@ -389,14 +389,14 @@ void AIPathMoveTurnTowardsNode(object *obj, vector *mdir, bool *f_moved) { } // removed check if(f_reverse && (path_info->next_node < path_info->start_node)) // removed check { - // removed check mprintf((0, "AI ERROR: Fixed a bad predefined path next_node to goal_node")); + // removed check mprintf(0, "AI ERROR: Fixed a bad predefined path next_node to goal_node"); // removed check path_info->next_node = path_info->start_node; // removed check Int3(); // removed check } // removed check // removed check if(!(f_reverse) && path_info->next_node > path_info->end_node) // removed check { - // removed check mprintf((0, "AI ERROR: Fixed a bad predefined path next_node to goal_node")); + // removed check mprintf(0, "AI ERROR: Fixed a bad predefined path next_node to goal_node"); // removed check path_info->next_node = path_info->end_node; // removed check Int3(); // removed check } @@ -490,33 +490,33 @@ pass_node: } if (f_pass_node) { - // mprintf((0, "f_pass_node\n")); + // mprintf(0, "f_pass_node\n"); if (((f_reverse) && AIPathAtStart(aip)) || ((!f_reverse) && AIPathAtEnd(aip))) { - // mprintf((0, "At end node: ")); + // mprintf(0, "At end node: "); switch (g_ptr->flags & GFM_END_OF_PATH) { case GF_PATH_REVERSE_AT_END: - // mprintf((0, "End reverse dir\n")); + // mprintf(0, "End reverse dir\n"); if (f_reverse) g_ptr->flags &= ~GF_PATH_MOVE_REVERSE_DIR; else g_ptr->flags |= GF_PATH_MOVE_REVERSE_DIR; return; case GF_PATH_CIRCLE_AT_END: - // mprintf((0, "End circle dir\n")); + // mprintf(0, "End circle dir\n"); if (f_reverse) AIPathSetAtEnd(aip); else AIPathSetAtStart(aip); return; default: - // mprintf((0, "End kill goal\n")); + // mprintf(0, "End kill goal\n"); AIPathComplete(obj); return; } } else { - // mprintf((0, "Passed node\n")); + // mprintf(0, "Passed node\n"); if (g_ptr->flags & GF_PATH_MOVE_REVERSE_DIR) AIPathMoveToPrevNode(aip); else @@ -568,7 +568,7 @@ static bool AIPathGetDPathSlot(int *slot, int handle) { } } - mprintf((0, "Out of dynamic paths")); + mprintf(0, "Out of dynamic paths"); ASSERT(0); // -- get chris return false; } @@ -605,7 +605,7 @@ static bool AIPathAddDPath(ai_path_info *aip, int handle) { bool status; if (aip->num_paths >= MAX_JOINED_PATHS) { - mprintf((0, "AI ERROR: Tried to join too many paths (Adding dpath)\n")); + mprintf(0, "AI ERROR: Tried to join too many paths (Adding dpath)\n"); return false; } @@ -630,7 +630,7 @@ static bool AIPathAddStaticPath(ai_path_info *aip, int path_id, int start_index, // chrishack -- validation code is needed if (aip->num_paths >= MAX_JOINED_PATHS) { - mprintf((0, "AI ERROR: Tried to join too many paths (Adding spath)\n")); + mprintf(0, "AI ERROR: Tried to join too many paths (Adding spath)\n"); return false; } @@ -1019,7 +1019,7 @@ bool AIPathAllocPath(object *obj, ai_frame *ai_info, void *goal_ptr, int *start_ #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(aip); @@ -1105,7 +1105,7 @@ bool AIPathAllocPath(object *obj, ai_frame *ai_info, void *goal_ptr, int *start_ AIGenerateAltBOAPath(start_pos, end_pos, aip, &slot, &cur_node, handle); if (!f_path_exists) { - mprintf((0, "Warning Alt path from %d to %d failed.\n", *start_room, *end_room)); + mprintf(0, "Warning Alt path from %d to %d failed.\n", *start_room, *end_room); } } } else if (!f_bline_ok) { @@ -1137,11 +1137,11 @@ bool AIPathAllocPath(object *obj, ai_frame *ai_info, void *goal_ptr, int *start_ } else { f_path_exists = false; // if(!(0x80000000 & *start_room) || !(0x80000000 & *end_room)) - // mprintf((0, "No path available from %d to %d\n", *start_room, *end_room)); + // mprintf(0, "No path available from %d to %d\n", *start_room, *end_room); #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif @@ -1150,13 +1150,13 @@ bool AIPathAllocPath(object *obj, ai_frame *ai_info, void *goal_ptr, int *start_ } } else { f_path_exists = false; - mprintf((0, "No dynamic paths left\n")); + mprintf(0, "No dynamic paths left\n"); } if (!f_path_exists) { #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif @@ -1174,7 +1174,7 @@ bool AIPathSetAsStaticPath(object *obj, void *goal_ptr, int path_id, int start_n #ifdef _DEBUG if (AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) { - mprintf((0, "AI Note: In free path\n")); + mprintf(0, "AI Note: In free path\n"); } #endif AIPathFreePath(aip); @@ -1230,7 +1230,7 @@ bool MakeTestPath(int *start_room, vector *pos) { // #ifdef _DEBUG // if(AI_debug_robot_do && OBJNUM(obj) == AI_debug_robot_index) // { - // mprintf((0, "AI Note: In free path\n")); + // mprintf(0, "AI Note: In free path\n"); // } // #endif AIPathFreePath(&ai_info.path); diff --git a/Descent3/args.cpp b/Descent3/args.cpp index 608725a4..79614a2c 100644 --- a/Descent3/args.cpp +++ b/Descent3/args.cpp @@ -71,7 +71,7 @@ void GatherArgs(const char *str) { TotalArgs = curarg; for (int q = 0; q < TotalArgs; q++) - mprintf((0, "GatherArgs: Arg (%d) is [%s].", q, GameArgs[q])); + mprintf(0, "GatherArgs: Arg (%d) is [%s].", q, GameArgs[q]); } void GatherArgs(char **argv) { @@ -83,7 +83,7 @@ void GatherArgs(char **argv) { } // for for (int q = 0; q < TotalArgs; q++) - mprintf((0, "GatherArgs: Arg (%d) is [%s].", q, GameArgs[q])); + mprintf(0, "GatherArgs: Arg (%d) is [%s].", q, GameArgs[q]); } // GatherArgs // Strip '-', '--', and '+' flag prefix, so --foo, -foo, +foo => foo, but pass through - -- + ++ @@ -113,12 +113,12 @@ int FindArg(const char *which) { for (int i = 1; i <= TotalArgs; i++) { if (which_matches(GameArgs[i])) { - mprintf((0, "FindArg: Found [%s] at argument index (%d).", which, i)); + mprintf(0, "FindArg: Found [%s] at argument index (%d).", which, i); return i; } } - mprintf((0, "FindArg: Did not find [%s] on command line.", which)); + mprintf(0, "FindArg: Did not find [%s] on command line.", which); return 0; } @@ -127,7 +127,7 @@ int FindArgChar(const char *which, char singleCharArg) { for (int i = 1; i <= TotalArgs; i++) { char *str = GameArgs[i]; if (str[0] == '-' && str[1] == singleCharArg && str[2] == '\0') { - mprintf((0, "FindArg: Found [-%c] at argument index (%d).", singleCharArg, i)); + mprintf(0, "FindArg: Found [-%c] at argument index (%d).", singleCharArg, i); return i; } } diff --git a/Descent3/attach.cpp b/Descent3/attach.cpp index 50653cdc..da442d40 100644 --- a/Descent3/attach.cpp +++ b/Descent3/attach.cpp @@ -155,7 +155,7 @@ static bool AttachPointPos(object *obj, char ap, bool f_compute_pos, vector *att pm = &Poly_models[obj->rtype.pobj_info.model_num]; if (ap < 0 || ap >= pm->n_attach) { - mprintf((0, "WARNING: No ap %d on object %d.\n", ap, OBJNUM(obj))); + mprintf(0, "WARNING: No ap %d on object %d.\n", ap, OBJNUM(obj)); return false; } @@ -167,14 +167,14 @@ static bool AttachPointPos(object *obj, char ap, bool f_compute_pos, vector *att if (f_compute_fvec) { normal = pm->attach_slots[ap].norm; - // mprintf((0, "Original fvec is %f long.\n", vm_GetMagnitude(&normal))); + // mprintf(0, "Original fvec is %f long.\n", vm_GetMagnitude(&normal)); } if (pm->attach_slots[ap].f_uvec && attach_uvec && f_computed_uvec) { *f_computed_uvec = true; uvec = pm->attach_slots[ap].uvec; - // mprintf((0, "Original uvec is %f long.\n", vm_GetMagnitude(&uvec))); + // mprintf(0, "Original uvec is %f long.\n", vm_GetMagnitude(&uvec)); } else if (f_computed_uvec) { *f_computed_uvec = false; } @@ -213,12 +213,12 @@ static bool AttachPointPos(object *obj, char ap, bool f_compute_pos, vector *att if (f_compute_fvec) { *attach_fvec = normal * m; - // mprintf((0, "Rotated fvec is %f long.\n", vm_GetMagnitude(attach_fvec))); + // mprintf(0, "Rotated fvec is %f long.\n", vm_GetMagnitude(attach_fvec)); } if (f_computed_uvec && *f_computed_uvec) { *attach_uvec = uvec * m; - // mprintf((0, "Rotated uvec is %f long.\n", vm_GetMagnitude(attach_uvec))); + // mprintf(0, "Rotated uvec is %f long.\n", vm_GetMagnitude(attach_uvec)); } if (f_compute_pos) @@ -478,12 +478,12 @@ bool AttachObject(object *parent, char parent_ap, object *child, char child_ap, poly_model *child_pm = &Poly_models[child->rtype.pobj_info.model_num]; if (parent_ap < 0 || parent_ap >= parent_pm->n_attach) { - mprintf((0, "ATTACH: Parent AP invalid\n")); + mprintf(0, "ATTACH: Parent AP invalid\n"); return false; } if (child->flags & OF_ATTACHED) { - mprintf((0, "ATTACH: Child already attached to someone\n")); + mprintf(0, "ATTACH: Child already attached to someone\n"); return false; } @@ -511,11 +511,11 @@ bool AttachObject(object *parent, char parent_ap, object *child, char child_ap, return true; } - mprintf((0, "ATTACH: AP attach failed\n")); + mprintf(0, "ATTACH: AP attach failed\n"); return false; } - mprintf((0, "ATTACH: Child AP (%d) - child only has %d attach points\n", child_ap, child_pm->n_attach)); + mprintf(0, "ATTACH: Child AP (%d) - child only has %d attach points\n", child_ap, child_pm->n_attach); return false; } @@ -529,12 +529,12 @@ bool AttachObject(object *parent, char parent_ap, object *child, float percent_r poly_model *child_pm = &Poly_models[parent->rtype.pobj_info.model_num]; if (parent_ap < 0 || parent_ap >= parent_pm->n_attach) { - mprintf((0, "ATTACH: Parent AP invalid\n")); + mprintf(0, "ATTACH: Parent AP invalid\n"); return false; } if (child->flags & OF_ATTACHED) { - mprintf((0, "ATTACH: Child already attached to someone\n")); + mprintf(0, "ATTACH: Child already attached to someone\n"); return false; } @@ -573,11 +573,11 @@ bool AttachObject(object *parent, char parent_ap, object *child, float percent_r return true; } - mprintf((0, "ATTACH: RAD attach failed\n")); + mprintf(0, "ATTACH: RAD attach failed\n"); return false; } - mprintf((0, "ATTACH: Child percent rad is invalid\n")); + mprintf(0, "ATTACH: Child percent rad is invalid\n"); return false; } diff --git a/Descent3/audiotaunts.cpp b/Descent3/audiotaunts.cpp index 410e3551..888d5d11 100644 --- a/Descent3/audiotaunts.cpp +++ b/Descent3/audiotaunts.cpp @@ -109,7 +109,7 @@ bool taunt_PlayPlayerTaunt(int pnum, int index) { return false; if (index < 0 || index > 3) { - mprintf((0, "TAUNT: invalid index %d\n", index)); + mprintf(0, "TAUNT: invalid index %d\n", index); return false; } @@ -134,7 +134,7 @@ bool taunt_PlayPlayerTaunt(int pnum, int index) { ddio_MakePath(fullpath, LocalCustomSoundsDir, file, NULL); if (!cfexist(fullpath)) { - mprintf((0, "TAUNT: file %s doesn't exist (pnum=%d)\n", fullpath, pnum)); + mprintf(0, "TAUNT: file %s doesn't exist (pnum=%d)\n", fullpath, pnum); return false; } @@ -238,14 +238,14 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { // first make sure the wave file exists if (!cfexist(wave_filename)) { - mprintf((0, "AudioTaunt: Can't Import wav, missing %s\n", wave_filename)); + mprintf(0, "AudioTaunt: Can't Import wav, missing %s\n", wave_filename); TauntLastError = TAUNTIMPERR_NOTFOUND; return false; } // make sure the output file doesn't exist so we don't overwrite if (cfexist(outputfilename)) { - mprintf((0, "AudioTaunt: Can't Import wav, %s already exists\n", outputfilename)); + mprintf(0, "AudioTaunt: Can't Import wav, %s already exists\n", outputfilename); TauntLastError = TAUNTIMPERR_OSFEXISTS; return false; } @@ -253,7 +253,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { // Open the file and import char wave_ret = taunt_LoadWaveFile(wave_filename, &wavdata); if (wave_ret != 0) { - mprintf((0, "TAUNT: Unable to load wave\n")); + mprintf(0, "TAUNT: Unable to load wave\n"); switch (wave_ret) { case 1: TauntLastError = TAUNTIMPERR_NOTFOUND; @@ -293,7 +293,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { // file. if (!ddio_GetTempFileName(Descent3_temp_directory, "d3o", temp_filename)) { - mprintf((0, "TAUNT: Unable to create temp filename\n")); + mprintf(0, "TAUNT: Unable to create temp filename\n"); ret = false; TauntLastError = TAUNTIMPERR_INTERNALERR; goto error; @@ -301,7 +301,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { file = cfopen(temp_filename, "wb"); if (!file) { - mprintf((0, "TAUNT: Unable to open temp filename\n")); + mprintf(0, "TAUNT: Unable to open temp filename\n"); ret = false; TauntLastError = TAUNTIMPERR_INTERNALERR; goto error; @@ -321,11 +321,11 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { cf_WriteBytes((uint8_t *)wavdata.sample_16bit,amount_to_flush,file); }else{ - mprintf((0,"TAUNT: Confusion to bits per sample (%d)\n",wavdata.bits_per_sample)); + mprintf(0,"TAUNT: Confusion to bits per sample (%d)\n",wavdata.bits_per_sample); ret = false; goto error; } - mprintf((0,"TAUNT: Wrote to temp file %s\n",temp_filename)); + mprintf(0,"TAUNT: Wrote to temp file %s\n",temp_filename); cfclose(file); file = NULL; */ @@ -348,7 +348,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { chan = wavdata.number_channels; if (!ddio_GetTempFileName(Descent3_temp_directory, "d3o", osftemp_filename)) { - mprintf((0, "TAUNT: Unable to create osftemp filename\n")); + mprintf(0, "TAUNT: Unable to create osftemp filename\n"); TauntLastError = TAUNTIMPERR_INTERNALERR; ret = false; goto error; @@ -356,7 +356,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { if (!aenc_Compress(temp_filename, osftemp_filename, NULL, &samples, &rate, &chan, NULL, NULL)) { // unable to compress - mprintf((0, "Unable to compress\n")); + mprintf(0, "Unable to compress\n"); ret = false; TauntLastError = TAUNTIMPERR_COMPRESSIONFAILURE; goto error; @@ -372,14 +372,14 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { StaticFileBuffer = (uint8_t *)mem_malloc(FILEBUFFER_LENGTH); if (!StaticFileBuffer) { ret = false; - mprintf((0, "Out of memory\n")); + mprintf(0, "Out of memory\n"); TauntLastError = TAUNTIMPERR_OUTOFMEM; goto error; } fpin = cfopen(osftemp_filename, "rb"); if (!fpin) { - mprintf((0, "Unable to open temp file to make osf\n")); + mprintf(0, "Unable to open temp file to make osf\n"); ret = false; TauntLastError = TAUNTIMPERR_INTERNALERR; goto error; @@ -390,7 +390,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { if (!osf.Open(outputfilename, true)) { ret = false; - mprintf((0, "Unable to open osf to write\n")); + mprintf(0, "Unable to open osf to write\n"); TauntLastError = TAUNTIMPERR_NOOPENOSF; goto error; } @@ -399,13 +399,13 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { // write out data. for (i = 0; i < nblocks; i++) { if (!cf_ReadBytes(StaticFileBuffer, FILEBUFFER_LENGTH, fpin)) { - mprintf((0, "Error reading from osf temp\n")); + mprintf(0, "Error reading from osf temp\n"); ret = false; TauntLastError = TAUNTIMPERR_INTERNALERR; goto error; } if (!osf.WriteBlock(StaticFileBuffer, FILEBUFFER_LENGTH)) { - mprintf((0, "Error writing to osf\n")); + mprintf(0, "Error writing to osf\n"); TauntLastError = TAUNTIMPERR_INTERNALERR; ret = false; goto error; @@ -414,13 +414,13 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { if (filelen % FILEBUFFER_LENGTH) { if (!cf_ReadBytes(StaticFileBuffer, filelen % FILEBUFFER_LENGTH, fpin)) { - mprintf((0, "Error reading from osf temp\n")); + mprintf(0, "Error reading from osf temp\n"); TauntLastError = TAUNTIMPERR_INTERNALERR; ret = false; goto error; } if (!osf.WriteBlock(StaticFileBuffer, filelen % FILEBUFFER_LENGTH)) { - mprintf((0, "Error writing to osf\n")); + mprintf(0, "Error writing to osf\n"); TauntLastError = TAUNTIMPERR_INTERNALERR; ret = false; goto error; @@ -447,7 +447,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { ddio_SplitPath(outputfilename, NULL, osftitle, NULL); if (!osf.SaveHeader(OSF_DIGITAL_STRM, OSF_DIGIACM_STRM, format, samples, filelen, &digihdr, osftitle)) { - mprintf((0, "Failed to write out OSF header info.")); + mprintf(0, "Failed to write out OSF header info."); TauntLastError = TAUNTIMPERR_INTERNALERR; ret = false; goto error; @@ -525,7 +525,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { // Open the wave file if ((cfptr = cfopen(filename, "rb")) == NULL) { error_code = 1; - mprintf((0, "TAUNT: Wav %s not found\n", filename)); + mprintf(0, "TAUNT: Wav %s not found\n", filename); goto error_state; } @@ -533,7 +533,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x46464952) { error_code = 2; - mprintf((0, "TAUNT: Wav Load: %s is not a RIFF format file\n", filename)); + mprintf(0, "TAUNT: Wav Load: %s is not a RIFF format file\n", filename); goto error_state; } @@ -545,7 +545,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x45564157) { error_code = 3; - mprintf((0, "TAUNT: Wav Load: %s is not a WAVE file\n", filename)); + mprintf(0, "TAUNT: Wav Load: %s is not a WAVE file\n", filename); goto error_state; } nextseek = cftell(cfptr); @@ -561,7 +561,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { cksize = cf_ReadInt(cfptr); if (cksize <= 0) { error_code = 4; - mprintf((0, "TAUNT: Wav Load: %s has an invalid block length\n", filename)); + mprintf(0, "TAUNT: Wav Load: %s has an invalid block length\n", filename); goto error_state; } @@ -574,7 +574,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { // Make sure that this format was not preceeded by another format without data inbetween them. if (f_fmt) { error_code = 5; - mprintf((0, "TAUNT: Wav Load: Found 2 formats in a row in file %s\n", filename)); + mprintf(0, "TAUNT: Wav Load: Found 2 formats in a row in file %s\n", filename); goto error_state; } @@ -646,8 +646,8 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { // Currently, we only support PCM wave files if (fmttag != 0x0001) { error_code = 6; - mprintf((0, "TAUNT Wav Load: %s is a type %s wavefile, we only support WAVE_FORMAT_PCM waves.\n", filename, - format_type)); + mprintf(0, "TAUNT Wav Load: %s is a type %s wavefile, we only support WAVE_FORMAT_PCM waves.\n", + filename,format_type); goto error_state; } @@ -655,8 +655,8 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { number_channels = cf_ReadShort(cfptr); if (number_channels != 1) { error_code = 7; - mprintf((0, "TAUNT Wav Load: Invalid number of channels(%d)in %s, we want mono samples only.\n", - number_channels, filename)); + mprintf(0, "TAUNT Wav Load: Invalid number of channels(%d)in %s, we want mono samples only.\n", + number_channels, filename); goto error_state; } @@ -664,8 +664,8 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { samples_per_second = cf_ReadInt(cfptr); if (samples_per_second != 22050) { error_code = 8; - mprintf((0, "TAUNT Wav Load: Invalid sample per second(%d)in %s, we want 22k samples only.\n", - samples_per_second, filename)); + mprintf(0, "TAUNT Wav Load: Invalid sample per second(%d)in %s, we want 22k samples only.\n", + samples_per_second, filename); goto error_state; } @@ -679,8 +679,8 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { bits_per_sample = cf_ReadShort(cfptr); if (bits_per_sample != 8 && bits_per_sample != 16) { error_code = 9; - mprintf((0, "TAUNT Wav Load: Invalid bits per sample(%d)in %s, we want 8 or 16 bit samples only.\n", - bits_per_sample, filename)); + mprintf(0, "TAUNT Wav Load: Invalid bits per sample(%d)in %s, we want 8 or 16 bit samples only.\n", + bits_per_sample, filename); goto error_state; } @@ -693,7 +693,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { case 0x61746164: if (!f_fmt) { error_code = 5; - mprintf((0, "TAUNT Wav Load: Format Chunk not defined before Data Chunk\n")); + mprintf(0, "TAUNT Wav Load: Format Chunk not defined before Data Chunk\n"); goto error_state; } diff --git a/Descent3/bnode.cpp b/Descent3/bnode.cpp index c212879f..68b3804e 100644 --- a/Descent3/bnode.cpp +++ b/Descent3/bnode.cpp @@ -185,12 +185,12 @@ static void BNode_UpdatePathInfo(pq_item **node_list, int start, int end) { BNode_PathNumNodes = 0; - // mprintf((0, "start crash loop\n")); + // mprintf(0, "start crash loop\n"); while (cur_node != -1) { BNode_Path[BNode_PathNumNodes++] = cur_node; cur_node = node_list[cur_node]->p_node; } - // mprintf((0, "end crash loop\n")); + // mprintf(0, "end crash loop\n"); // Reverse the list (so it is what we want) for (i = 0; i < (BNode_PathNumNodes >> 1); i++) { @@ -203,7 +203,7 @@ static void BNode_UpdatePathInfo(pq_item **node_list, int start, int end) { /* for(i = 0; i < BNode_PathNumNodes; i++) { - mprintf((0, "Node %d\n", BNode_Path[i])); + mprintf(0, "Node %d\n", BNode_Path[i]); } */ } @@ -216,7 +216,7 @@ bool BNode_FindPath(int start_room, int i, int j, float rad) { pq_item *cur_node; bool f_found = false; - // mprintf((0, "++++++++++\nFind path from %d to %d in room %d\n", i, j, start_room)); + // mprintf(0, "++++++++++\nFind path from %d to %d in room %d\n", i, j, start_room); start_room = BOA_INDEX(start_room); diff --git a/Descent3/bsp.cpp b/Descent3/bsp.cpp index f82f90c9..0654e5a9 100644 --- a/Descent3/bsp.cpp +++ b/Descent3/bsp.cpp @@ -166,7 +166,7 @@ bsppolygon *NewPolygon(int roomnum, int facenum, int numverts) { newpoly = (bsppolygon *)mem_malloc(sizeof(bsppolygon)); if (newpoly == NULL) { - mprintf((0, "NewPolygon: Couldn't allocate polygon\n")); + mprintf(0, "NewPolygon: Couldn't allocate polygon\n"); return NULL; } @@ -470,7 +470,7 @@ bsppolygon *SelectPlane(list **polylist) { * the other polygons. But don't check it against itself */ - mprintf_at((2, 4, 0, "Plane = %c", Twirly[(Plane_twirl++) % 4])); + mprintf_at(2, 4, 0, "Plane = %c", Twirly[(Plane_twirl++) % 4]); for (outer = *polylist; outer != NULL; outer = outer->next) { outerpoly = (bsppolygon *)outer->data; @@ -540,7 +540,7 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { ASSERT(numpolys > 0); partition_poly = SelectPlane(polylist); - mprintf_at((2, 5, 0, "Node = %c", Twirly[(Node_twirl++) % 4])); + mprintf_at(2, 5, 0, "Node = %c", Twirly[(Node_twirl++) % 4]); if (partition_poly == NULL) { // We hit a leaf! Fill in the appropriate leaf stuff @@ -603,12 +603,12 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { } else { - mprintf ((0,"Ins/outs don't match! ins=%d outs=%d np=%d\n",ins,outs,numpolys)); + mprintf(0,"Ins/outs don't match! ins=%d outs=%d np=%d\n",ins,outs,numpolys); for (i=0;iroomnum,thispoly->facenum)); + mprintf(0,"Poly %d: Room=%d facenum=%d\n",i,thispoly->roomnum,thispoly->facenum); } if (ins>outs) @@ -688,16 +688,16 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { } } - // mprintf ((0,"BuildBSPNode: Incoming=%d numfront=%d numback=%d splits=%d\n",numpolys,numfront,numback,numsplits)); + // mprintf(0,"BuildBSPNode: Incoming=%d numfront=%d numback=%d splits=%d\n",numpolys,numfront,numback,numsplits); if (frontlist != NULL) { if ((frontnode = NewBSPNode()) == NULL) { - mprintf((0, "BuildBSPNode: Error, can't allocate front node\n")); + mprintf(0, "BuildBSPNode: Error, can't allocate front node\n"); return 0; } if (!BuildBSPNode((bspnode *)frontnode, &frontlist, numfront)) { - mprintf((0, "BuildBSPNode: Error building front node\n")); + mprintf(0, "BuildBSPNode: Error building front node\n"); return 0; } @@ -705,7 +705,7 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { DestroyList(&frontlist); } else { if ((frontnode = NewBSPNode()) == NULL) { - mprintf((0, "BuildBSPNode: Error, can't allocate front node\n")); + mprintf(0, "BuildBSPNode: Error, can't allocate front node\n"); return 0; } frontnode->type = BSP_EMPTY_LEAF; @@ -714,12 +714,12 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { if (backlist != NULL) { if ((backnode = NewBSPNode()) == NULL) { - mprintf((0, "BuildBSPNode: Error, can't allocate front node\n")); + mprintf(0, "BuildBSPNode: Error, can't allocate front node\n"); return 0; } if (!BuildBSPNode((bspnode *)backnode, &backlist, numback)) { - mprintf((0, "BuildBSPNode: Error building back node\n")); + mprintf(0, "BuildBSPNode: Error building back node\n"); return 0; } @@ -727,7 +727,7 @@ int BuildBSPNode(bspnode *tree, list **polylist, int numpolys) { DestroyList(&backlist); } else { if ((backnode = NewBSPNode()) == NULL) { - mprintf((0, "BuildBSPNode: Error, can't allocate front node\n")); + mprintf(0, "BuildBSPNode: Error, can't allocate front node\n"); return 0; } @@ -764,7 +764,7 @@ void DestroyBSPTree(bsptree *tree) { if (BSP_initted == 0) return; - mprintf((0, "Destroying bsptree!\n")); + mprintf(0, "Destroying bsptree!\n"); DestroyBSPNode(tree->root); BSP_initted = 0; } @@ -789,7 +789,7 @@ void BuildBSPTree() { check = BSPGetMineChecksum(); if (check == BSPChecksum) { - mprintf((0, "BSP tree already built!\n")); + mprintf(0, "BSP tree already built!\n"); return; // The BSP tree has already been built for this mine } @@ -801,9 +801,9 @@ void BuildBSPTree() { MineBSP.root = NewBSPNode(); ASSERT(MineBSP.root); - mprintf((0, "Building BSP Tree...\n")); + mprintf(0, "Building BSP Tree...\n"); - mprintf((0, "Adding polygons to tree\n")); + mprintf(0, "Adding polygons to tree\n"); // Go through the whole mine and add each polygon to the possible BSP // partition list. Don't include portals... @@ -841,7 +841,7 @@ void BuildBSPTree() { newpoly = NewPolygon(i, t, sm->faces[j].nverts); if (!newpoly) { - mprintf((0, "Couldn't get a new polygon!\n")); + mprintf(0, "Couldn't get a new polygon!\n"); Int3(); return; } @@ -890,7 +890,7 @@ void BuildBSPTree() { // Construct a new polygon newpoly = NewPolygon(i, t, Rooms[i].faces[t].num_verts); if (!newpoly) { - mprintf((0, "Couldn't get a new polygon!\n")); + mprintf(0, "Couldn't get a new polygon!\n"); Int3(); return; } @@ -923,16 +923,16 @@ void BuildBSPTree() { Solids = 0; Empty = 0; - mprintf((0, "%d polygons added, starting node building...\n", numpolys)); + mprintf(0, "%d polygons added, starting node building...\n", numpolys); // Build the BSP tree! BuildBSPNode(MineBSP.root, &MineBSP.polylist, numpolys); DestroyList(&MineBSP.polylist); // Print some stats - mprintf((0, "Total number of convex subspaces=%d\n", ConvexSubspaces)); - mprintf((0, "Total number of convex polys=%d\n", ConvexPolys)); - mprintf((0, "Solid=%d Empty=%d\n", Solids, Empty)); + mprintf(0, "Total number of convex subspaces=%d\n", ConvexSubspaces); + mprintf(0, "Total number of convex polys=%d\n", ConvexPolys); + mprintf(0, "Solid=%d Empty=%d\n", Solids, Empty); } // Builds a bsp tree for a single room @@ -949,7 +949,7 @@ void BuildSingleBSPTree(int roomnum) { MineBSP.root = NewBSPNode(); ASSERT(MineBSP.root); - mprintf((0, "Building BSP Tree...\n")); + mprintf(0, "Building BSP Tree...\n"); // Go through the whole mine and add each polygon to the possible BSP // partition list. Don't include portals... @@ -983,7 +983,7 @@ void BuildSingleBSPTree(int roomnum) { vector world_verts[64]; newpoly = NewPolygon(i, t, sm->faces[j].nverts); if (!newpoly) { - mprintf((0, "Couldn't get a new polygon!\n")); + mprintf(0, "Couldn't get a new polygon!\n"); Int3(); return; } @@ -1023,7 +1023,7 @@ void BuildSingleBSPTree(int roomnum) { // Construct a new polygon newpoly = NewPolygon(i, t, Rooms[i].faces[t].num_verts); if (!newpoly) { - mprintf((0, "Couldn't get a new polygon!\n")); + mprintf(0, "Couldn't get a new polygon!\n"); Int3(); return; } @@ -1054,9 +1054,9 @@ void BuildSingleBSPTree(int roomnum) { DestroyList(&MineBSP.polylist); // Print some stats - mprintf((0, "Total number of convex subspaces=%d\n", ConvexSubspaces)); - mprintf((0, "Total number of convex polys=%d\n", ConvexPolys)); - mprintf((0, "Solid=%d Empty=%d\n", Solids, Empty)); + mprintf(0, "Total number of convex subspaces=%d\n", ConvexSubspaces); + mprintf(0, "Total number of convex polys=%d\n", ConvexPolys); + mprintf(0, "Solid=%d Empty=%d\n", Solids, Empty); BSPChecksum = -1; } diff --git a/Descent3/buddymenu.cpp b/Descent3/buddymenu.cpp index 38df0aa5..4b4939a2 100644 --- a/Descent3/buddymenu.cpp +++ b/Descent3/buddymenu.cpp @@ -363,7 +363,7 @@ void MultiDoGuidebotMenuData(uint8_t *data) { Guidebot_data_download_status = 1; Multi_bail_ui_menu = true; - mprintf((0, "Recieved Guidebot data from server\n")); + mprintf(0, "Recieved Guidebot data from server\n"); } // downloads data for the buddybot diff --git a/Descent3/cinematics.cpp b/Descent3/cinematics.cpp index 63be080c..10749057 100644 --- a/Descent3/cinematics.cpp +++ b/Descent3/cinematics.cpp @@ -117,7 +117,7 @@ bool PlayMovie(const char *moviename) { bool retval = true; if (mveerr != MVELIB_NOERROR) { - mprintf((1, "Movie error %d.\n", mveerr)); + mprintf(1, "Movie error %d.\n", mveerr); retval = false; } diff --git a/Descent3/cockpit.cpp b/Descent3/cockpit.cpp index 9a6b8e54..a3c51836 100644 --- a/Descent3/cockpit.cpp +++ b/Descent3/cockpit.cpp @@ -250,7 +250,7 @@ static void LoadCockpitInfo(const char *ckt_file, tCockpitCfgInfo *info); void InitCockpit(int ship_index) { tCockpitCfgInfo cfginfo; int i; - mprintf((0, "Initializing cockpit.\n")); + mprintf(0, "Initializing cockpit.\n"); LoadCockpitInfo(Ships[ship_index].cockpit_name, &cfginfo); // initialize special hud/cockpit images unique to this ship for (i = 0; i < NUM_SHIELD_GAUGE_FRAMES; i++) { @@ -263,7 +263,7 @@ void InitCockpit(int ship_index) { HUD_resources.invpulse_bmp = bm_AllocLoadFileBitmap(IGNORE_TABLE(cfginfo.invpulseimg), 0); if (cfginfo.modelname[0] == 0) { Cockpit_info.model_num = -1; - mprintf((0, "No cockpit found for ship.\n")); + mprintf(0, "No cockpit found for ship.\n"); return; } // initialize cockpit. @@ -456,7 +456,7 @@ void RenderCockpit() { // position cockpit correctly. bsp_info *viewer_subobj = CockpitGetMonitorSubmodel(SOF_VIEWER); if (!viewer_subobj) { - mprintf((0, "Cockpit missing viewer!\n")); + mprintf(0, "Cockpit missing viewer!\n"); return; } view_z = @@ -550,8 +550,7 @@ float KeyframeAnimateCockpit() { newkeyframe = Cockpit_info.this_keyframe + (Cockpit_info.next_keyframe - Cockpit_info.this_keyframe) * (Cockpit_info.frame_time / COCKPIT_ANIM_TIME); - // mprintf((0, "this=%.1f next=%.1f ft=%.1f\n", Cockpit_info.this_keyframe, Cockpit_info.next_keyframe, - // Cockpit_info.frame_time)); going up in keyframes + // mprintf(0, "this=%.1f next=%.1f ft=%.1f\n", Cockpit_info.this_keyframe, Cockpit_info.next_keyframe, Cockpit_info.frame_time)); // going up in keyframes if (Cockpit_info.this_keyframe < Cockpit_info.next_keyframe) { if (newkeyframe >= Cockpit_info.next_keyframe) { Cockpit_info.frame_time = 0.0f; diff --git a/Descent3/config.cpp b/Descent3/config.cpp index 22c63d54..a4ca9b4d 100644 --- a/Descent3/config.cpp +++ b/Descent3/config.cpp @@ -899,7 +899,7 @@ struct sound_menu { D3MusicSetVolume((*musicvolume) / 10.0f); if (fxquantity) { - mprintf((1, "oldquant %d newquant %d\n", old_fxquantity, *fxquantity)); + mprintf(1, "oldquant %d newquant %d\n", old_fxquantity, *fxquantity); if (old_fxquantity != (*fxquantity)) { Sound_system.SetLLSoundQuantity((*fxquantity) + MIN_SOUNDS_MIXED); } @@ -1162,8 +1162,8 @@ struct hud_menu { Current_pilot.set_hud_data(NULL, &hud_new_stat, &hud_new_grstat); - // mprintf((0, "pilot hud stat=%x\n", Current_pilot.hud_stat)); - // mprintf((0, "pilot hud grstat=%x\n", Current_pilot.hud_graphical_stat)); + // mprintf(0, "pilot hud stat=%x\n", Current_pilot.hud_stat); + // mprintf(0, "pilot hud grstat=%x\n", Current_pilot.hud_graphical_stat); // modify current hud stats if in game. if ((GetFunctionMode() == EDITOR_GAME_MODE || GetFunctionMode() == GAME_MODE) && GetHUDMode() == HUD_FULLSCREEN) { @@ -1365,7 +1365,7 @@ void OptionsMenu() { while (state != 2) { if (state == 1) { // enter controller config menu - mprintf((0, "CONTROLLER CONFIG MENU HERE!\n")); + mprintf(0, "CONTROLLER CONFIG MENU HERE!\n"); CtlConfig(CTLCONFIG_KEYBOARD); state = 0; // goto options menu. } else { diff --git a/Descent3/credits.cpp b/Descent3/credits.cpp index 535f1acd..4abe80c1 100644 --- a/Descent3/credits.cpp +++ b/Descent3/credits.cpp @@ -162,7 +162,7 @@ static int Credits_ParseLine(char *line, creditline *credit) { int num_found = sscanf(line, "*%d %d %d %d %f", &x1, &y1, &x2, &y2, &timedelay); if (num_found != 5) { - mprintf((0, "Bad movement data in credit text (%s)\n", line)); + mprintf(0, "Bad movement data in credit text (%s)\n", line); return 0; } else { CreditStartX = x1; @@ -186,7 +186,7 @@ static int Credits_ParseLine(char *line, creditline *credit) { credit->endx = CreditEndX; credit->endy = CreditEndY; credit->displaytime = CreditDisplayTime; - mprintf((0, "Read header %s\n", line)); + mprintf(0, "Read header %s\n", line); credit->color = CreditHeadingColor; credit->type = CLTYPE_HEADING; @@ -197,7 +197,7 @@ static int Credits_ParseLine(char *line, creditline *credit) { int r, g, b; int num_found = sscanf(line, "$%d %d %d", &r, &g, &b); if (num_found != 3) { - mprintf((0, "Bad color in credit text (%s)\n", line)); + mprintf(0, "Bad color in credit text (%s)\n", line); return 0; } else { CreditTextColor = GR_RGB(r, g, b); @@ -208,7 +208,7 @@ static int Credits_ParseLine(char *line, creditline *credit) { int r, g, b; int num_found = sscanf(line, "^%d %d %d", &r, &g, &b); if (num_found != 3) { - mprintf((0, "Bad color in credit text (%s)\n", line)); + mprintf(0, "Bad color in credit text (%s)\n", line); return 0; } else { CreditHeadingColor = GR_RGB(r, g, b); @@ -229,7 +229,7 @@ static int Credits_ParseLine(char *line, creditline *credit) { strcpy(credit->text, line); credit->color = CreditTextColor; credit->type = CLTYPE_TEXT; - // mprintf ((0,"Read textline %s\n",line)); + // mprintf(0,"Read textline %s\n",line); new_text = 1; } @@ -256,7 +256,7 @@ static bool Credits_LoadCredits(const char *filename) { infile = cfopen(filename, "rt"); if (!infile) { - mprintf((0, "Couldn't open credit file to read credits!\n")); + mprintf(0, "Couldn't open credit file to read credits!\n"); return false; } @@ -281,7 +281,7 @@ static bool Credits_LoadCredits(const char *filename) { // Read a line and parse it cf_ReadString(curline, MAX_CREDIT_LEN, infile); - // mprintf ((0,"Read string %s\n",curline)); + // mprintf(0,"Read string %s\n",curline); if (!strnicmp("END", curline, 3)) { done = 1; @@ -318,7 +318,7 @@ void Credits_Display(void) { int bm_handle = bm_AllocLoadFileBitmap("CreditsBackground.tga", 0); if (bm_handle < 0) { - mprintf((0, "Failed to load background credit screen!\n")); + mprintf(0, "Failed to load background credit screen!\n"); return; } @@ -332,11 +332,11 @@ void Credits_Display(void) { D3MusicStart("credits.omf"); D3MusicSetRegion(CREDITS1_MUSIC_REGION); - mprintf((0, "Chillin in credits\n")); + mprintf(0, "Chillin in credits\n"); // Load our credits if (!Credits_LoadCredits("GameCredits.txt")) { - mprintf((0, "There was an error loading game credits!\n")); + mprintf(0, "There was an error loading game credits!\n"); } else { // First count how many headers there are so we know how many to allocate int count = 0; diff --git a/Descent3/ctlconfig.cpp b/Descent3/ctlconfig.cpp index 79bbf443..e6a04abc 100644 --- a/Descent3/ctlconfig.cpp +++ b/Descent3/ctlconfig.cpp @@ -693,7 +693,7 @@ void wpnsel_cfg_screen::finish() {} void wpnsel_cfg_screen::process(int res) { int slot, i; bool is_secondary = false, do_swap_ui = false, do_disable_ui = false, update_buttons = false; - mprintf((0, "res=%d\n", res)); + mprintf(0, "res=%d\n", res); if (m_selection_status == -1) { if (res == UID_RESETDEFAULTS) { for (i = 0; i < MAX_PRIMARY_WEAPONS; i++) @@ -732,7 +732,7 @@ void wpnsel_cfg_screen::process(int res) { is_secondary = true; do_disable_ui = true; } - mprintf((0, "slot=%d\n", slot)); + mprintf(0, "slot=%d\n", slot); // do different uis if (do_disable_ui) { diff --git a/Descent3/damage.cpp b/Descent3/damage.cpp index 1c202bcb..72ff26c8 100644 --- a/Descent3/damage.cpp +++ b/Descent3/damage.cpp @@ -1074,7 +1074,7 @@ void KillObject(object *objp, object *killer, float damage) { delay_time = delay_min + (delay_max - delay_min) * ps_rand() / D3_RAND_MAX; - mprintf((0, "Using %d\n", i)); + mprintf(0, "Using %d\n", i); break; } r -= p; @@ -1166,7 +1166,7 @@ float GetDeathAnimTime(object *objp) { (objp->rtype.pobj_info.anim_end_frame - objp->rtype.pobj_info.anim_frame) / (objp->rtype.pobj_info.anim_end_frame - objp->rtype.pobj_info.anim_start_frame); extra_time = std::min(extra_time, 3.0); // limit extra time to 3 seconds - mprintf((0, "extra_time = %2f\n", extra_time)); + mprintf(0, "extra_time = %2f\n", extra_time); death_time = Object_info[objp->id].anim[objp->ai_info->movement_type].elem[AS_DEATH].spc + 0.25 + extra_time; } @@ -1269,7 +1269,7 @@ void KillObject(object *objp, object *killer, float damage, int death_flags, flo SetObjectControlType(objp, CT_DYING_AND_AI); int next_anim = AS_DEATH; GoalAddGoal(objp, AIG_SET_ANIM, (void *)&next_anim, ACTIVATION_BLEND_LEVEL); - mprintf((0, "Start dying anim ")); + mprintf(0, "Start dying anim "); } } diff --git a/Descent3/dedicated_server.cpp b/Descent3/dedicated_server.cpp index 97b5f399..3c20fd63 100644 --- a/Descent3/dedicated_server.cpp +++ b/Descent3/dedicated_server.cpp @@ -843,15 +843,15 @@ void InitDedicatedSocket(uint16_t port) { dedicated_listen_socket = socket(AF_INET, SOCK_STREAM, 0); if (INVALID_SOCKET == dedicated_listen_socket) { - mprintf((0, "Unable to create listen socket for dedicated server!\n")); + mprintf(0, "Unable to create listen socket for dedicated server!\n"); return; } if (SOCKET_ERROR == bind(dedicated_listen_socket, (SOCKADDR *)&sock_addr, sizeof(sock_addr))) { - mprintf((0, "Unable to bind listen socket for dedicated server!\n")); + mprintf(0, "Unable to bind listen socket for dedicated server!\n"); return; } if (listen(dedicated_listen_socket, 1)) { - mprintf((0, "Unable to listen on dedicated server socket!\n")); + mprintf(0, "Unable to listen on dedicated server socket!\n"); return; } // Make the socket non-blocking @@ -885,7 +885,7 @@ void ListenDedicatedSocket(void) { // Check to see if this came in from the local address uint32_t localhost = inet_addr("127.0.0.1"); if (memcmp(&localhost, &conn_addr.sin_addr, sizeof(localhost)) != 0) { - mprintf((0, "Rejecting connection from remote host!\n")); + mprintf(0, "Rejecting connection from remote host!\n"); PrintDedicatedMessage(TXT_DS_REJECTREMOTE, inet_ntoa(conn_addr.sin_addr)); PrintDedicatedMessage("\n"); shutdown(incoming_socket, 2); diff --git a/Descent3/demofile.cpp b/Descent3/demofile.cpp index 79d36076..34bf37d2 100644 --- a/Descent3/demofile.cpp +++ b/Descent3/demofile.cpp @@ -359,7 +359,7 @@ void DemoToggleRecording() { strcat(szfile, ".dem"); } ddio_MakePath(Demo_fname, Base_directory, "demo", szfile, NULL); - mprintf((0, "Saving demo to file: %s\n", Demo_fname)); + mprintf(0, "Saving demo to file: %s\n", Demo_fname); // Try to create the file Demo_cfp = cfopen(Demo_fname, "wb"); if (Demo_cfp) { @@ -507,14 +507,14 @@ void DemoWriteChangedObjects() { (Objects[i].type == OBJ_CAMERA)) { if ((Objects[i].flags & OF_MOVED_THIS_FRAME)) //||(Objects[i].mtype.phys_info.velocity!=Zero_vector)) { - // mprintf((0,"Object moved this frame! type = %d\n",Objects[i].type)); + // mprintf(0,"Object moved this frame! type = %d\n",Objects[i].type); DemoWriteChangedObj(&Objects[i]); // num_changed++; } } } // if(num_changed) - // mprintf((0,"%d Objects moved this frame!\n",num_changed)); + // mprintf(0,"%d Objects moved this frame!\n",num_changed); } } @@ -571,7 +571,7 @@ void DemoReadTurretChanged(void) { } if (Objects[objnum].type != OBJ_NONE) { - // mprintf((0,"Updating turret %d!\n",objnum)); + // mprintf(0,"Updating turret %d!\n",objnum); ObjSetTurretUpdate(objnum, &multi_turret_info); } } @@ -699,7 +699,7 @@ int DemoFrameCount = 0; int DemoPlaybackFile(char *filename) { is_multi_demo = false; - mprintf((0, "Playing back demo file!\n")); + mprintf(0, "Playing back demo file!\n"); MultiBuildMatchTables(); if (FindArg("-makemovie")) { Demo_make_movie = true; @@ -742,14 +742,14 @@ int DemoReadHeader() { int level_num; int frame_count; float demo_gametime; - mprintf((0, "Reading demo header...\n")); + mprintf(0, "Reading demo header...\n"); ASSERT(Demo_flags == DF_PLAYBACK); cf_ReadString((char *)szsig, 10, Demo_cfp); ver = cf_ReadShort(Demo_cfp); if (strcmp(szsig, D3_DEMO_SIG) != 0) { if (strcmp(szsig, D3_DEMO_SIG_NEW) != 0) { - mprintf((0, "Bad demo header signature!\n")); + mprintf(0, "Bad demo header signature!\n"); return 0; } } @@ -772,12 +772,12 @@ int DemoReadHeader() { SetCurrentLevel(level_num); if (!LoadAndStartCurrentLevel()) { - mprintf((0, "Couldn't start new level to play back the demo!\n")); + mprintf(0, "Couldn't start new level to play back the demo!\n"); Osiris_EnableCreateEvents(); return 0; } } else { - mprintf((0, "Couldn't load the level to play back the demo!\n")); + mprintf(0, "Couldn't load the level to play back the demo!\n"); Osiris_EnableCreateEvents(); return 0; } @@ -821,7 +821,7 @@ int DemoReadHeader() { LGSSpew(Demo_cfp); if (!Osiris_RestoreSystemState(Demo_cfp)) { - mprintf((0, "Error restoring Osiris\n")); + mprintf(0, "Error restoring Osiris\n"); return 0; } @@ -844,7 +844,7 @@ int DemoReadHeader() { Camera_view_mode[0] = Camera_view_mode[2] = 0; //(0==CV_NONE) Force reinitialization RestoreCameraRearviews(); } catch (...) { - mprintf((0, "Someone threw an exception while reading the demo header!\n")); + mprintf(0, "Someone threw an exception while reading the demo header!\n"); return 0; } @@ -1003,8 +1003,8 @@ void DemoReadWeaponFire() { } Objects[new_weap_objnum].ctype.laser_info.src_gun_num = gunnum; - mprintf((0, "Player %d Firing weapon (%d) -- using objnum %d (old num = %d)\n", obj->id, weaponnum, new_weap_objnum, - weapobjnum)); + mprintf(0, "Player %d Firing weapon (%d) -- using objnum %d (old num = %d)\n", + obj->id, weaponnum, new_weap_objnum, weapobjnum); Demo_obj_map[weapobjnum] = new_weap_objnum; int16_t weapon_num = weaponnum; @@ -1116,7 +1116,7 @@ void DemoReadObjCreate() { parent_handle = cf_ReadInt(Demo_cfp); if (use_orient) gs_ReadMatrix(Demo_cfp, orient); - // mprintf((0,"Creating object ype: %d id: %d room: %d\n",type,id,roomnum)); + // mprintf(0,"Creating object ype: %d id: %d room: %d\n",type,id,roomnum); // xlate id to new id. switch (type) { @@ -1171,7 +1171,7 @@ void DemoFrame() { float tdelta = timer_GetTime(); // if(Gametime= 0) && (obj->type != OBJ_NONE) && (obj->type != OBJ_WEAPON) && (obj->flags & OF_POLYGON_OBJECT) && (p_info->multi_turret_info.num_turrets)) { - mprintf((0, "Turret %d updated!\n", a)); + mprintf(0, "Turret %d updated!\n", a); multi_turret_info.keyframes = (float *)&turret_holder; ObjGetTurretUpdate(a, &multi_turret_info); diff --git a/Descent3/descent.cpp b/Descent3/descent.cpp index dfec5c28..bf344c3f 100644 --- a/Descent3/descent.cpp +++ b/Descent3/descent.cpp @@ -684,7 +684,7 @@ void ShowStaticScreen(char *bitmap_filename, bool timed, float delay_time) { bm_DestroyChunkedBitmap(&splash_bm); } else { - mprintf((0, "Couldn't load %s.\n", bitmap_filename)); + mprintf(0, "Couldn't load %s.\n", bitmap_filename); } ui_SetScreenMode(Max_window_w, Max_window_h); diff --git a/Descent3/doorway.cpp b/Descent3/doorway.cpp index 601377d5..023f9ca6 100644 --- a/Descent3/doorway.cpp +++ b/Descent3/doorway.cpp @@ -174,7 +174,7 @@ void RemoveActiveDoorway(int adway) { Num_active_doorways--; - mprintf((0, "ActiveDoorways = %d\n", Num_active_doorways)); + mprintf(0, "ActiveDoorways = %d\n", Num_active_doorways); } void AddActiveDoorway(int roomnum) { @@ -193,7 +193,7 @@ void AddActiveDoorway(int roomnum) { dp->activenum = Num_active_doorways++; } - mprintf((0, "ActiveDoorways = %d\n", Num_active_doorways)); + mprintf(0, "ActiveDoorways = %d\n", Num_active_doorways); } // Given an object handle, returns the doorway number diff --git a/Descent3/fireball.cpp b/Descent3/fireball.cpp index 3ce0194a..b82aa27a 100644 --- a/Descent3/fireball.cpp +++ b/Descent3/fireball.cpp @@ -849,7 +849,7 @@ int CreateFireball(vector *pos, int fireball_num, int roomnum, int realtype) { else { objnum = ObjCreate(OBJ_FIREBALL, fireball_num, roomnum, pos, NULL); if (objnum < 0) { - mprintf((0, "Couldn't create fireball object!\n")); + mprintf(0, "Couldn't create fireball object!\n"); return -1; } Objects[objnum].size = Fireballs[fireball_num].size; @@ -871,7 +871,7 @@ int CreateCustomFireballObject(vector *pos, int fireball_num, int tex_handle, in return -1; objnum = ObjCreate(OBJ_FIREBALL, fireball_num, roomnum, pos, NULL); if (objnum < 0) { - mprintf((0, "Couldn't create fireball object!\n")); + mprintf(0, "Couldn't create fireball object!\n"); return -1; } Objects[objnum].size = Fireballs[fireball_num].size; @@ -902,7 +902,7 @@ object *CreateSubobjectDebrisDirected(object *parent, int subobj_num, vector *di objnum = ObjCreate(OBJ_DEBRIS, 0, parent->roomnum, &parent->pos, &parent->orient); if (objnum < 0 || objnum > Highest_object_index) { - mprintf((0, "WARNING: Debris not created!\n")); + mprintf(0, "WARNING: Debris not created!\n"); return NULL; } obj = &Objects[objnum]; @@ -982,7 +982,7 @@ void CreateExtraFireballs(object *obj, float size_scale) { extras += 4; // Cap at 12 extras = std::min(12, extras); - // mprintf ((0,"Creating %d extra explosions\n",extras)); + // mprintf(0,"Creating %d extra explosions\n",extras); CreateRandomSparks(extras, &obj->pos, obj->roomnum); for (i = 0; i < extras; i++) { vector pos = obj->pos; @@ -1093,7 +1093,7 @@ void CreateSplintersFromBody(object *obj, float explosion_mag, float lifetime) { // Now create splinter with that faces center position int s_objnum = ObjCreate(OBJ_SPLINTER, pm - Poly_models, obj->roomnum, &dest, NULL); if (s_objnum < 0) { - mprintf((0, "Couldn't create splinter object!\n")); + mprintf(0, "Couldn't create splinter object!\n"); return; } else { // Fill in relevant info @@ -1186,7 +1186,7 @@ void DoDeathSpew(object *parent) { int objnum = ObjCreate(type, id, parent->roomnum, &parent->pos, NULL); num_last_type++; if (objnum < 0) { - mprintf((0, "Couldn't spew object!\n")); + mprintf(0, "Couldn't spew object!\n"); return; } object *obj = &Objects[objnum]; @@ -1278,7 +1278,7 @@ void CreateElectricalBolts(object *objp, int num_bolts) { vis->flags = VF_USES_LIFELEFT | VF_EXPAND | VF_ATTACHED; } } else { - mprintf((0, "VIS: Submodel %s has 0 vertices!!!\n", sm->name)); + mprintf(0, "VIS: Submodel %s has 0 vertices!!!\n", sm->name); } } } @@ -1861,7 +1861,7 @@ void DoConcussiveForce(object *explode_obj_ptr, int parent_handle, float player_ dist = 0.0f; // Make damage be from 'maxdamage' to 0.0, where 0.0 is 'maxdistance' away; if (dist <= effect_distance) { - // mprintf((0, "Distance = %f\n", dist)); + // mprintf(0, "Distance = %f\n", dist); if (1 /*object_to_object_visibility(obj, hit_obj_ptr, FQ_TRANSWALL)*/) { fvi_query fq; fvi_info hit_info; @@ -1902,7 +1902,7 @@ void DoConcussiveForce(object *explode_obj_ptr, int parent_handle, float player_ damage = max_generic_damage - (dist / maxdistance) * max_generic_damage; force = maxforce - (dist / maxdistance) * maxforce; - // mprintf((0, "f %f d %f\n", force, damage)); + // mprintf(0, "f %f d %f\n", force, damage); // Find the force vector on the object vm_GetNormalizedDirFast(&vforce, &hit_obj_ptr->pos, &explode_obj_ptr->pos); vforce *= force; @@ -1917,7 +1917,7 @@ void DoConcussiveForce(object *explode_obj_ptr, int parent_handle, float player_ if (hit_obj_ptr->type == OBJ_PLAYER) { if (Demo_flags != DF_PLAYBACK) { ApplyDamageToPlayer(hit_obj_ptr, parent_obj, PD_CONCUSSIVE_FORCE, damage * player_scalar); - mprintf((0, "Applying %f damage to player from force.\n", damage)); + mprintf(0, "Applying %f damage to player from force.\n", damage); } // shake player cockpit if damage is pretty bad. @@ -1925,7 +1925,7 @@ void DoConcussiveForce(object *explode_obj_ptr, int parent_handle, float player_ float mag = damage / 200.0f; vector vec = vforce; vm_NormalizeVector(&vec); - // mprintf((0, "force: %.1f,%.1f,%.1f mag=%.2f\n", vec.x,vec.y,vec.z,mag)); + // mprintf(0, "force: %.1f,%.1f,%.1f mag=%.2f\n", vec.x,vec.y,vec.z,mag); StartCockpitShake(mag, &vec); } } else if (IS_GENERIC(hit_obj_ptr->type) || (hit_obj_ptr->type == OBJ_DOOR)) { @@ -1934,8 +1934,7 @@ void DoConcussiveForce(object *explode_obj_ptr, int parent_handle, float player_ } } } else { - ; // mprintf((0, "No badass: robot=%2i, dist=%7.3f, maxdistance=%7.3f .\n", i, f2fl(dist), - // f2fl(maxdistance))); + // mprintf(0, "No badass: robot=%2i, dist=%7.3f, maxdistance=%7.3f .\n", i, f2fl(dist), f2fl(maxdistance)); } // end if (object_to_object_visibility... } // end if (dist < maxdistance) } // end for @@ -1952,7 +1951,7 @@ void CreateBlueBlastRing(vector *pos, int index, float lifetime, float max_size, objnum = ObjCreate(OBJ_FIREBALL, index, roomnum, pos, NULL); if (objnum < 0) // DAJ -1FIX { - mprintf((0, "Couldn't create blast object!\n")); + mprintf(0, "Couldn't create blast object!\n"); return; } Objects[objnum].size = 1.0; @@ -2008,7 +2007,7 @@ int CreateBlastRing(vector *pos, int index, float lifetime, float max_size, int objnum = ObjCreate(OBJ_FIREBALL, index, roomnum, pos, NULL); if (objnum < 0) { - mprintf((0, "Couldn't create blast object!\n")); + mprintf(0, "Couldn't create blast object!\n"); return -1; } Objects[objnum].size = max_size; @@ -2041,7 +2040,7 @@ int CreateSmolderingObject(vector *pos, int index, float lifetime, float max_siz objnum = ObjCreate(OBJ_FIREBALL, index, roomnum, &new_pos, NULL); if (objnum < 0) { - mprintf((0, "Couldn't create blast object!\n")); + mprintf(0, "Couldn't create blast object!\n"); return -1; } Objects[objnum].size = 1.0; diff --git a/Descent3/game.cpp b/Descent3/game.cpp index abea7e13..70890bb7 100644 --- a/Descent3/game.cpp +++ b/Descent3/game.cpp @@ -997,7 +997,7 @@ void SetScreenMode(int sm, bool force_res_change) { if (rend_initted == -1) { // We're using the default, so change some values for the menus rend_initted = 1; - mprintf((0, "Changing menu settings to default!\n")); + mprintf(0, "Changing menu settings to default!\n"); Game_video_resolution = RES_640X480; Render_preferred_state.bit_depth = 16; scr_width = 640; @@ -1009,13 +1009,13 @@ void SetScreenMode(int sm, bool force_res_change) { Render_preferred_state.height = scr_height; Render_preferred_state.bit_depth = scr_bitdepth; - mprintf((0, "Setting rend_width=%d height=%d\n", scr_width, scr_height)); + mprintf(0, "Setting rend_width=%d height=%d\n", scr_width, scr_height); int retval = rend_SetPreferredState(&Render_preferred_state); if (retval == -1) { // We're using the default, so change some values for the menus rend_initted = 1; - mprintf((0, "Changing menu settings to default!\n")); + mprintf(0, "Changing menu settings to default!\n"); Game_video_resolution = RES_640X480; Render_preferred_state.bit_depth = 16; scr_width = 640; @@ -1060,7 +1060,7 @@ void SetScreenMode(int sm, bool force_res_change) { // initialize ui system again ui_SetScreenMode(Max_window_w, Max_window_h); - mprintf((0, "rend_width=%d height=%d\n", Max_window_w, Max_window_h)); + mprintf(0, "rend_width=%d height=%d\n", Max_window_w, Max_window_h); } // assign current screen mode @@ -1103,7 +1103,7 @@ void SetScreenMode(int sm, bool force_res_change) { } } - mprintf((0, "NEW rend_width=%d height=%d\n", Max_window_w, Max_window_h)); + mprintf(0, "NEW rend_width=%d height=%d\n", Max_window_w, Max_window_h); // mark res change as false. @@ -1166,14 +1166,14 @@ void FramePush(int x1, int y1, int x2, int y2, bool clear) { FrameStackDepth++; // DAJ if (FrameStackDepth > 7) { - mprintf((2, "FrameStack Overflow\n")); + mprintf(2, "FrameStack Overflow\n"); Int3(); } } void FramePop(int *x1, int *y1, int *x2, int *y2, bool *clear) { if (!FrameStackRoot || !FrameStackPtr) { - mprintf((0, "StartFrame/EndFrame mismatch\n")); + mprintf(0, "StartFrame/EndFrame mismatch\n"); Int3(); *clear = true; *x1 = Game_window_x; diff --git a/Descent3/gamecinematics.cpp b/Descent3/gamecinematics.cpp index 168f1492..9186f170 100644 --- a/Descent3/gamecinematics.cpp +++ b/Descent3/gamecinematics.cpp @@ -428,10 +428,10 @@ static inline void verify_percentranage(PercentageRange *range) { // this would do what's needed. void Cinematic_PerformFake(void) { Cinematic_fake_queued = false; - mprintf((0, "Cinematics: Faking Cinematic\n")); + mprintf(0, "Cinematics: Faking Cinematic\n"); object *target = ObjGet(Cinematic_fake_info.target_objhandle); if (!target) { - mprintf((0, "Cinematics: Invalid target...can't fake\n")); + mprintf(0, "Cinematics: Invalid target...can't fake\n"); return; } @@ -575,7 +575,7 @@ bool Cinematic_StartCine(tGameCinematic *info, const char *text_string, int came if (c) { objnum = OBJNUM(c); } else { - mprintf((0, "Unable to create camera\n")); + mprintf(0, "Unable to create camera\n"); return false; } @@ -588,13 +588,13 @@ bool Cinematic_StartCine(tGameCinematic *info, const char *text_string, int came } else { GameCinema.pathnum = info->pathid; if (GameCinema.pathnum == -1) { - mprintf((0, "Invalid Path given\n")); + mprintf(0, "Invalid Path given\n"); return false; } // Abort if not a good path if (((info->flags & GCF_CAMERAPLACEMENT) == GCF_USEPOINT)) { if (GamePaths[GameCinema.pathnum].num_nodes < 2) { - mprintf((0, "Not a good path passed to Cinematic_Start\n")); + mprintf(0, "Not a good path passed to Cinematic_Start\n"); return false; } } @@ -608,7 +608,7 @@ bool Cinematic_StartCine(tGameCinematic *info, const char *text_string, int came /* if(objnum==-1){ //couldn't create camera - mprintf((0,"Unable to create camera\n")); + mprintf(0,"Unable to create camera\n"); return false; } */ @@ -667,7 +667,7 @@ bool Cinematic_StartCine(tGameCinematic *info, const char *text_string, int came // The structs are setup, time to setup the camera and objects - mprintf((0, "Cinematic_Start\n")); + mprintf(0, "Cinematic_Start\n"); Player_object->flags &= ~OF_DESTROYABLE; Players[Player_num].flags &= ~PLAYER_FLAGS_AFTERBURN_ON; @@ -847,13 +847,13 @@ bool Cinematic_StartCine(tGameCinematic *info, const char *text_string, int came vm_NormalizeVector(&turn_to); if (turn_to == Zero_vector) { - mprintf((0, "Cine: No turn_to or less than 1 degree off goal\n")); + mprintf(0, "Cine: No turn_to or less than 1 degree off goal\n"); goto continue_start; } goal_angle = vm_DeltaAngVecNorm(&camera->orient.fvec, &turn_to, &u_axis); if (goal_angle == 0) { - mprintf((0, "Cine: Goal angle is zero\n")); + mprintf(0, "Cine: Goal angle is zero\n"); goto continue_start; } @@ -920,7 +920,7 @@ void Cinematic_Stop(void) { // reset things back to normal, anything that might be messed up bool dont_restore_viewer = false; if (GameCinema.flags & GCF_DONTRESTOREVIEWER) { - mprintf((0, "********NOT RESTORING VIEW TO PLAYER*************\n")); + mprintf(0, "********NOT RESTORING VIEW TO PLAYER*************\n"); dont_restore_viewer = true; } @@ -1124,13 +1124,13 @@ void Cinematic_Frame(void) { vm_NormalizeVector(&turn_to); if (turn_to == Zero_vector) { - mprintf((0, "Cine: No turn_to or less than 1 degree off goal\n")); + mprintf(0, "Cine: No turn_to or less than 1 degree off goal\n"); goto continue_frame; } goal_angle = vm_DeltaAngVecNorm(&camera->orient.fvec, &turn_to, &u_axis); if (goal_angle == 0) { - mprintf((0, "Cine: Goal angle is zero\n")); + mprintf(0, "Cine: Goal angle is zero\n"); goto continue_frame; } @@ -1692,7 +1692,7 @@ void CannedCinematicIntroCallback(int type) { switch (type) { case GCCT_START: { // start the player on the path - mprintf((0, "START PLAYER ON PATH\n")); + mprintf(0, "START PLAYER ON PATH\n"); // determine how fast they need to travel int pathnum = CannedCinematicIntro.player_path; @@ -1717,7 +1717,7 @@ void CannedCinematicIntroCallback(int type) { int next_node; if (pathnum == -1) { - mprintf((0, "ILLEGAL PATH FOR PLAYER\n")); + mprintf(0, "ILLEGAL PATH FOR PLAYER\n"); break; } @@ -1731,19 +1731,19 @@ void CannedCinematicIntroCallback(int type) { if (fabs(vm_VectorDistance(&GamePaths[pathnum].pathnodes[1].pos, &GamePaths[pathnum].pathnodes[0].pos)) > 30.0f) { CannedCinematicIntro.should_thrust = true; - mprintf((0, "Player should thrust\n")); + mprintf(0, "Player should thrust\n"); } else { CannedCinematicIntro.should_thrust = false; - mprintf((0, "Player should NOT thrust\n")); + mprintf(0, "Player should NOT thrust\n"); } } else { CannedCinematicIntro.should_thrust = true; - mprintf((0, "Player should thrust\n")); + mprintf(0, "Player should thrust\n"); } } else { next_node = 0; CannedCinematicIntro.should_thrust = false; - mprintf((0, "Player should NOT thrust\n")); + mprintf(0, "Player should NOT thrust\n"); vm_VectorToMatrix(&orient, &GamePaths[pathnum].pathnodes[0].fvec, &GamePaths[pathnum].pathnodes[0].uvec, NULL); } pos = GamePaths[pathnum].pathnodes[0].pos; @@ -1765,7 +1765,7 @@ void CannedCinematicIntroCallback(int type) { } break; case GCCT_STOP: { // stop the player on the path - mprintf((0, "STOP PLAYER ON PATH\n")); + mprintf(0, "STOP PLAYER ON PATH\n"); ResetPlayerControlType(Player_num); ResumeControls(); @@ -1824,7 +1824,7 @@ void CannedCinematicEndLevelCallback(int type) { // if the player is dead, bring them back from the dead if ((Players[Player_num].flags & PLAYER_FLAGS_DYING) || (Players[Player_num].flags & PLAYER_FLAGS_DEAD)) { // the player is currently dead - mprintf((0, "Bringing player back from the dead\n")); + mprintf(0, "Bringing player back from the dead\n"); Players[Player_num].flags &= ~(PLAYER_FLAGS_DYING | PLAYER_FLAGS_DEAD); Player_object->shields = 1.0f; } @@ -1833,13 +1833,13 @@ void CannedCinematicEndLevelCallback(int type) { MakePlayerInvulnerable(Player_num, CannedCinematicEndLevel.cinematic_time, false); // start the player on the path - mprintf((0, "START PLAYER ON PATH\n")); + mprintf(0, "START PLAYER ON PATH\n"); // determine how fast they need to travel int pathnum = CannedCinematicEndLevel.player_path; if (pathnum == -1) { - mprintf((0, "ILLEGAL PATH FOR PLAYER\n")); + mprintf(0, "ILLEGAL PATH FOR PLAYER\n"); break; } @@ -1902,7 +1902,7 @@ void CannedCinematicEndLevelCallback(int type) { } break; case GCCT_STOP: { // stop the player on the path - mprintf((0, "STOP PLAYER ON PATH\n")); + mprintf(0, "STOP PLAYER ON PATH\n"); ResetPlayerControlType(Player_num); ResumeControls(); @@ -2180,7 +2180,7 @@ void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle) { CannedCinematic_EndLevelPoint(&cam->pos, cam->roomnum, info->text_to_display, info->target_pathid, info->time, camera_handle); } else { - mprintf((0, "Passed in object handle for canned cinematic (level end) for camera position does not exist\n")); + mprintf(0, "Passed in object handle for canned cinematic (level end) for camera position does not exist\n"); Cinematic_DeleteCamera(camera_handle); SetGameState(GAMESTATE_LVLEND); } @@ -2188,7 +2188,7 @@ void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle) { case CANNED_MOVE_PLAYER_FADE: { object *player = ObjGet(info->target_objhandle); if (!player || player->type != OBJ_PLAYER) { - mprintf((0, "Invalid player passed to CANNED_MOVE_PLAYER_FADE\n")); + mprintf(0, "Invalid player passed to CANNED_MOVE_PLAYER_FADE\n"); Cinematic_DeleteCamera(camera_handle); return; } diff --git a/Descent3/gameevent.cpp b/Descent3/gameevent.cpp index 9e7934df..9b9ada2a 100644 --- a/Descent3/gameevent.cpp +++ b/Descent3/gameevent.cpp @@ -155,7 +155,7 @@ void ProcessNormalEvents() { // the object has died, kill the event FreeEvent(i); skip_event = true; - mprintf((0, "Game Event %d cancelled\n", i)); + mprintf(0, "Game Event %d cancelled\n", i); } } @@ -208,7 +208,7 @@ int CreateNewEvent(int type, int id, float length, void *data, int size, void (* num = AllocEvent(); if (num == -1) { - mprintf((0, "WARNING: Event (type %d, id %d) did not get allocated\n", type, id)); + mprintf(0, "WARNING: Event (type %d, id %d) did not get allocated\n", type, id); return -1; // couldn't do this event, no slots free } diff --git a/Descent3/gamefont.cpp b/Descent3/gamefont.cpp index db94835c..efe66408 100644 --- a/Descent3/gamefont.cpp +++ b/Descent3/gamefont.cpp @@ -149,7 +149,7 @@ int LoadFont(const char *font_name) { if (handle == -1) Error(TXT_ERRNOFONT, font_name); - mprintf((0, "Font <%s> height = %d\n", font_name, grfont_GetHeight(handle))); + mprintf(0, "Font <%s> height = %d\n", font_name, grfont_GetHeight(handle)); return handle; } diff --git a/Descent3/gamepath.cpp b/Descent3/gamepath.cpp index 909f0c89..8ae28d44 100644 --- a/Descent3/gamepath.cpp +++ b/Descent3/gamepath.cpp @@ -83,7 +83,7 @@ void FreeGamePath(int n) { return; mem_free(GamePaths[n].pathnodes); - mprintf((0, "Path %d lost some\n", n)); + mprintf(0, "Path %d lost some\n", n); GamePaths[n].num_nodes = 0; GamePaths[n].used = 0; diff --git a/Descent3/gamesave.cpp b/Descent3/gamesave.cpp index 81a85f01..7707b4eb 100644 --- a/Descent3/gamesave.cpp +++ b/Descent3/gamesave.cpp @@ -537,7 +537,7 @@ void __cdecl LoadGameDialogCB(newuiTiledWindow *wnd, void *data) bm_DestroyChunkedBitmap(&cb_data->chunk); } - mprintf((0, "savegame slot=%d\n", id - SAVE_HOTSPOT_ID)); + mprintf(0, "savegame slot=%d\n", id - SAVE_HOTSPOT_ID); ddio_MakePath(savegame_dir, Base_directory, "savegame", NULL); snprintf(filename, sizeof(filename), "saveg00%d", (id - SAVE_HOTSPOT_ID)); @@ -1114,17 +1114,17 @@ void SGSObjects(CFILE *fp) { gs_WriteInt(fp, op->attach_ultimate_handle); gs_WriteInt(fp, op->attach_parent_handle); if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_ultimate_handle)) { - mprintf((0, "Object %d has an ultimate parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_ultimate_handle)), - op->attach_parent_handle)); + mprintf(0, "Object %d has an ultimate parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_ultimate_handle)), + op->attach_parent_handle); } if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_parent_handle)) { - mprintf((0, "Object %d has a parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_parent_handle)), - op->attach_parent_handle)); + mprintf(0, "Object %d has a parent of %d (%d)\n", i, OBJNUM(ObjGet(op->attach_parent_handle)), + op->attach_parent_handle); } gs_WriteInt(fp, pm->n_attach); if (pm->n_attach) { - mprintf((0, "Object %d has %d attach points.\n", i, pm->n_attach)); + mprintf(0, "Object %d has %d attach points.\n", i, pm->n_attach); if (op->attach_children) { gs_WriteInt(fp, 1); @@ -1213,7 +1213,7 @@ void SGSObjects(CFILE *fp) { // special things local to object SGSObjSpecial(fp, op); } - mprintf((0, "highest obj index = %d, ", Highest_object_index)); + mprintf(0, "highest obj index = %d, ", Highest_object_index); END_VERIFY_SAVEFILE(fp, "Objects save"); } diff --git a/Descent3/gamesave.h b/Descent3/gamesave.h index 8a1ffe2f..988a6dfc 100644 --- a/Descent3/gamesave.h +++ b/Descent3/gamesave.h @@ -165,7 +165,7 @@ int LoadGameState(const char *pathname); #define gs_WriteBool(_f, _b) cf_WriteByte(_f, _b) #define START_VERIFY_SAVEFILE(f) int cur_file_pos = cftell(f) -#define END_VERIFY_SAVEFILE(f, s) mprintf((0, "%s =%d bytes\n", s, cftell(f) - cur_file_pos)) +#define END_VERIFY_SAVEFILE(f, s) mprintf(0, "%s =%d bytes\n", s, cftell(f) - cur_file_pos) #define gs_ReadVector(_f, _v) \ do { \ diff --git a/Descent3/gamesequence.cpp b/Descent3/gamesequence.cpp index c87860a3..877bb829 100644 --- a/Descent3/gamesequence.cpp +++ b/Descent3/gamesequence.cpp @@ -1303,7 +1303,7 @@ bool GameSequencer() { // Make sure we have the correct hogfile void CheckHogfile() { char hogpath[_MAX_PATH * 2]; - mprintf((0, "Checking to see if we need to open another hog off of disk or CDROM\n")); + mprintf(0, "Checking to see if we need to open another hog off of disk or CDROM\n"); if (Current_mission.filename && (stricmp(Current_mission.filename, "d3.mn3") == 0) && (Current_mission.cur_level > 4)) { @@ -1390,7 +1390,7 @@ bool StartNewGame() { bool DoLevelIntro() { tLevelNode *lvl = Current_level; - mprintf((0, "In DoLevelIntro()\n")); + mprintf(0, "In DoLevelIntro()\n"); // multiplayer stuff (we skip the movie and briefings) if (Game_mode & GM_MULTI) { @@ -1443,7 +1443,7 @@ void ClearViewerObjects() { for (i = 0, objp = Objects; i <= Highest_object_index; i++, objp++) if (objp->type == OBJ_VIEWER) { - mprintf((0, "Deleting viewer object %d\n", i)); + mprintf(0, "Deleting viewer object %d\n", i); ObjDelete(i); } } @@ -1545,7 +1545,7 @@ void StartLevel() { Players[Player_num].ship_index = FindShipName(ship_model); ASSERT(Players[Player_num].ship_index != -1); // DAJ -1FIX } else { - mprintf((0, "Player %d wanted to use a ship (%s) which wasn't allowed.\n", Player_num, ship_model)); + mprintf(0, "Player %d wanted to use a ship (%s) which wasn't allowed.\n", Player_num, ship_model); int i; bool found_one = false; @@ -1882,7 +1882,7 @@ void FlushDataCache() { } } - mprintf((0, "Freed %d textures, %d models, and %d sounds.\n", texfreed, modelsfreed, soundsfreed)); + mprintf(0, "Freed %d textures, %d models, and %d sounds.\n", texfreed, modelsfreed, soundsfreed); // the renderer is never initialized in dedicated server mode, so don't try to reset things either if (!Dedicated_server) { rend_ResetCache(); @@ -1955,7 +1955,7 @@ void EndLevel(int state) { if ((NetPlayers[i].flags & NPF_CONNECTED) && (NetPlayers[i].sequence >= NETSEQ_PLAYING)) { // check to see if player is dying if ((Players[i].flags & PLAYER_FLAGS_DYING) || (Players[i].flags & PLAYER_FLAGS_DEAD)) { - mprintf((0, "Prematurely ending death for player %d\n", i)); + mprintf(0, "Prematurely ending death for player %d\n", i); EndPlayerDeath(i); } } @@ -1964,7 +1964,7 @@ void EndLevel(int state) { } else { // in single player, check Player_num if ((Players[Player_num].flags & PLAYER_FLAGS_DYING) || (Players[Player_num].flags & PLAYER_FLAGS_DEAD)) { - mprintf((0, "Prematurely ending death for player\n")); + mprintf(0, "Prematurely ending death for player\n"); EndPlayerDeath(Player_num); } } @@ -1992,7 +1992,7 @@ void SetNextLevel() { Multi_next_level = -1; } else if (lvl->flags & LVLFLAG_BRANCH) { // jump to brached level - mprintf((0, "Branching...\n")); + mprintf(0, "Branching...\n"); Current_mission.cur_level = lvl->lvlbranch0; SetCurrentLevel(Current_mission.cur_level); } else if ((Current_mission.cur_level == Current_mission.num_levels) || (lvl->flags & LVLFLAG_FINAL)) { @@ -2359,7 +2359,7 @@ void PageInShip(int id) { // Create bumps if neccessary if (rend_SupportsBumpmapping()) { if (GameTextures[pm->textures[t]].bumpmap == -1) { - mprintf((0, "Trying to make bumpmap!\n")); + mprintf(0, "Trying to make bumpmap!\n"); BuildTextureBumpmaps(pm->textures[t]); } } diff --git a/Descent3/gametexture.cpp b/Descent3/gametexture.cpp index 4fc58101..c9961f0c 100644 --- a/Descent3/gametexture.cpp +++ b/Descent3/gametexture.cpp @@ -303,7 +303,7 @@ int InitTextures() { int i, tex; - mprintf((0, "Initializing texture system.\n")); + mprintf(0, "Initializing texture system.\n"); for (i = 0; i < MAX_TEXTURES; i++) GameTextures[i].used = 0; @@ -593,8 +593,8 @@ int LoadTextureImage(const char *filename, int *type, int texture_size, int mipp if (!pageable && (w != bm_w(bm_handle, 0) || h != bm_h(bm_handle, 0))) { int dest_bm; - mprintf((0, "WARNING: Resizing bitmap %s from %d x %d to %d x %d!\n", GameBitmaps[bm_handle].name, - bm_w(bm_handle, 0), bm_h(bm_handle, 0), w, h)); + mprintf(0, "WARNING: Resizing bitmap %s from %d x %d to %d x %d!\n", GameBitmaps[bm_handle].name, + bm_w(bm_handle, 0), bm_h(bm_handle, 0), w, h); dest_bm = bm_AllocBitmap(w, h, mipped * ((w * h * 2) / 3)); ASSERT(dest_bm >= 0); @@ -697,8 +697,8 @@ void PageInTexture(int n, bool resize) { Total_memory_saved += saved; - mprintf((0, "Low mem: Resizing bitmap %s to %d x %d!\n", GameBitmaps[bm_handle].name, w, h)); - mprintf((0, "Total memory saved=%d\n", Total_memory_saved)); + mprintf(0, "Low mem: Resizing bitmap %s to %d x %d!\n", GameBitmaps[bm_handle].name, w, h); + mprintf(0, "Total memory saved=%d\n", Total_memory_saved); dest_bm = bm_AllocBitmap(w, h, mipped * ((w * h * 2) / 3)); ASSERT(dest_bm >= 0); @@ -744,7 +744,7 @@ void BuildTextureBumpmaps(int texhandle) { if (GameTextures[texhandle].flags & TF_ANIMATED) return; // No bumps for animated textures - mprintf((0, "Calculating bumpmap for texture named %s.\n", GameTextures[texhandle].name)); + mprintf(0, "Calculating bumpmap for texture named %s.\n", GameTextures[texhandle].name); // Make sure there is no bump already ASSERT(GameTextures[texhandle].bumpmap == -1); diff --git a/Descent3/hotspotmap.cpp b/Descent3/hotspotmap.cpp index 59579838..097412ec 100644 --- a/Descent3/hotspotmap.cpp +++ b/Descent3/hotspotmap.cpp @@ -242,10 +242,10 @@ int CreateHotSpotMap(const char *map, int width, int height, hotspotmap_t *hsmap } // end ifelse (hotspot_there) } // end for (count) - mprintf((0, "Hunting down empty hotspots....\n")); + mprintf(0, "Hunting down empty hotspots....\n"); for (count = 0; count < num_hs; count++) { if (whats_there[count] == NOTHING_THERE) { - mprintf((0, "Notice: HotSpot %d is empty\n", count)); + mprintf(0, "Notice: HotSpot %d is empty\n", count); hsmap->hs[count].scanlines = 0; hsmap->hs[count].starting_y = 0; if (hsmap->hs[count].x) { @@ -255,18 +255,18 @@ int CreateHotSpotMap(const char *map, int width, int height, hotspotmap_t *hsmap } } - mprintf((0, "Finding window count...")); + mprintf(0, "Finding window count..."); window_count = 0; for (count = 0; count < 256; count++) { if (whats_there[count] == WINDOW_THERE) window_count++; } - mprintf((0, "%d windows found\n", window_count)); + mprintf(0, "%d windows found\n", window_count); return window_count; } void CreateWindowMap(const char *map, int width, int height, windowmap_t *wndmap) { - mprintf((0, "Processing %d windows\n", wndmap->num_of_windows)); + mprintf(0, "Processing %d windows\n", wndmap->num_of_windows); int x, y, count; uint8_t alpha; bool newline = true; @@ -493,16 +493,16 @@ void CreateWindowMap(const char *map, int width, int height, windowmap_t *wndmap } for (count = 0; count < wndmap->num_of_windows; count++) { - mprintf((0, "Window #%d: Left/Top=(%d,%d) Width=%d Height=%d\n", count, wndmap->wm[count].x, wndmap->wm[count].y, - wndmap->wm[count].width, wndmap->wm[count].height)); - mprintf((0, "---L.T. (%d,%d)->(%d,%d)\n", wndmap->wm[count].l_start_x, wndmap->wm[count].t_top_y, - wndmap->wm[count].l_end_x, wndmap->wm[count].t_bottom_y)); - mprintf((0, "---R.T. (%d,%d)->(%d,%d)\n", wndmap->wm[count].r_start_x, wndmap->wm[count].t_top_y, - wndmap->wm[count].r_end_x, wndmap->wm[count].t_bottom_y)); - mprintf((0, "---L.B. (%d,%d)->(%d,%d)\n", wndmap->wm[count].l_start_x, wndmap->wm[count].b_top_y, - wndmap->wm[count].l_end_x, wndmap->wm[count].b_bottom_y)); - mprintf((0, "---R.B. (%d,%d)->(%d,%d)\n", wndmap->wm[count].r_start_x, wndmap->wm[count].b_top_y, - wndmap->wm[count].r_end_x, wndmap->wm[count].b_bottom_y)); + mprintf(0, "Window #%d: Left/Top=(%d,%d) Width=%d Height=%d\n", count, wndmap->wm[count].x, wndmap->wm[count].y, + wndmap->wm[count].width, wndmap->wm[count].height); + mprintf(0, "---L.T. (%d,%d)->(%d,%d)\n", wndmap->wm[count].l_start_x, wndmap->wm[count].t_top_y, + wndmap->wm[count].l_end_x, wndmap->wm[count].t_bottom_y); + mprintf(0, "---R.T. (%d,%d)->(%d,%d)\n", wndmap->wm[count].r_start_x, wndmap->wm[count].t_top_y, + wndmap->wm[count].r_end_x, wndmap->wm[count].t_bottom_y); + mprintf(0, "---L.B. (%d,%d)->(%d,%d)\n", wndmap->wm[count].l_start_x, wndmap->wm[count].b_top_y, + wndmap->wm[count].l_end_x, wndmap->wm[count].b_bottom_y); + mprintf(0, "---R.B. (%d,%d)->(%d,%d)\n", wndmap->wm[count].r_start_x, wndmap->wm[count].b_top_y, + wndmap->wm[count].r_end_x, wndmap->wm[count].b_bottom_y); } } @@ -530,7 +530,7 @@ int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { image_type = cf_ReadByte(infile); if (color_map_type != 0 || (image_type != 2)) { - mprintf((0, "menutga: Can't read this type of TGA.\n")); + mprintf(0, "menutga: Can't read this type of TGA.\n"); return -1; } @@ -546,13 +546,13 @@ int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { ASSERT(hsmap); if (pixsize != 32) { - mprintf((0, "menutga: This file has a pixsize of field of %d, it should be 32. ", pixsize)); + mprintf(0, "menutga: This file has a pixsize of field of %d, it should be 32. ", pixsize); return -1; } descriptor = cf_ReadByte(infile); if ((descriptor & 0x0F) != 8) { - mprintf((0, "menutga: Descriptor field & 0x0F must be 8, but this is %d.", descriptor & 0x0F)); + mprintf(0, "menutga: Descriptor field & 0x0F must be 8, but this is %d.", descriptor & 0x0F); return -1; } @@ -562,7 +562,7 @@ int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { n = bm_AllocBitmap(width, height, 0); if (n < 0) { - mprintf((0, "menutga: Failed to allocate memory.\n")); + mprintf(0, "menutga: Failed to allocate memory.\n"); Int3(); } @@ -596,7 +596,7 @@ int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { // Given a filename and a hotspotmap structure, it saves it to disk (.HSM) void menutga_SaveHotSpotMap(const char *filename, hotspotmap_t *hsmap, windowmap_t *wndmap) { CFILE *file; - mprintf((0, "Saving HotSpotMap %s ", filename)); + mprintf(0, "Saving HotSpotMap %s ", filename); file = (CFILE *)cfopen(filename, "wb"); if (!file) { Int3(); // get jeff! @@ -604,7 +604,7 @@ void menutga_SaveHotSpotMap(const char *filename, hotspotmap_t *hsmap, windowmap } int curr_hs, curr_sl; - mprintf((0, "Number of HotSpots=%d\n", hsmap->num_of_hotspots)); + mprintf(0, "Number of HotSpots=%d\n", hsmap->num_of_hotspots); cf_WriteByte(file, hsmap->num_of_hotspots); for (curr_hs = 0; curr_hs < hsmap->num_of_hotspots; curr_hs++) { @@ -673,7 +673,7 @@ void menutga_LoadHotSpotMap(int back_bmp, const char *filename, hotspotmap_t *hs FreeHotSpotMapInternals(hsmap); } - mprintf((0, "Loading hotspotmap %s ", filename)); + mprintf(0, "Loading hotspotmap %s ", filename); CFILE *infile; infile = (CFILE *)cfopen(filename, "rb"); @@ -684,7 +684,7 @@ void menutga_LoadHotSpotMap(int back_bmp, const char *filename, hotspotmap_t *hs hsmap->num_of_hotspots = cf_ReadByte(infile); - mprintf((0, "Contains: (%d hotspots) ", hsmap->num_of_hotspots)); + mprintf(0, "Contains: (%d hotspots) ", hsmap->num_of_hotspots); int curr_hs, curr_sl, num_sl; @@ -707,7 +707,7 @@ void menutga_LoadHotSpotMap(int back_bmp, const char *filename, hotspotmap_t *hs int count, index, size; wndmap->num_of_windows = cf_ReadInt(infile); - mprintf((0, "(%d Windows)\n", wndmap->num_of_windows)); + mprintf(0, "(%d Windows)\n", wndmap->num_of_windows); wndmap->wm = (window_box *)mem_malloc(sizeof(window_box) * wndmap->num_of_windows); for (count = 0; count < wndmap->num_of_windows; count++) { wndmap->wm[count].x = cf_ReadInt(infile); @@ -828,7 +828,7 @@ void makecorner(int corner_bmp, int back_bmp, const char *tmap, int l, int t, in // This function frees up the allocated memory within a hotspotmap struct. It does not free up the struct though. void FreeHotSpotMapInternals(hotspotmap_t *hsmap) { - mprintf((0, "Freeing HSM internals\n")); + mprintf(0, "Freeing HSM internals\n"); ASSERT(hsmap); @@ -857,7 +857,7 @@ void FreeHotSpotMapInternals(hotspotmap_t *hsmap) { bool menutga_ConvertTGAtoHSM(const char *fpath) { char path[255], filename[255], ext[8]; ddio_SplitPath(fpath, path, filename, ext); - mprintf((0, "Extracting hotspots from %s\n", filename)); + mprintf(0, "Extracting hotspots from %s\n", filename); // strip file name int index, width = 0, height = 0; @@ -881,7 +881,7 @@ bool menutga_ConvertTGAtoHSM(const char *fpath) { menu_filename = (char *)mem_malloc(size); strcpy(menu_filename, filename); strcat(menu_filename, ".HSM"); // Hot Spot Map - mprintf((0, "HSM=%s\n", menu_filename)); + mprintf(0, "HSM=%s\n", menu_filename); ddio_MakePath(path, LocalManageGraphicsDir, menu_filename, NULL); diff --git a/Descent3/hud.cpp b/Descent3/hud.cpp index cc1d2d6c..214d5667 100644 --- a/Descent3/hud.cpp +++ b/Descent3/hud.cpp @@ -625,7 +625,7 @@ void AddHUDItem(tHUDItem *item) { } if (i == MAX_HUD_ITEMS) { - mprintf((0, "Unable to add hud item (type=%d).\n", item->type)); + mprintf(0, "Unable to add hud item (type=%d).\n", item->type); } } @@ -761,7 +761,7 @@ redo_hud_switch: if ((Hud_mode == HUD_FULLSCREEN && mode == HUD_COCKPIT) || (Hud_mode == HUD_COCKPIT && mode == HUD_FULLSCREEN)) { uint8_t bmode = mode; // DAJ MAC using enums always int Current_pilot.set_hud_data((uint8_t *)&bmode); - mprintf((0, "Saving new hud mode to pilot\n")); + mprintf(0, "Saving new hud mode to pilot\n"); PltWriteFile(&Current_pilot); } @@ -943,7 +943,7 @@ void SGSHudState(CFILE *fp) { cf_WriteShort(fp, (int16_t)huditem->buffer_size); cf_WriteString(fp, huditem->data.text); - mprintf((0, "sg: saved customtext2 (%x,%x,bufsize=%d)\n", huditem->x, huditem->y, huditem->buffer_size)); + mprintf(0, "sg: saved customtext2 (%x,%x,bufsize=%d)\n", huditem->x, huditem->y, huditem->buffer_size); } else if (huditem->type == HUD_ITEM_TIMER) { cf_WriteShort(fp, (int16_t)huditem->stat); cf_WriteByte(fp, (int8_t)huditem->type); @@ -954,7 +954,7 @@ void SGSHudState(CFILE *fp) { cf_WriteByte(fp, (int8_t)huditem->alpha); cf_WriteInt(fp, huditem->data.timer_handle); - mprintf((0, "sg: restored timer (%x,%x,timer_hndl=%d)\n", huditem->x, huditem->y, huditem->data.timer_handle)); + mprintf(0, "sg: restored timer (%x,%x,timer_hndl=%d)\n", huditem->x, huditem->y, huditem->data.timer_handle); } else if (huditem->type == HUD_ITEM_CUSTOMTEXT) { // commented out because persistent hud messages are custom text, and its a mess to save the current // state of hud persistent messages. @@ -1005,7 +1005,7 @@ bool LGSHudState(CFILE *fp) { cf_ReadString(buffer, huditem.buffer_size, fp); UpdateCustomtext2HUDItem(buffer); mem_free(buffer); - mprintf((0, "lg: restored customtext2 (%x,%x,bufsize=%d)\n", huditem.x, huditem.y, huditem.buffer_size)); + mprintf(0, "lg: restored customtext2 (%x,%x,bufsize=%d)\n", huditem.x, huditem.y, huditem.buffer_size); break; case HUD_ITEM_TIMER: @@ -1018,7 +1018,7 @@ bool LGSHudState(CFILE *fp) { huditem.data.timer_handle = cf_ReadInt(fp); huditem.render_fn = RenderHUDTimer; // use pointer to function void (*fn)(struct tHUDItem *) AddHUDItem(&huditem); - mprintf((0, "lg: restored timer (%x,%x,timer_hndl=%d)\n", huditem.x, huditem.y, huditem.data.timer_handle)); + mprintf(0, "lg: restored timer (%x,%x,timer_hndl=%d)\n", huditem.x, huditem.y, huditem.data.timer_handle); break; // case HUD_ITEM_CUSTOMTEXT: @@ -1074,7 +1074,7 @@ void LoadHUDConfig(const char *filename, bool (*fn)(const char *, const char *, // open file fp = cfopen(filename, "rt"); if (!fp) { - mprintf((0, "Unable to find hud.inf file.\n")); + mprintf(0, "Unable to find hud.inf file.\n"); return; } @@ -1181,14 +1181,14 @@ void LoadHUDConfig(const char *filename, bool (*fn)(const char *, const char *, } else if (fn && (*fn)(command, operand, ext_data)) { continue; } else { - mprintf((0, "Error reading hud file.\n")); + mprintf(0, "Error reading hud file.\n"); Int3(); // contact samir. break; } } } } else { - mprintf((0, "Not a valid hud file.\n")); + mprintf(0, "Not a valid hud file.\n"); } // use any reticle specified. @@ -1258,7 +1258,7 @@ void RenderHUDFrame() { CallGameDLL(EVT_CLIENT_HUD_INTERVAL, &DLLInfo); rend_SetZBufferState(1); - mprintf_at((2, 0, 0, "FPS: %f", GetFPS())); + mprintf_at(2, 0, 0, "FPS: %f", GetFPS()); } // renders hud frame before any graphics are drawn @@ -1827,7 +1827,7 @@ void InitReticle(int primary_slots, int secondary_slots) { Reticle_elem_array[i].bmp_off = bm_AllocLoadFileBitmap(IGNORE_TABLE(filename), 0); if (Reticle_elem_array[i].bmp_off <= BAD_BITMAP_HANDLE) { Reticle_elem_array[i].bmp_off = -1; - mprintf((0, "Unable to load %s reticle image.\n", filename)); + mprintf(0, "Unable to load %s reticle image.\n", filename); } } else { Reticle_elem_array[i].bmp_off = -1; @@ -1837,7 +1837,7 @@ void InitReticle(int primary_slots, int secondary_slots) { snprintf(filename, sizeof(filename), "%s%s", Reticle_prefix, Reticle_image_names[i][1]); Reticle_elem_array[i].bmp_on = bm_AllocLoadFileBitmap(IGNORE_TABLE(filename), 0); if (Reticle_elem_array[i].bmp_on <= BAD_BITMAP_HANDLE) { - mprintf((0, "Unable to load %s reticle image.\n", filename)); + mprintf(0, "Unable to load %s reticle image.\n", filename); Reticle_elem_array[i].bmp_on = -1; } } else { diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index 5d5db83e..225e143e 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -687,7 +687,7 @@ void CorrectHudMessage(char *str) { if (grtext_GetTextLineWidth(str) <= Game_window_w) return; - mprintf((0, "Message '%s' is too long!\n", str)); + mprintf(0, "Message '%s' is too long!\n", str); // the line is too long, we need to shorten it, but when we do, we need to make sure that it isn't in the middle // of a color (0x01 0xFF 0xFF 0xFF) str[HUD_MESSAGE_LENGTH - 1] = '\0'; @@ -1824,7 +1824,7 @@ void MsgListConsole::DoInput() { m_bufline = m_bufline + offset_count; if (offset_count < 0) { - mprintf((0, "bufline=%d\n", m_bufline)); + mprintf(0, "bufline=%d\n", m_bufline); } while (offset_count < 0) { @@ -1845,7 +1845,7 @@ void MsgListConsole::DoInput() { m_bufline = m_bufline + offset_count; if (offset_count > 0) { - mprintf((0, "bufline=%d\n", m_bufline)); + mprintf(0, "bufline=%d\n", m_bufline); } while (offset_count > 0) { diff --git a/Descent3/init.cpp b/Descent3/init.cpp index 278f87c7..e1dd6139 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -1096,7 +1096,7 @@ void PreInitD3Systems() { int iframelmtarg = FindArg("-limitframe"); if (iframelmtarg) { Min_allowed_frametime = atoi(GameArgs[iframelmtarg + 1]); - mprintf((0, "Using %d as a minimum frametime\n", Min_allowed_frametime)); + mprintf(0, "Using %d as a minimum frametime\n", Min_allowed_frametime); } else { if (FindArg("-dedicated")) Min_allowed_frametime = 30; @@ -1106,25 +1106,25 @@ void PreInitD3Systems() { iframelmtarg = FindArg("-framecap"); if (iframelmtarg) { Min_allowed_frametime = ((float)1.0 / (float)atoi(GameArgs[iframelmtarg + 1])) * 1000; - mprintf((0, "Using %d as a minimum frametime\n", Min_allowed_frametime)); + mprintf(0, "Using %d as a minimum frametime\n", Min_allowed_frametime); } else { // Default to a framecap of 60 Min_allowed_frametime = (1.0 / 60.0) * 1000; - mprintf((0, "Using default framecap of 60\n")); + mprintf(0, "Using default framecap of 60\n"); } // Mouselook sensitivity! int msensearg = FindArg("-mlooksens"); if (msensearg) { Mouselook_sensitivity = kAnglesPerDegree * atof(GameArgs[msensearg + 1]); - mprintf((0, "Using mouselook sensitivity of %f\n", Mouselook_sensitivity)); + mprintf(0, "Using mouselook sensitivity of %f\n", Mouselook_sensitivity); } // Mouse sensitivity (non-mouselook) msensearg = FindArg("-mousesens"); if (msensearg) { Mouse_sensitivity = atof(GameArgs[msensearg + 1]); - mprintf((0, "Using mouse sensitivity of %f\n", Mouse_sensitivity)); + mprintf(0, "Using mouse sensitivity of %f\n", Mouse_sensitivity); } grtext_Init(); @@ -1437,7 +1437,7 @@ void InitIOSystems(bool editor) { std::string baseDirectoryString = executablePath.parent_path().string(); strncpy(Base_directory, baseDirectoryString.c_str(), sizeof(Base_directory) - 1); Base_directory[sizeof(Base_directory) - 1] = '\0'; - mprintf((0, "Using working directory of %s\n", Base_directory)); + mprintf(0, "Using working directory of %s\n", Base_directory); } } else { ddio_GetWorkingDir(Base_directory, sizeof(Base_directory)); @@ -1483,7 +1483,7 @@ void InitIOSystems(bool editor) { // Setup temp directory INIT_MESSAGE(("Setting up temp directory.")); SetupTempDirectory(); - mprintf((0, "Removing any temp files left over from last execution\n")); + mprintf(0, "Removing any temp files left over from last execution\n"); DeleteTempFiles(); // create directory system. @@ -1604,7 +1604,7 @@ void InitStringTable() { if (string_count == 0) Error("Couldn't find the string table."); else - mprintf((0, "%d strings loaded from the string tables\n", string_count)); + mprintf(0, "%d strings loaded from the string tables\n", string_count); } void InitGraphics(bool editor) { @@ -1694,8 +1694,13 @@ void UpdateInitMessage(float amount) { if (Init_in_editor) return; InitMessage(Init_messagebar_text, (amount * Init_messagebar_portion) + Init_messagebar_offset); - // mprintf((0, "amt=%.2f, portion=%.2f offs=%.2f, prog=%.2f\n", amount, Init_messagebar_portion, - // Init_messagebar_offset, (amount*Init_messagebar_portion)+Init_messagebar_offset)); +/* + mprintf(0, "amt=%.2f, portion=%.2f offs=%.2f, prog=%.2f\n", + amount, + Init_messagebar_portion, + Init_messagebar_offset, + (amount*Init_messagebar_portion)+Init_messagebar_offset); +*/ } void InitMessage(const char *c, float progress) { @@ -1793,7 +1798,7 @@ void IntroScreen() { #else int bm_handle = bm_AllocLoadFileBitmap("oemmenu.ogf", 0); #endif - mprintf((0, "Intro screen!.\n")); + mprintf(0, "Intro screen!.\n"); if (bm_handle > -1) { if (!bm_CreateChunkedBitmap(bm_handle, &Title_bitmap)) @@ -1804,7 +1809,7 @@ void IntroScreen() { Title_bitmap_init = true; InitMessage(NULL); } else { - mprintf((1, "Unable to find d3.tga.\n")); + mprintf(1, "Unable to find d3.tga.\n"); } } @@ -2024,7 +2029,7 @@ void SetupTempDirectory(void) { // NOTE: No string tables are available at this point //-------------------------------------------------- - mprintf((0, "Setting up temp directory\n")); + mprintf(0, "Setting up temp directory\n"); int t_arg = FindArg("-tempdir"); if (t_arg) { @@ -2044,7 +2049,7 @@ void SetupTempDirectory(void) { // verify that we can write to the temp directory if (!ddio_GetTempFileName(Descent3_temp_directory, "d3t", tempfilename)) { - mprintf((0, "Unable to get temp file name\n")); + mprintf(0, "Unable to get temp file name\n"); Error("Unable to set temporary directory to: \"%s\"", Descent3_temp_directory); exit(1); } @@ -2053,7 +2058,7 @@ void SetupTempDirectory(void) { CFILE *file = cfopen(tempfilename, "wb"); if (!file) { // unable to open file for writing - mprintf((0, "Unable to open temp file name for writing\n")); + mprintf(0, "Unable to open temp file name for writing\n"); Error("Unable to set temporary directory to: \"%s\"", Descent3_temp_directory); exit(1); } @@ -2065,7 +2070,7 @@ void SetupTempDirectory(void) { file = cfopen(tempfilename, "rb"); if (!file) { // unable to open file for reading - mprintf((0, "Unable to open temp file name for reading\n")); + mprintf(0, "Unable to open temp file name for reading\n"); ddio_DeleteFile(tempfilename); Error("Unable to set temporary directory to: \"%s\"", Descent3_temp_directory); exit(1); @@ -2073,7 +2078,7 @@ void SetupTempDirectory(void) { if (cf_ReadInt(file) != 0x56) { // verify failed - mprintf((0, "Temp file verify failed\n")); + mprintf(0, "Temp file verify failed\n"); cfclose(file); ddio_DeleteFile(tempfilename); Error("Unable to set temporary directory to: \"%s\"", Descent3_temp_directory); @@ -2085,40 +2090,40 @@ void SetupTempDirectory(void) { // temp directory is valid! ddio_DeleteFile(tempfilename); - mprintf((0, "Temp Directory Set To: \"%s\"\n", Descent3_temp_directory)); + mprintf(0, "Temp Directory Set To: \"%s\"\n", Descent3_temp_directory); // Lock the directory int lock_res = ddio_CreateLockFile(Descent3_temp_directory); switch (lock_res) { case 1: - mprintf((0, "Lock file created in temp dir\n")); + mprintf(0, "Lock file created in temp dir\n"); break; case 2: - mprintf((0, "Lock file created in temp dir (deleted dead lock)\n")); + mprintf(0, "Lock file created in temp dir (deleted dead lock)\n"); break; case 3: - mprintf((0, "Lock file created in temp dir (lock already exists)\n")); + mprintf(0, "Lock file created in temp dir (lock already exists)\n"); break; case 0: - mprintf((0, "Lock file NOT created in temp dir\n")); + mprintf(0, "Lock file NOT created in temp dir\n"); Error("Unable to set temporary directory to: \"%s\"\nThe directory is in use, please use -tempdir to set a " "different temp directory", Descent3_temp_directory); exit(1); break; case -1: - mprintf((0, "Illegal directory for Lock file\n")); + mprintf(0, "Illegal directory for Lock file\n"); Error("Unable to set temporary directory to: \"%s\"\nIllegal directory for lock file", Descent3_temp_directory); exit(1); break; case -2: - mprintf((0, "Illegal Lock file, unable to create\n")); + mprintf(0, "Illegal Lock file, unable to create\n"); Error("Unable to set temporary directory to: \"%s\"\nInvalid lock file located in directory", Descent3_temp_directory); exit(1); break; case -3: - mprintf((0, "Error creating Lock file\n")); + mprintf(0, "Error creating Lock file\n"); Error("Unable to set temporary directory to: \"%s\"\nUnable to create lock file", Descent3_temp_directory); exit(1); break; @@ -2165,7 +2170,7 @@ void ShutdownD3() { if (!Init_systems_init) return; - mprintf((0, "Shutting down D3...\n")); + mprintf(0, "Shutting down D3...\n"); // Close forcefeedback effects ForceShutdown(); @@ -2212,7 +2217,7 @@ void RestartD3() { if (!Init_systems_init) return; - mprintf((0, "Restarting D3...\n")); + mprintf(0, "Restarting D3...\n"); if (!FindArg("-windowed")) { if (Dedicated_server) { @@ -2270,4 +2275,4 @@ void RestartD3() { // startup sound. // Sound_system.ResumeSounds(); // Sound_system.InitSoundLib(Descent, Sound_mixer, Sound_quality, false); -} \ No newline at end of file +} diff --git a/Descent3/intellivibe.cpp b/Descent3/intellivibe.cpp index 21a05a4b..1c82acaa 100644 --- a/Descent3/intellivibe.cpp +++ b/Descent3/intellivibe.cpp @@ -72,7 +72,7 @@ static IntelliVIBE_DoQuaterFrame_fp IVIBE_DoQuaterFrame = NULL; #define TEST_MODULE(x) \ { \ if (!(x)) { \ - mprintf((0, "IntelliVIBE unable to find: %s\n", #x)); \ + mprintf(0, "IntelliVIBE unable to find: %s\n", #x); \ mod_FreeModule(&IntelliVIBE_module); \ IntelliVIBE_module.handle = NULL; \ return; \ @@ -80,7 +80,7 @@ static IntelliVIBE_DoQuaterFrame_fp IVIBE_DoQuaterFrame = NULL; } void VIBE_Init(oeApplication *app) { if (!mod_LoadModule(&IntelliVIBE_module, "ivibe_D3.dll")) { - mprintf((0, "Unable to load IntelliVIBE DLL\n")); + mprintf(0, "Unable to load IntelliVIBE DLL\n"); IntelliVIBE_module.handle = NULL; return; } @@ -102,7 +102,7 @@ void VIBE_Init(oeApplication *app) { ASSERT(IVIBE_Initialize != NULL); if (!IVIBE_Initialize(&info)) { - mprintf((0, "IntelliVIBE_Initialize failed\n")); + mprintf(0, "IntelliVIBE_Initialize failed\n"); mod_FreeModule(&IntelliVIBE_module); IntelliVIBE_module.handle = NULL; return; diff --git a/Descent3/levelgoal.cpp b/Descent3/levelgoal.cpp index c4f4ba05..3d7a6445 100644 --- a/Descent3/levelgoal.cpp +++ b/Descent3/levelgoal.cpp @@ -561,7 +561,7 @@ void lgoal::SendStateToPlayer(int index, int pnum) { if (!(NetPlayers[pnum].flags & NPF_CONNECTED && NetPlayers[pnum].sequence == NETSEQ_PLAYING)) return; - mprintf((0, "Sending modified LevelGoal %d to player %d\n", index, pnum)); + mprintf(0, "Sending modified LevelGoal %d to player %d\n", index, pnum); // now update the buddy handle list of the clients int count = 0; diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index 087f0c3b..be733e6c 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -119,7 +119,7 @@ void FreeLighting() { void InitDynamicLighting() { int i, cl, size; - mprintf((0, "Initting dynamic lighting.\n")); + mprintf(0, "Initting dynamic lighting.\n"); memset(Lmi_spoken_for, 0, MAX_LIGHTMAP_INFOS / 8); @@ -154,7 +154,7 @@ void InitDynamicLighting() { Ubyte_to_float[i] = (float)i / 255.0; // Setup specular tables - mprintf((0, "Building specular tables.\n")); + mprintf(0, "Building specular tables.\n"); for (i = 0; i < MAX_SPECULAR_INCREMENTS; i++) { float val = (float)i / (float)(MAX_SPECULAR_INCREMENTS - 1); @@ -178,7 +178,7 @@ uint8_t Float_to_ubyte(float fnum) { int i; if (fnum < 0 || fnum > 1.0) { - mprintf((0, "ERROR: Trying to get value in Float_to_ubyte that is %f!\n", fnum)); + mprintf(0, "ERROR: Trying to get value in Float_to_ubyte that is %f!\n", fnum); return 0; } @@ -198,7 +198,7 @@ int GetFreeDynamicLightmap(int w, int h) { return -1; if (total + Cur_dynamic_mem_ptr > DYNAMIC_LIGHTMAP_MEMORY) { - mprintf((0, "Ran out of lightmap memory (%d)\n", DYNAMIC_LIGHTMAP_MEMORY)); + mprintf(0, "Ran out of lightmap memory (%d)\n", DYNAMIC_LIGHTMAP_MEMORY); return -1; } @@ -296,7 +296,7 @@ void ApplyLightingToExternalRoom(vector *pos, int roomnum, float light_dist, flo continue; if (Num_dynamic_faces >= MAX_DYNAMIC_FACES) { - mprintf((0, "Too many dynamic faces!\n")); + mprintf(0, "Too many dynamic faces!\n"); return; } @@ -416,7 +416,7 @@ void ApplyLightingToExternalRoom(vector *pos, int roomnum, float light_dist, flo int dynamic_handle = GetFreeDynamicLightmap(xres, yres); if (dynamic_handle < 0) { - mprintf((0, "No free dynamic maps!\n")); + mprintf(0, "No free dynamic maps!\n"); return; // None free! } @@ -643,7 +643,7 @@ void ApplyLightingToSubmodel(object *obj, poly_model *pm, bsp_info *sm, float li // Ok, now we know that this light touches this face if (Num_dynamic_faces >= MAX_DYNAMIC_FACES) { - mprintf((0, "Too many dynamic faces!\n")); + mprintf(0, "Too many dynamic faces!\n"); DoneLightingInstance(); return; } @@ -763,7 +763,7 @@ void ApplyLightingToSubmodel(object *obj, poly_model *pm, bsp_info *sm, float li int dynamic_handle = GetFreeDynamicLightmap(xres, yres); if (dynamic_handle < 0) { - mprintf((0, "No free dynamic maps!\n")); + mprintf(0, "No free dynamic maps!\n"); DoneLightingInstance(); return; // None free! @@ -973,7 +973,7 @@ void ApplyVolumeLightToObject(vector *pos, object *obj, float light_dist, float // See if this specular light source is greater than our current one if ((light_dist - mag) > obj->effect_info->spec_mag && Detail_settings.Specular_lighting && !(Object_info[obj->id].lighting_info.flags & OLF_NO_SPECULARITY)) { - // mprintf ((0,"Setting specular!\n")); + // mprintf(0,"Setting specular!\n"); obj->effect_info->type_flags |= EF_SPECULAR; obj->effect_info->spec_mag = light_dist - mag; obj->effect_info->spec_pos = *pos; @@ -1072,7 +1072,7 @@ void ApplyLightingToRooms(vector *pos, int roomnum, float light_dist, float red_ #ifdef _DEBUG if (num_faces == MAX_DYNAMIC_FACES) { - mprintf((0, "Dynamic light from 1 object is touching %d faces! dist=%f\n", MAX_DYNAMIC_FACES, light_dist)); + mprintf(0, "Dynamic light from 1 object is touching %d faces! dist=%f\n", MAX_DYNAMIC_FACES, light_dist); } #endif @@ -1095,7 +1095,7 @@ void ApplyLightingToRooms(vector *pos, int roomnum, float light_dist, float red_ continue; if (Num_dynamic_faces >= MAX_DYNAMIC_FACES) { - mprintf((0, "Too many dynamic faces!\n")); + mprintf(0, "Too many dynamic faces!\n"); return; } @@ -1221,7 +1221,7 @@ void ApplyLightingToRooms(vector *pos, int roomnum, float light_dist, float red_ int dynamic_handle = GetFreeDynamicLightmap(xres, yres); if (dynamic_handle < 0) { - mprintf((0, "No free dynamic maps!\n")); + mprintf(0, "No free dynamic maps!\n"); return; // None free! } @@ -1481,7 +1481,7 @@ void ApplyLightingToTerrain(vector *pos, int cellnum, float light_dist, float re return; if (num_cells == MAX_DYNAMIC_CELLS) { - mprintf((0, "One object has hit %d terrain cells in lighting!\n", MAX_DYNAMIC_CELLS)); + mprintf(0, "One object has hit %d terrain cells in lighting!\n", MAX_DYNAMIC_CELLS); } int red_limit = 255; @@ -1506,7 +1506,7 @@ void ApplyLightingToTerrain(vector *pos, int cellnum, float light_dist, float re // continue; if (Num_dynamic_cells >= MAX_DYNAMIC_CELLS) { - mprintf((0, "Too many dynamic cells!\n")); + mprintf(0, "Too many dynamic cells!\n"); return; } @@ -1668,7 +1668,7 @@ int GetSpecularLightmapForFace (vector *pos,room *rp,face *fp) if (dynamic_handle<0) { - mprintf ((0,"No free specular maps for class %d!\n",cl)); + mprintf(0,"No free specular maps for class %d!\n",cl); return-1; // None free! } @@ -1831,7 +1831,7 @@ int GetSpecularLightmapForFace (vector *pos,room *rp,face *fp) if (dynamic_handle<0) { - mprintf ((0,"No free specular maps for class %d!\n",cl)); + mprintf(0,"No free specular maps for class %d!\n",cl); return-1; // None free! } @@ -1954,7 +1954,7 @@ int GetSpecularLightmapForFace (vector *pos,room *rp,face *fp) float dotp=subvec * incident_norm; // if (rp-Rooms==0 && fp-rp->faces==5 && (x==width/2) && (y==height/2)) -// mprintf ((0,"dotp=%f\n",dotp)); +// mprintf(0,"dotp=%f\n",dotp); if (dotp<0) @@ -2024,7 +2024,7 @@ void DestroyLight(int roomnum, int facenum) { // green_scale/=30; // blue_scale/=30; - mprintf((0, "r=%f g=%f b=%f\n", red_scale, green_scale, blue_scale)); + mprintf(0, "r=%f g=%f b=%f\n", red_scale, green_scale, blue_scale); // Get center and area of light face for (i = 0; i < destroy_fp->num_verts; i++) @@ -2225,11 +2225,11 @@ void DestroyLight(int roomnum, int facenum) { // Adds to our list of destroyable lights that got destroyed this frame void AddToDestroyableLightList(int roomnum, int facenum) { if (Num_destroyed_lights_this_frame >= MAX_DESTROYED_LIGHTS_PER_FRAME) { - mprintf((0, "Ran out of destroyable light slots!\n")); + mprintf(0, "Ran out of destroyable light slots!\n"); return; } - mprintf((0, "Destroying light. Room=%d face=%d\n", roomnum, facenum)); + mprintf(0, "Destroying light. Room=%d face=%d\n", roomnum, facenum); Destroyed_light_rooms_this_frame[Num_destroyed_lights_this_frame] = roomnum; Destroyed_light_faces_this_frame[Num_destroyed_lights_this_frame++] = facenum; diff --git a/Descent3/lightmap_info.cpp b/Descent3/lightmap_info.cpp index ee065497..19d90fec 100644 --- a/Descent3/lightmap_info.cpp +++ b/Descent3/lightmap_info.cpp @@ -116,7 +116,7 @@ int AllocLightmapInfo(int w, int h, int type, bool alloc_lightmap) { /*if (i==MAX_LIGHTMAP_INFOS) { Int3(); - mprintf ((0,"ERROR! Couldn't find a free lightmap info to alloc!\n")); + mprintf(0,"ERROR! Couldn't find a free lightmap info to alloc!\n"); return -1; }*/ diff --git a/Descent3/list.cpp b/Descent3/list.cpp index f7ca6f90..967b0255 100644 --- a/Descent3/list.cpp +++ b/Descent3/list.cpp @@ -26,7 +26,7 @@ listnode *NewListNode(void) { node = (listnode *)mem_malloc(sizeof(listnode)); if (node == NULL) { - mprintf((0, "Not enough memory for a new listnode!\n")); + mprintf(0, "Not enough memory for a new listnode!\n"); Int3(); return NULL; } @@ -46,7 +46,7 @@ int AddListItem(list **listp, void *item) { newnode = NewListNode(); if (newnode == NULL) { - mprintf((0, "There was a problem mallocing list node memory!\n")); + mprintf(0, "There was a problem mallocing list node memory!\n"); Int3(); return 0; } @@ -88,7 +88,7 @@ int RemoveListItem(list **listp, void *item) { } if (!inlist) { - mprintf((0, "RemoveItem: Warning, item not found in list\n")); + mprintf(0, "RemoveItem: Warning, item not found in list\n"); return 0; } diff --git a/Descent3/loadstate.cpp b/Descent3/loadstate.cpp index 180c57ba..750a70d9 100644 --- a/Descent3/loadstate.cpp +++ b/Descent3/loadstate.cpp @@ -1125,7 +1125,7 @@ int LGSObjects(CFILE *fp, int version) { f_allocated = 1; if (f_allocated) { - // mprintf((0,"Object %d has %d attach points.\n",i,nattach)); + // mprintf(0,"Object %d has %d attach points.\n",i,nattach); op->attach_children = (int *)mem_malloc(sizeof(int) * nattach); for (j = 0; j < nattach; j++) gs_ReadInt(fp, op->attach_children[j]); @@ -1294,7 +1294,7 @@ int LGSObjects(CFILE *fp, int version) { poly_model *pm = &Poly_models[op->rtype.pobj_info.model_num]; if (pm->n_attach) { - mprintf((0, "*Object %d has %d attach points.\n", i, pm->n_attach)); + mprintf(0, "*Object %d has %d attach points.\n", i, pm->n_attach); } polyobj_info *p_info = &op->rtype.pobj_info; @@ -1399,8 +1399,7 @@ int LGSObjects(CFILE *fp, int version) { ObjLink(OBJNUM(op), newroom); ObjSetOrient(op, &objmat[i]); if (op->type == OBJ_ROOM) { - mprintf((0, "Object %d is a room and Is%s a big object. Size=%f\n", i, (op->flags & OF_BIG_OBJECT) ? "" : "n't", - op->size)); + mprintf(0, "Object %d is a room and Is%s a big object. Size=%f\n", i, (op->flags & OF_BIG_OBJECT) ? "" : "n't", op->size); if ((op->size >= ((TERRAIN_SIZE * (float)1))) && !(op->flags & OF_BIG_OBJECT)) { BigObjAdd(i); } @@ -1408,22 +1407,26 @@ int LGSObjects(CFILE *fp, int version) { ObjSetAABB(op); } } - /* - if((op->attach_ultimate_handle)&&(OBJECT_HANDLE_NONE!=op->attach_ultimate_handle)) - { - mprintf((0,"Object %d has an ultimate parent of %d - (%d)\n",i,OBJNUM(ObjGet(op->attach_ultimate_handle)),op->attach_parent_handle )); ASSERT(op->flags&OF_ATTACHED); +/* + if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_ultimate_handle)) { + mprintf(0, "Object %d has an ultimate parent of %d (%d)\n", + i, + OBJNUM(ObjGet(op->attach_ultimate_handle)), + op->attach_parent_handle); + ASSERT(op->flags & OF_ATTACHED); } - if((op->attach_ultimate_handle)&&(OBJECT_HANDLE_NONE!=op->attach_parent_handle)) - { - mprintf((0,"Object %d has a parent of %d - (%d)\n",i,OBJNUM(ObjGet(op->attach_parent_handle)),op->attach_parent_handle )); ASSERT(op->flags&OF_ATTACHED); + if ((op->attach_ultimate_handle) && (OBJECT_HANDLE_NONE != op->attach_parent_handle)) { + mprintf(0, "Object %d has a parent of %d (%d)\n", + i, + OBJNUM(ObjGet(op->attach_parent_handle)), + op->attach_parent_handle); + ASSERT(op->flags & OF_ATTACHED); } */ } - mprintf((0, "Objects[121].prev=%d\n", Objects[121].prev)); + mprintf(0, "Objects[121].prev=%d\n", Objects[121].prev); ResetFreeObjects(); - mprintf((0, "highest obj index = %d, ", Highest_object_index)); + mprintf(0, "highest obj index = %d, ", Highest_object_index); ObjReInitPositionHistory(); END_VERIFY_SAVEFILE(fp, "Objects load"); diff --git a/Descent3/localization.cpp b/Descent3/localization.cpp index 6ec9b8cb..8f13a4d7 100644 --- a/Descent3/localization.cpp +++ b/Descent3/localization.cpp @@ -313,7 +313,7 @@ try_english: // no strings found Localization_language = old_language; - mprintf((0, "Localization: Warning, 0 strings found in %s\n", filename)); + mprintf(0, "Localization: Warning, 0 strings found in %s\n", filename); *table = NULL; *size = 0; return true; @@ -418,7 +418,7 @@ try_english: cfclose(file); - mprintf((0, "String Table (%s) loaded with %d strings\n", filename, *size)); + mprintf(0, "String Table (%s) loaded with %d strings\n", filename, *size); Localization_language = old_language; return (scount == (*size)); diff --git a/Descent3/marker.cpp b/Descent3/marker.cpp index 5fd7b808..3cd66841 100644 --- a/Descent3/marker.cpp +++ b/Descent3/marker.cpp @@ -42,7 +42,7 @@ void DropMarker(char *message) { if (strcmp("ai debug", teststring) == 0) { sscanf(message, "ai debug %d", &AI_debug_robot_index); - mprintf((0, "Debug robot is object index %d\n", AI_debug_robot_index)); + mprintf(0, "Debug robot is object index %d\n", AI_debug_robot_index); } #endif @@ -81,10 +81,10 @@ void DropMarker(char *message) { int objnum = ObjCreate(OBJ_MARKER, cur_marker_num, Player_object->roomnum, &Player_object->pos, &Player_object->orient, Player_object->handle); if (objnum >= 0) { - mprintf((0, "Marker %d created!\n", cur_marker_num)); + mprintf(0, "Marker %d created!\n", cur_marker_num); strcpy(MarkerMessages[(Player_num * 2) + cur_marker_num], message); } else - mprintf((0, "Marker NOT created!\n")); + mprintf(0, "Marker NOT created!\n"); } // Resets markers before a level stars diff --git a/Descent3/matcen.cpp b/Descent3/matcen.cpp index 5da7a7f0..823f4a62 100644 --- a/Descent3/matcen.cpp +++ b/Descent3/matcen.cpp @@ -285,7 +285,7 @@ bool matcen::StartObjProd() { return false; if (m_max_prod <= m_num_prod && m_max_prod != -1) { - mprintf((0, "MATCEN: Done\n")); + mprintf(0, "MATCEN: Done\n"); m_status |= MSTAT_DONE_PROD; return false; } @@ -1052,7 +1052,7 @@ bool matcen::ComputeNextProdInfo() { m_status &= ~MSTAT_DONE_PROD; if (m_max_prod <= m_num_prod && m_max_prod != -1) { - mprintf((0, "MATCEN: Done\n")); + mprintf(0, "MATCEN: Done\n"); m_status |= MSTAT_DONE_PROD; return false; } diff --git a/Descent3/menu.cpp b/Descent3/menu.cpp index 47392296..f8db290f 100644 --- a/Descent3/menu.cpp +++ b/Descent3/menu.cpp @@ -791,7 +791,7 @@ int MainMenu() { } else if (MultiDLLGameStarting) { // Go back into the multiplayer DLL @ the game list - mprintf((0, "Returning to Multiplayer!\n")); + mprintf(0, "Returning to Multiplayer!\n"); if (ReturnMultiplayerGameMenu()) { exit_menu = 1; @@ -866,9 +866,9 @@ int MainMenu() { case IDV_MULTIPLAYER: { IsCheater = false; main_menu.SetMusicRegion(MULTI_MUSIC_REGION); - mprintf((0, "Multiplayer!\n")); + mprintf(0, "Multiplayer!\n"); // make all ships available - mprintf((0, "Making all ships available\n")); + mprintf(0, "Making all ships available\n"); for (int i = 0; i < MAX_SHIPS; i++) { if (Ships[i].used) PlayerSetShipPermission(-1, Ships[i].name, true); @@ -934,13 +934,13 @@ bool ProcessCommandLine() { szurl[strlen("d3demo2://") - 1] = '\0'; // Should make the string "d3demo:/" p = szurl + strlen("d3demo2://"); // pointer to the first character of the url after the // if (stricmp(szurl, "d3demo2:/") == 0) { - mprintf((0, "Got a url passed: %s\n", p)); + mprintf(0, "Got a url passed: %s\n", p); } #else szurl[strlen("descent3://") - 1] = '\0'; // Should make the string "descent3:/" p = szurl + strlen("descent3://"); // pointer to the first character of the url after the // if (stricmp(szurl, "descent3:/") == 0) { - mprintf((0, "Got a url passed: %s\n", p)); + mprintf(0, "Got a url passed: %s\n", p); } #endif tokp = strtok(p, "/"); @@ -953,13 +953,13 @@ bool ProcessCommandLine() { if (LoadMultiDLL("Direct TCP~IP")) { CallMultiDLL(MT_AUTO_LOGIN); if (MultiDLLGameStarting) { - mprintf((0, "Successfully connected to server at specified url.\n")); + mprintf(0, "Successfully connected to server at specified url.\n"); exit_menu = 1; } else { - mprintf((0, "Couldn't connect to server at specified url.\n")); + mprintf(0, "Couldn't connect to server at specified url.\n"); } } else { - mprintf((0, "Couldn't load DLL.\n")); + mprintf(0, "Couldn't load DLL.\n"); } } else if (stricmp(tokp, "pxo") == 0) { tokp = strtok(NULL, "/"); @@ -970,13 +970,13 @@ bool ProcessCommandLine() { if (LoadMultiDLL("parallax online")) { CallMultiDLL(MT_AUTO_LOGIN); if (MultiDLLGameStarting) { - mprintf((0, "Successfully connected to server at specified url.\n")); + mprintf(0, "Successfully connected to server at specified url.\n"); exit_menu = 1; } else { - mprintf((0, "Couldn't connect to server at specified url.\n")); + mprintf(0, "Couldn't connect to server at specified url.\n"); } } else { - mprintf((0, "Couldn't load DLL.\n")); + mprintf(0, "Couldn't load DLL.\n"); } } } else if ((!Auto_connected) && (FindArg("-pxo"))) { @@ -1079,16 +1079,16 @@ static inline int count_missions(const char *pathname, const char *wildcard) { if (stricmp("d3_2.mn3", filename) == 0) continue; - mprintf((0, "Mission path:%s\n", fullpath)); + mprintf(0, "Mission path:%s\n", fullpath); name = GetMissionName(filename); GetMissionInfo(filename, &msninfo); if (name && name[0] && msninfo.single) { - mprintf((0, "Name:%s\n", name)); + mprintf(0, "Name:%s\n", name); c++; if (!(c % 2)) DoWaitMessage(true); } else { - mprintf((0, "Illegal mission:%s\n", fullpath)); + mprintf(0, "Illegal mission:%s\n", fullpath); } filename[0] = 0; } while (ddio_FindNextFile(filename)); diff --git a/Descent3/mission_download.cpp b/Descent3/mission_download.cpp index 90e4afa0..0e8b6ab0 100644 --- a/Descent3/mission_download.cpp +++ b/Descent3/mission_download.cpp @@ -327,7 +327,7 @@ int msn_DownloadWithStatus(char *url, char *filename) { //now see if the rest of the extension is ZIP if(!stricmp(url_ptr,".ZIP")) { - mprintf((0,"We're downloading a zip file!!!\n")); + mprintf(0,"We're downloading a zip file!!!\n"); file_is_zip = true; } } @@ -420,12 +420,12 @@ int msn_DownloadWithStatus(char *url, char *filename) { { //Update the dialog - //mprintf((0,"!")); + //mprintf(0,"!"); if(getmsnfile->IsFileReceived()) { //File transfer successful! - mprintf((0,"Succesfully received the file!\n")); + mprintf(0,"Succesfully received the file!\n"); exit_menu = 1; if(file_is_zip) @@ -444,7 +444,7 @@ int msn_DownloadWithStatus(char *url, char *filename) { DoMessageBox(TXT_ERROR,TXT_FMTCANTDNLD,MSGBOX_OK); //Delete the file that didn't finish! ddio_DeleteFile(qualfile); - mprintf((0,"Couldn't download the file! Error: %d\n",getmsnfile->GetErrorCode())); + mprintf(0,"Couldn't download the file! Error: %d\n",getmsnfile->GetErrorCode()); exit_menu = 1; ret = 0; } @@ -494,11 +494,11 @@ int msn_DownloadWithStatus(char *url, char *filename) { texts[6].Create (&menu_wnd,&rate_text,MSN_COL_1,MSN_ROW_4,0); progress.Update(((float)((float)received_bytes)/((float)total_bytes))); - //mprintf((0,"@")); + //mprintf(0,"@"); } - //mprintf((0,"-In")); + //mprintf(0,"-In"); res = PollUI(); - //mprintf((0,"-Out")); + //mprintf(0,"-Out"); switch(res) { case UID_CANCEL: @@ -619,7 +619,7 @@ int msn_CheckGetMission(network_address *net_addr, char *filename) { int sel = msn_ShowDownloadChoices(murls); if (sel != -1) { // Get the item that was selected! - mprintf((0, "Downloading missions file from %s\n", murls->URL[sel])); + mprintf(0, "Downloading missions file from %s\n", murls->URL[sel]); if (msn_DownloadWithStatus(murls->URL[sel], filename)) { return 1; } @@ -695,9 +695,9 @@ void _get_zipfilename(char *output, char *directory, char *zipfilename) { // return 1 on success int msn_ExtractZipFile(char *zipfilename, char *mn3name) { - mprintf((0, "Extracting ZIP File (%s) to missions directory\n", zipfilename)); + mprintf(0, "Extracting ZIP File (%s) to missions directory\n", zipfilename); if (!cfexist(zipfilename)) { - mprintf((0, "Zip file doesn't exist\n")); + mprintf(0, "Zip file doesn't exist\n"); return 0; } @@ -712,7 +712,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { zipentry *ze; if (!zfile.OpenZip(zipfilename)) { - mprintf((0, "Unable to open zip file\n")); + mprintf(0, "Unable to open zip file\n"); return 0; } @@ -734,7 +734,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { Descent->defer(); process_file = true; - mprintf((0, "Processesing: %s\n", ze->name)); + mprintf(0, "Processesing: %s\n", ze->name); if (ze->compression_method == 0x0000 || ze->compression_method == 0x0008) { char *rfile = strrchr(ze->name, '/'); @@ -754,7 +754,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { snprintf(buffer, sizeof(buffer), "%s already exists. Overwrite?", output_filename); if (DoMessageBox("Confirm", buffer, MSGBOX_YESNO, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL)) { // delete the file - mprintf((0, "Deleting %s\n", zipfilename)); + mprintf(0, "Deleting %s\n", zipfilename); if (!ddio_DeleteFile(output_filename)) { process_file = false; console.puts(GR_GREEN, "[Unable to Write] "); @@ -776,10 +776,10 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { int ret = zfile.ExtractFile(ze, output_filename); if (ret < 0) { if (ret == -9) { - mprintf((0, " Error writing to file\n")); + mprintf(0, " Error writing to file\n"); snprintf(buffer, sizeof(buffer), "\nError writing to file (Out of space?)"); } else { - mprintf((0, " Error %d extracting file\n", ret)); + mprintf(0, " Error %d extracting file\n", ret); snprintf(buffer, sizeof(buffer), "\nError %d extracting file", ret); } console.puts(GR_GREEN, buffer); @@ -804,7 +804,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { } } else { - mprintf((0, "Unsupported compression for file (%s)\n", ze->name)); + mprintf(0, "Unsupported compression for file (%s)\n", ze->name); console.puts(GR_GREEN, "Unsupported compression!!"); } @@ -817,7 +817,7 @@ int msn_ExtractZipFile(char *zipfilename, char *mn3name) { if (DoMessageBox("Confirm", "Do you want to delete the zip file? It is no longer needed.", MSGBOX_YESNO, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL)) { // delete the file - mprintf((0, "Deleting %s\n", zipfilename)); + mprintf(0, "Deleting %s\n", zipfilename); ddio_DeleteFile(zipfilename); } @@ -876,7 +876,7 @@ int CheckGetD3M(char *d3m) { strcat(modurl, fixedd3m); lowurl = mem_strdup(_strlwr(modurl)); - mprintf((0, "Downloading mod file from %s\n", modurl)); + mprintf(0, "Downloading mod file from %s\n", modurl); if (ModDownloadWithStatus(modurl, d3m)) { mem_free(fixedd3m); @@ -915,7 +915,7 @@ int ModDownloadWithStatus(char *url, char *filename) { //now see if the rest of the extension is ZIP if(!stricmp(url_ptr,".ZIP")) { - mprintf((0,"We're downloading a zip file!!!\n")); + mprintf(0,"We're downloading a zip file!!!\n"); file_is_zip = true; } } @@ -1011,12 +1011,12 @@ int ModDownloadWithStatus(char *url, char *filename) { { //Update the dialog - //mprintf((0,"!")); + //mprintf(0,"!"); if(getmsnfile->IsFileReceived()) { //File transfer successful! - mprintf((0,"Succesfully received the file!\n")); + mprintf(0,"Succesfully received the file!\n"); exit_menu = 1; if(file_is_zip) @@ -1035,7 +1035,7 @@ int ModDownloadWithStatus(char *url, char *filename) { DoMessageBox(TXT_ERROR,TXT_FMTCANTDNLD,MSGBOX_OK); //Delete the file that didn't finish! ddio_DeleteFile(qualfile); - mprintf((0,"Couldn't download the file! Error: %d\n",getmsnfile->GetErrorCode())); + mprintf(0,"Couldn't download the file! Error: %d\n",getmsnfile->GetErrorCode()); exit_menu = 1; ret = 0; } @@ -1085,11 +1085,11 @@ int ModDownloadWithStatus(char *url, char *filename) { texts[6].Create (&menu_wnd,&rate_text,MSN_COL_1,MSN_ROW_4,0); progress.Update(((float)((float)received_bytes)/((float)total_bytes))); - //mprintf((0,"@")); + //mprintf(0,"@"); } - //mprintf((0,"-In")); + //mprintf(0,"-In"); res = PollUI(); - //mprintf((0,"-Out")); + //mprintf(0,"-Out"); switch(res) { case UID_CANCEL: diff --git a/Descent3/multi.cpp b/Descent3/multi.cpp index 4acb622d..09379883 100644 --- a/Descent3/multi.cpp +++ b/Descent3/multi.cpp @@ -1950,7 +1950,7 @@ int MultiStuffPosition(int slot, uint8_t *data) { vector *vel = &obj->mtype.phys_info.velocity; vector *rotvel = &obj->mtype.phys_info.rotvel; - // mprintf ((0,"Outvel x=%f y=%f z=%f\n",vel->x,vel->y,vel->z)); + // mprintf(0,"Outvel x=%f y=%f z=%f\n",vel->x,vel->y,vel->z); MultiAddShort((vel->x * 128.0), data, &count); MultiAddShort((vel->y * 128.0), data, &count); @@ -1980,7 +1980,7 @@ void DoNextPlayerFile(int playernum) { NetPlayers[playernum].custom_file_seq++; if (NetPlayers[playernum].custom_file_seq > NETFILE_ID_LAST_FILE) { NetPlayers[playernum].custom_file_seq = NETFILE_ID_DONE; - mprintf((0, "Setting %s's custom ship logo to %s\n", Players[playernum].callsign, NetPlayers[playernum].ship_logo)); + mprintf(0, "Setting %s's custom ship logo to %s\n", Players[playernum].callsign, NetPlayers[playernum].ship_logo); PlayerSetCustomTexture(playernum, NetPlayers[playernum].ship_logo); // If we are the server, we need to tell everyone about this guy's custom data if ((Netgame.local_role == LR_SERVER) && (Use_file_xfer)) { @@ -2002,7 +2002,7 @@ int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data) { int count = 0; //@@multi_orientation mat; - // mprintf((0,"!"));//KBTEST + // mprintf(0,"!");//KBTEST object *obj = &Objects[objectnum]; ASSERT(obj->flags & OF_CLIENT_KNOWS); @@ -2049,14 +2049,14 @@ int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint1 int size; int count = 0; uint8_t data[MAX_GAME_DATA_SIZE]; - // mprintf((0,"Sending Robot %d fired.\n",objectnum)); + // mprintf(0,"Sending Robot %d fired.\n",objectnum); // Check to make sure we're the server if (Netgame.local_role != LR_SERVER) { BailOnMultiplayer(NULL); return 0; } - // mprintf((0,"@"));//KBTEST + // mprintf(0,"@");//KBTEST object *obj = &Objects[objectnum]; ASSERT(obj->flags & OF_CLIENT_KNOWS); @@ -2107,7 +2107,7 @@ void MultiDoRobotFire(uint8_t *data) { return; } - // mprintf((0,"*")); + // mprintf(0,"*"); SKIP_HEADER(data, &count); int serv_objnum = MultiGetUshort(data, &count); obj_num = Server_object_list[serv_objnum]; @@ -2277,7 +2277,7 @@ int MultiMatchPlayerToAddress(network_address *from_addr) { return i; } } - // mprintf ((0,"Got a packet from unconnected player?!\n")); + // mprintf(0,"Got a packet from unconnected player?!\n"); return -1; } @@ -2295,7 +2295,7 @@ void MultiDoMyInfo(uint8_t *data) { uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { - mprintf((1, "ERROR! We got a MY_INFO packet from a disconnected player!\n")); + mprintf(1, "ERROR! We got a MY_INFO packet from a disconnected player!\n"); Int3(); // Get Jason return; } @@ -2352,8 +2352,7 @@ void MultiDoMyInfo(uint8_t *data) { if (mt_sig != MASTER_TRACKER_SIG) { NetPlayers[slot].flags &= ~NPF_CONNECTED; - mprintf((0, "Invalid master tracker signature! Someone tried to join a master tracker game through the local net " - "screen!\n")); + mprintf(0, "Invalid master tracker signature! Someone tried to join a master tracker game through the local net screen!\n"); } NetPlayers[slot].flags |= NPF_MT_READING_PILOT; len = MultiGetByte(data, &count); @@ -2369,7 +2368,7 @@ void MultiDoMyInfo(uint8_t *data) { int ser = 0; ser = MultiGetInt(data, &count); if (ser) { - mprintf((0, "Serialized user joining game: %d\n", ser)); + mprintf(0, "Serialized user joining game: %d\n", ser); } // Get packets per second for this player @@ -2404,7 +2403,7 @@ void MultiDoMyInfo(uint8_t *data) { NetPlayers[slot].sequence = NETSEQ_NEED_GAMETIME; - mprintf((0, "Got a myinfo packet from %s len=%d!\n", Players[slot].callsign, len)); + mprintf(0, "Got a myinfo packet from %s len=%d!\n", Players[slot].callsign, len); } // Tell a client about the players connected @@ -2417,7 +2416,7 @@ void MultiDoRequestPlayers(uint8_t *data) { uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { - mprintf((1, "ERROR! We got a MY_INFO packet from a disconnected player!\n")); + mprintf(1, "ERROR! We got a MY_INFO packet from a disconnected player!\n"); Int3(); // Get Jason return; } @@ -2435,7 +2434,7 @@ void MultiDoRequestBuildings(uint8_t *data) { uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { - mprintf((1, "ERROR! We got a request buildings packet from a disconnected player!\n")); + mprintf(1, "ERROR! We got a request buildings packet from a disconnected player!\n"); Int3(); // Get Jason return; } @@ -2453,7 +2452,7 @@ void MultiDoRequestObjects(uint8_t *data) { uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { - mprintf((1, "ERROR! We got a request object packet from a disconnected player!\n")); + mprintf(1, "ERROR! We got a request object packet from a disconnected player!\n"); Int3(); // Get Jason return; } @@ -2500,7 +2499,7 @@ void MultiDoRequestWorldStates(uint8_t *data) { } } if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { - mprintf((1, "ERROR! We got a request world states packet from a disconnected player!\n")); + mprintf(1, "ERROR! We got a request world states packet from a disconnected player!\n"); Int3(); // Get Jason return; } @@ -2514,7 +2513,7 @@ void MultiDoPlayer(uint8_t *data) { int count = 0; char ship_name[PAGENAME_LEN]; - mprintf((0, "Got player packet!\n")); + mprintf(0, "Got player packet!\n"); // Skip header stuff SKIP_HEADER(data, &count); @@ -2587,7 +2586,7 @@ void MultiDoPlayer(uint8_t *data) { memcpy(&NetPlayers[slot].addr, data + count, sizeof(network_address)); char dbg_output[50]; nw_GetNumbersFromHostAddress(&NetPlayers[slot].addr, dbg_output); - mprintf((0, "Got player address of: %s\n", dbg_output)); + mprintf(0, "Got player address of: %s\n", dbg_output); count += sizeof(network_address); @@ -2620,10 +2619,10 @@ void MultiDoPlayer(uint8_t *data) { if (slot != Player_num) { obj->shields = shields; if (Players[slot].flags & PLAYER_FLAGS_DEAD) { - mprintf((0, "Incoming %d player is dead!\n", slot)); + mprintf(0, "Incoming %d player is dead!\n", slot); MultiMakePlayerGhost(slot); } else if (Players[slot].flags & PLAYER_FLAGS_DYING) { - mprintf((0, "Incoming %d player is dying!\n", slot)); + mprintf(0, "Incoming %d player is dying!\n", slot); int save_flags = Players[slot].flags; Players[slot].flags &= ~(PLAYER_FLAGS_DEAD | PLAYER_FLAGS_DYING); InitiatePlayerDeath(&Objects[Players[slot].objnum], false, 0); @@ -2651,7 +2650,7 @@ void MultiDoPlayerEnteredGame(uint8_t *data) { char ship_name[PAGENAME_LEN]; int length; - mprintf((0, "Got player entered game packet!\n")); + mprintf(0, "Got player entered game packet!\n"); // Skip header stuff SKIP_HEADER(data, &count); @@ -2818,7 +2817,7 @@ void MultiDoEnteringGame(uint8_t *data) { return; } - mprintf((0, "Client %d (%s) entering game.\n", slot, Players[slot].callsign)); + mprintf(0, "Client %d (%s) entering game.\n", slot, Players[slot].callsign); MultiSendPlayerEnteredGame(slot); @@ -2853,7 +2852,7 @@ void MultiSendEnteringGame() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending entering game\n")); + mprintf(0, "Sending entering game\n"); size = START_DATA(MP_ENTERING_GAME, data, &count); MultiAddByte(Player_num, data, &count); @@ -2954,7 +2953,7 @@ void MultiDoDonePlayers(uint8_t *data) { uint8_t num = MultiGetByte(data, &count); if (MultiCountPlayers() != num) { - mprintf((1, "ERROR! We don't have the correct number of players!")); + mprintf(1, "ERROR! We don't have the correct number of players!"); Int3(); // Get Jason return; } @@ -3106,7 +3105,7 @@ void MultiDoPlayerPos(uint8_t *data) { vel.y = ((float)MultiGetShort(data, &count)) / 128.0; vel.z = ((float)MultiGetShort(data, &count)) / 128.0; - // mprintf ((0,"INCOMING x=%f y=%f z=%f dist=%f\n",vel.x,vel.y,vel.z,dist)); + // mprintf(0,"INCOMING x=%f y=%f z=%f dist=%f\n",vel.x,vel.y,vel.z,dist); // Get rotational velocity if (Netgame.flags & NF_SENDROTVEL) { @@ -3248,7 +3247,7 @@ void MultiDoRobotPos(uint8_t *data) { uint16_t server_objnum = MultiGetUshort(data, &count); uint16_t objectnum = Server_object_list[server_objnum]; if (objectnum == 65535 || !(Objects[objectnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Bad robotposition object number!\n")); + mprintf(0, "Bad robotposition object number!\n"); return; } object *obj = &Objects[objectnum]; @@ -3389,7 +3388,7 @@ void MultiDoFirePlayerWB(uint8_t *data) { // Check to see if this player is firing a weapon he doesn't have player *playp = &Players[pnum]; if (!(playp->weapon_flags & (1 << wb_index))) { - mprintf((0, "Can't fire client weapon...flags=%d wb_index=%d\n", playp->weapon_flags, wb_index)); + mprintf(0, "Can't fire client weapon...flags=%d wb_index=%d\n", playp->weapon_flags, wb_index); ok_to_fire = 0; } @@ -3430,7 +3429,7 @@ void MultiSendLeaveGame() { int count = 0; int size_offset; - mprintf((0, "Sending leave game!\n")); + mprintf(0, "Sending leave game!\n"); if (Netgame.local_role == LR_SERVER) { size_offset = START_DATA(MP_SERVER_QUIT, data, &count, 1); @@ -3453,7 +3452,7 @@ void MultiSendLeaveGame() { // Called whenever I want to leave the game void MultiLeaveGame() { - mprintf((0, "I'm leaving the netgame!\n")); + mprintf(0, "I'm leaving the netgame!\n"); CallGameDLL(EVT_GAME_DISCONNECTED, &DLLInfo); @@ -3501,7 +3500,7 @@ void MultiSendReleaseTimeoutMissile() { ASSERT(Players[Player_num].user_timeout_obj != NULL); - mprintf((0, "Sending timeout weapon packet!\n")); + mprintf(0, "Sending timeout weapon packet!\n"); size_offset = START_DATA(MP_TIMEOUT_WEAPON, data, &count); MultiAddByte(Player_num, data, &count); @@ -3580,7 +3579,7 @@ void MultiDoLevelEnded(uint8_t *data) { if (Multi_next_level < 1 || Multi_next_level > Current_mission.num_levels) Multi_next_level = -1; - mprintf((0, "Doing level ended! Next level=%d\n", Multi_next_level)); + mprintf(0, "Doing level ended! Next level=%d\n", Multi_next_level); if (success) SetGameState(GAMESTATE_LVLEND); @@ -3604,7 +3603,7 @@ void MultiSendLevelEnded(int success, int next_level) { int count = 0; int size_offset; - mprintf((0, "Sending level ended!\n")); + mprintf(0, "Sending level ended!\n"); size_offset = START_DATA(MP_LEVEL_ENDED, data, &count, 1); MultiAddByte(success, data, &count); @@ -3642,7 +3641,7 @@ extern void MultiClearPlayerMarkers(int slot); void MultiDoLeaveGame(uint8_t *data) { int count = 0; - mprintf((0, "In MultiDoLeaveGame!\n")); + mprintf(0, "In MultiDoLeaveGame!\n"); // Skip header stuff SKIP_HEADER(data, &count); @@ -3658,7 +3657,7 @@ void MultiDoLeaveGame(uint8_t *data) { NetPlayers[slot].flags &= ~NPF_CONNECTED; NetPlayers[slot].secret_net_id = 0; } else - mprintf((0, "Got a leave game from a non-connected player!\n")); + mprintf(0, "Got a leave game from a non-connected player!\n"); // Now clear any files this guy might be receiving if (NetPlayers[slot].file_xfer_flags != NETFILE_NONE) { @@ -3715,7 +3714,7 @@ void MultiDoServerQuit(uint8_t *data) { NetPlayers[i].custom_file_seq = NETFILE_ID_NOFILE; } } - mprintf((0, "Server quitting!\n")); + mprintf(0, "Server quitting!\n"); MultiLeaveGame(); Sleep(2000); } @@ -3749,7 +3748,7 @@ void MultiDoDisconnect(uint8_t *data) { NetPlayers[slot].flags &= ~NPF_CONNECTED; NetPlayers[slot].secret_net_id = 0; } else - mprintf((0, "Got a disconnect from a non-connected player!\n")); + mprintf(0, "Got a disconnect from a non-connected player!\n"); ScoreAPIPlayerLeft(slot); } @@ -3813,7 +3812,7 @@ void MultiDoAskToJoin(uint8_t *data, network_address *from_addr) { MULTI_ASSERT(slot > 0, "FindFreeSlot returned -1!"); if (Players[slot].start_roomnum != -1) { - mprintf((0, "Sending OK to join!\n")); + mprintf(0, "Sending OK to join!\n"); MultiAddByte(JOIN_ANSWER_OK, outdata, &count); } else { MultiAddByte(JOIN_ANSWER_NO_ROOM, outdata, &count); @@ -3838,7 +3837,7 @@ void MultiDoGetGameInfo(uint8_t *data, network_address *from_addr) { network_address my_addr; float ping_time; - // mprintf ((0,"Got a request for knowledge about my game!\n")); + // mprintf(0,"Got a request for knowledge about my game!\n"); // Get the time and stuff it back in the packet SKIP_HEADER(data, &count); @@ -3925,7 +3924,7 @@ void MultiDoGetPXOGameInfo(uint8_t *data, network_address *from_addr) { float ping_time; network_address my_addr; - // mprintf ((0,"Got a request for knowledge about my game!\n")); + // mprintf(0,"Got a request for knowledge about my game!\n"); if (!Game_is_master_tracker_game) { return; @@ -4025,7 +4024,7 @@ void MultiDoGameInfo(uint8_t *data, network_address *from_addr) { if (Num_network_games_known >= MAX_NETWORK_GAMES) return; - // mprintf ((0,"Got game info packet!!\n")); + // mprintf(0,"Got game info packet!!\n"); SKIP_HEADER(data, &count); @@ -4108,7 +4107,7 @@ void MultiDoGameInfo(uint8_t *data, network_address *from_addr) { Network_games[n].difficulty = diff; // This handle is used to make the game list update nicely Network_games[n].handle = Netgame_curr_handle++; - // mprintf ((0,"Got new game called %s!\n",name)); + // mprintf(0,"Got new game called %s!\n",name); Num_network_games_known++; @@ -4176,7 +4175,7 @@ void MultiDoBuilding(uint8_t *data) { for (int i = 0; i < num; i++) { uint16_t objnum = MultiGetUshort(data, &count); if (Objects[objnum].type != OBJ_BUILDING) { - mprintf((0, "Error! Server says objnum %d is a building and its not!\n", objnum)); + mprintf(0, "Error! Server says objnum %d is a building and its not!\n", objnum); } else { Multi_building_states[objnum] = 1; @@ -4204,7 +4203,7 @@ void MultiDoWorldStates(uint8_t *data) { SKIP_HEADER(data, &count); - mprintf((0, "Got a world state packet!\n")); + mprintf(0, "Got a world state packet!\n"); while ((world_type = MultiGetByte(data, &count)) != WS_END) { switch (world_type) { @@ -4216,8 +4215,11 @@ void MultiDoWorldStates(uint8_t *data) { Rooms[roomnum].wind.y = MultiGetFloat(data, &count); Rooms[roomnum].wind.z = MultiGetFloat(data, &count); - mprintf((0, "Got room wind packet! Room=%d wind=%f %f %f\n", roomnum, Rooms[roomnum].wind.x, - Rooms[roomnum].wind.y, Rooms[roomnum].wind.z)); + mprintf(0, "Got room wind packet! Room=%d wind=%f %f %f\n", + roomnum, + Rooms[roomnum].wind.x, + Rooms[roomnum].wind.y, + Rooms[roomnum].wind.z); break; } case WS_ROOM_FOG: { @@ -4430,7 +4432,7 @@ void MultiDoWorldStates(uint8_t *data) { int flags = MultiGetInt(data, &count); int temp = 0xFFFFFFFF; - mprintf((0, "Recieved Level Goal World State: %d\n", goal_index)); + mprintf(0, "Recieved Level Goal World State: %d\n", goal_index); Level_goals.GoalSetName(goal_index, name); Level_goals.GoalStatus(goal_index, LO_CLEAR_SPECIFIED, &temp); Level_goals.GoalStatus(goal_index, LO_SET_SPECIFIED, &flags, false); @@ -4440,7 +4442,7 @@ void MultiDoWorldStates(uint8_t *data) { } case WS_SPEW: { spewinfo spew; - mprintf((0, "Got a spew packet!\n")); + mprintf(0, "Got a spew packet!\n"); uint16_t spewnum = MultiGetShort(data, &count); @@ -4489,7 +4491,7 @@ void MultiDoWorldStates(uint8_t *data) { ASSERT(local_spewnum != -1); // DAJ -1FIX local_spewnum &= 0xFF; // Adjust for handle Server_spew_list[spewnum] = local_spewnum; - mprintf((0, "Got spew of type %d. Server=%d local=%d\n", spew.effect_type, spewnum, local_spewnum)); + mprintf(0, "Got spew of type %d. Server=%d local=%d\n", spew.effect_type, spewnum, local_spewnum); break; } @@ -4562,7 +4564,7 @@ void MultiDoJoinDemoObjects(uint8_t *data) { int local_objnum; Multi_Expect_demo_object_flags = true; - mprintf((0, "Processing DoJoinDemoObjects...\n")); + mprintf(0, "Processing DoJoinDemoObjects...\n"); for (int i = 0; i < num_demo_objects; i++) { objnum = MultiGetUshort(data, &count); @@ -4585,7 +4587,7 @@ void MultiDoJoinObjects(uint8_t *data) { SKIP_HEADER(data, &count); uint8_t num_objects = MultiGetByte(data, &count); - mprintf((0, "Got join object packet. Num objects=%d\n", num_objects)); + mprintf(0, "Got join object packet. Num objects=%d\n", num_objects); for (int i = 0; i < num_objects; i++) { bool obj_is_dummy = false; @@ -4594,7 +4596,7 @@ void MultiDoJoinObjects(uint8_t *data) { uint16_t server_objnum = MultiGetUshort(data, &count); uint8_t type = MultiGetByte(data, &count); - //@@mprintf ((0,"Got join objnum %d from server. Type=%d\n",server_objnum,type)); + //@@mprintf(0,"Got join objnum %d from server. Type=%d\n",server_objnum,type); if (type == OBJ_DUMMY) { obj_is_dummy = true; @@ -4629,7 +4631,7 @@ void MultiDoJoinObjects(uint8_t *data) { id = MultiMatchGeneric(checksum); if (id == -1) { - mprintf((0, "Server data doesn't match client data!\n")); + mprintf(0, "Server data doesn't match client data!\n"); ASSERT(1); // Error ("Server data doesn't match client data!"); MultiMatchGeneric(checksum); @@ -4747,8 +4749,9 @@ void MultiSendPlayerDead(int slot, uint8_t fate) { MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_PLAYERS); MultiDoPlayerDead(data); if (Game_is_master_tracker_game) { - mprintf((0, "Adding kill and death to player stats. Killer = %d Killee = %d\n", - Objects[Players[slot].killer_objnum].id, slot)); + mprintf(0, "Adding kill and death to player stats. Killer = %d Killee = %d\n", + Objects[Players[slot].killer_objnum].id, + slot); if (Objects[Players[slot].killer_objnum].id == slot) { Players[slot].suicides++; } else { @@ -4788,7 +4791,7 @@ void MultiDoRenewPlayer(uint8_t *data) { // add guidebot if needed if (add_guidebot) { - mprintf((0, "MULTI: Adding guidebot to respawned player (%s)\n", Players[slot].callsign)); + mprintf(0, "MULTI: Adding guidebot to respawned player (%s)\n", Players[slot].callsign); if (!Players[slot].inventory.CheckItem(OBJ_ROBOT, ROBOT_GUIDEBOT)) Players[slot].inventory.Add(OBJ_ROBOT, ROBOT_GUIDEBOT); } @@ -4855,7 +4858,7 @@ void GetServerGameTime() { uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int size; - mprintf((0, "Requesting gametime from server\n")); + mprintf(0, "Requesting gametime from server\n"); Got_new_game_time = 0; size = START_DATA(MP_GET_GAMETIME, outdata, &count); MultiAddFloat(timer_GetTime(), outdata, &count); @@ -4869,7 +4872,7 @@ void MultiDoGameTimeReq(uint8_t *data, network_address *from_addr) { int size; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); - mprintf((0, "Processing request for gametime\n")); + mprintf(0, "Processing request for gametime\n"); SKIP_HEADER(data, &incount); float client_time = MultiGetFloat(data, &incount); @@ -4887,7 +4890,7 @@ void MultiDoSetGameTime(uint8_t *data) { float server_latency; float server_game_time; int count = 0; - mprintf((0, "Processing and setting new for gametime\n")); + mprintf(0, "Processing and setting new for gametime\n"); MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); // Now get the latency. We calculate this by comparing the current timer to the time we got back // Which was the time that we sent the request. @@ -4897,10 +4900,10 @@ void MultiDoSetGameTime(uint8_t *data) { // Half of the ping time is the latency server_latency = (timer_GetTime() - req_time) / 2; - mprintf((0, "Server Latency = %f\n", server_latency)); + mprintf(0, "Server Latency = %f\n", server_latency); Gametime = (server_game_time + server_latency); - mprintf((0, "New gametime = %f\n", Gametime)); + mprintf(0, "New gametime = %f\n", Gametime); Got_new_game_time = 1; } @@ -4910,7 +4913,7 @@ void MultiSendEndPlayerDeath() { uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; - mprintf((0, "Sending end player death packet!\n")); + mprintf(0, "Sending end player death packet!\n"); size_offset = START_DATA(MP_END_PLAYER_DEATH, data, &count); @@ -5114,7 +5117,7 @@ void MultiDoExecuteDLL(uint8_t *data) { else { local_me_objnum = Server_object_list[me_objnum]; if (local_me_objnum == 65535) { - mprintf((0, "Invalid object in DoExecuteDLL!\n")); + mprintf(0, "Invalid object in DoExecuteDLL!\n"); Int3(); return; } @@ -5125,14 +5128,14 @@ void MultiDoExecuteDLL(uint8_t *data) { else { local_it_objnum = Server_object_list[it_objnum]; if (local_it_objnum == 65535) { - mprintf((0, "Invalid object in DoExecuteDLL!\n")); + mprintf(0, "Invalid object in DoExecuteDLL!\n"); Int3(); return; } } - // mprintf ((0,"Received MP_EXECUTE_DLL packet! type=%d - // id=%d\n",Objects[local_me_objnum].type,Objects[local_me_objnum].id)); + // mprintf(0,"Received MP_EXECUTE_DLL packet! type=%d + // id=%d\n",Objects[local_me_objnum].type,Objects[local_me_objnum].id); int mehandle; int ithandle; @@ -5170,9 +5173,11 @@ void MultiDoObject(uint8_t *data) { if (parent_objnum == server_objnum) self_parent = true; - - // mprintf((0,"MultiDoObject() got a new object. Server's objnum = %d Parent objnum = - // %d\n",server_objnum,parent_objnum)); +/* + mprintf(0,"MultiDoObject() got a new object. Server's objnum = %d Parent objnum = %d\n", + server_objnum, + parent_objnum); + */ if (self_parent || parent_objnum == 65535) parent_handle = OBJECT_HANDLE_NONE; else { @@ -5206,7 +5211,7 @@ void MultiDoObject(uint8_t *data) { id = MultiMatchGeneric(checksum); if (id == -1) { - mprintf((0, "Server data doesn't match!\n")); + mprintf(0, "Server data doesn't match!\n"); MULTI_ASSERT(id != -1, "Server data doesn't match!"); if (type == OBJ_WEAPON) @@ -5271,7 +5276,7 @@ void MultiDoObject(uint8_t *data) { } if (local_objnum < 0) { - mprintf((0, "Ran out of objects!\n")); + mprintf(0, "Ran out of objects!\n"); Int3(); // Get Jason return; } @@ -5331,12 +5336,12 @@ void MultiDoObject(uint8_t *data) { obj->flags |= OF_CLIENTDEMOOBJECT; if (Demo_flags == DF_RECORDING) { - mprintf((0, "Recording object created on server\n")); + mprintf(0, "Recording object created on server\n"); // DemoWriteObjCreate(obj->type,obj->id,obj->roomnum,&obj->pos,&obj->orient,obj->parent_handle,obj); } } - // mprintf((0,"MultiDoObject() Local objnum = %d\n",Server_object_list[server_objnum])); + // mprintf(0,"MultiDoObject() Local objnum = %d\n",Server_object_list[server_objnum]); } // Sends an object from the server to the client @@ -5353,7 +5358,7 @@ void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record) { if (demo_record) obj->flags |= OF_CLIENTDEMOOBJECT; - // mprintf ((0,"Telling clients to CREATE object %d type=%d\n",obj-Objects,obj->type)); + // mprintf(0,"Telling clients to CREATE object %d type=%d\n",obj-Objects,obj->type); object *parent_obj = ObjGetUltimateParent(obj); @@ -5435,7 +5440,7 @@ void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record) { MultiAnnounceEffect(obj, obj->size * 3, .7f); } - // mprintf((0,"Sending object %d to clients.\n",OBJNUM(obj))); + // mprintf(0,"Sending object %d to clients.\n",OBJNUM(obj)); MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, true); } @@ -5554,7 +5559,7 @@ void MultiDoMissileRelease(int slot, uint8_t *data) { if (Netgame.local_role == LR_SERVER) { // verify that slot and player match up if (pnum_release != slot) { - mprintf((0, "%s Release: Packet pnum does not match real pnum\n", (is_guided) ? "Guided" : "Timeout")); + mprintf(0, "%s Release: Packet pnum does not match real pnum\n", (is_guided) ? "Guided" : "Timeout"); return; } @@ -5569,7 +5574,7 @@ void MultiDoMissileRelease(int slot, uint8_t *data) { } else { // make sure we got this packet from the server if (slot != 0) { - mprintf((0, "%s Release: got packet from non-server!?!\n", (is_guided) ? "Guided" : "Timeout")); + mprintf(0, "%s Release: got packet from non-server!?!\n", (is_guided) ? "Guided" : "Timeout"); return; } @@ -5702,33 +5707,33 @@ void MultiDoRemoveObject(uint8_t *data) { count+=len; #endif*/ - // mprintf ((0,"Server says to remove object %d\n",server_objnum)); + // mprintf(0,"Server says to remove object %d\n",server_objnum); int local_objnum = Server_object_list[server_objnum]; if (local_objnum == 65535) { - mprintf((0, "Client/Server object lists don't match. Something is wrong!\n")); + mprintf(0, "Client/Server object lists don't match. Something is wrong!\n"); // Error ("Bad object 1"); return; } if (!(Objects[local_objnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Client/Server object lists don't match. Something is wrong!\n")); + mprintf(0, "Client/Server object lists don't match. Something is wrong!\n"); ASSERT(1); Objects[local_objnum].flags |= OF_SERVER_OBJECT; } - /* if (Objects[local_objnum].type!=type) - { - mprintf ((0,"Client/Server object types don't match. Something is wrong!\n")); - //mprintf ((0,"Object to be removed was type %d, I thought it was %d name: - %s\n",type,Objects[local_objnum].type,name)); Error ("Bad object 2"); ASSERT (1); return; - }*/ - +/* + if (Objects[local_objnum].type != type) { + mprintf(0, "Client/Server object types don't match. Something is wrong!\n"); + // mprintf (0,"Object to be removed was type %d, I thought it was %d name: + // %s\n",type,Objects[local_objnum].type,name)); Error ("Bad object 2"); ASSERT (1); return; + } +*/ if (sound) Sound_system.Play3dSound(SOUND_POWERUP_PICKUP, &Objects[local_objnum]); if (Objects[local_objnum].flags & OF_CLIENTDEMOOBJECT) { if (Demo_flags == DF_RECORDING) { - mprintf((0, "Recording object deleted on server\n")); + mprintf(0, "Recording object deleted on server\n"); DemoWriteSetObjDead(&Objects[local_objnum]); } } @@ -5760,8 +5765,8 @@ void MultiSendRemoveObject(object *obj, uint8_t playsound) { size_offset = START_DATA(MP_REMOVE_OBJECT, data, &count, 1); - // mprintf ((0,"Telling clients to remove object %d type=%d - // name=%s\n",obj-Objects,obj->type,Object_info[obj->id].name)); + // mprintf(0,"Telling clients to remove object %d type=%d + // name=%s\n",obj-Objects,obj->type,Object_info[obj->id].name); ASSERT(obj->flags & OF_CLIENT_KNOWS); @@ -5948,7 +5953,7 @@ void MultiSendAdditionalDamage(int slot, int type, float amount) { END_DATA(count, data, size_offset); - mprintf((0, "Sending additional damage packet of type=%d amount=%f!\n", type, amount)); + mprintf(0, "Sending additional damage packet of type=%d amount=%f!\n", type, amount); MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_PLAYING, false); } @@ -5959,7 +5964,7 @@ void MultiDoAdditionalDamage(uint8_t *data) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_CLIENT); - // mprintf ((0,"Got additional damage packet!\n")); + // mprintf(0,"Got additional damage packet!\n"); SKIP_HEADER(data, &count); @@ -6068,7 +6073,7 @@ void MultiDoRequestDamage(uint8_t *data) { void MultiDoRequestCountermeasure(uint8_t *data) { int count = 0; - mprintf((0, "Got request for countermeasure!\n")); + mprintf(0, "Got request for countermeasure!\n"); SKIP_HEADER(data, &count); @@ -6084,7 +6089,7 @@ void MultiDoRequestCountermeasure(uint8_t *data) { int id = MultiMatchWeapon(checksum); if (id == -1) { - mprintf((0, "Server data doesn't match!\n")); + mprintf(0, "Server data doesn't match!\n"); Int3(); MultiMatchWeapon(checksum); @@ -6119,7 +6124,7 @@ void MultiSendRequestCountermeasure(int16_t objnum, int weapon_index) { else MultiDoRequestCountermeasure(data); - mprintf((0, "Sending out request for countermeasure!\n")); + mprintf(0, "Sending out request for countermeasure!\n"); } // Server is telling us about a player who is changing his observer mode @@ -6159,7 +6164,7 @@ void MultiDoRequestToObserve(uint8_t *data) { int count = 0; int objnum; - mprintf((0, "Got request to observe!\n")); + mprintf(0, "Got request to observe!\n"); MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); @@ -6326,7 +6331,7 @@ void MultiSendRequestPeerDamage(object *killer, int weapon_id, int damage_type, if (Netgame.local_role == LR_SERVER) return; - mprintf((0, "Sending request peer damage of %f\n", amount)); + mprintf(0, "Sending request peer damage of %f\n", amount); size = START_DATA(MP_REQUEST_PEER_DAMAGE, data, &count); MultiAddByte(Player_num, data, &count); @@ -6357,7 +6362,7 @@ void MultiMassageAllObjects(int kill_powerups, int kill_robots) { Num_powerup_timer = 0; Num_client_lm_objects = 0; Num_server_lm_objects = 0; - mprintf((0, "Massaging all objects!\n")); + mprintf(0, "Massaging all objects!\n"); for (i = 0; i <= Highest_object_index; i++) { // If client, delete all robots and powerups @@ -6531,7 +6536,7 @@ void MultiSendFullReliablePacket(int slot, int flags) { // We're sending to the server if (slot == SERVER_PLAYER) { - // mprintf ((0,"Sending full packet of size %d to slot%d!\n",Multi_cur_send_size,slot)); + // mprintf(0,"Sending full packet of size %d to slot%d!\n",Multi_cur_send_size,slot); nw_SendReliable(NetPlayers[Player_num].reliable_socket, Multi_reliable_send_buffer[Player_num], Multi_reliable_send_size[Player_num], false); Multi_reliable_send_size[Player_num] = 0; @@ -6643,7 +6648,7 @@ int MultiMatchWeapon(uint32_t unique_id) { void MultiBuildMatchTables() { int i; - mprintf((0, "Building match tables for multiplayer.\n")); + mprintf(0, "Building match tables for multiplayer.\n"); memset(Multi_generic_match_table, 0, MAX_OBJECT_IDS * sizeof(int)); memset(Multi_weapon_match_table, 0, MAX_WEAPONS * sizeof(int)); @@ -6657,7 +6662,7 @@ void MultiBuildMatchTables() { // See if there is a hash collision. If so, increment the value and retry while ((MultiMatchGeneric(val)) != -1) { - mprintf((0, "Match collision!\n")); + mprintf(0, "Match collision!\n"); Int3(); val++; } @@ -6674,7 +6679,7 @@ void MultiBuildMatchTables() { // See if there is a hash collision. If so, increment the value and retry while ((MultiMatchWeapon(val)) != -1) { - mprintf((0, "Match collision!\n")); + mprintf(0, "Match collision!\n"); Int3(); val++; } @@ -6741,7 +6746,7 @@ void MultiSendKillObject(object *hit_obj, object *killer, float damage, int deat uint8_t data[MAX_GAME_DATA_SIZE]; uint16_t hit_objnum, killer_objnum; - // mprintf((0,"MultiSendExplodeObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer))); + // mprintf(0,"MultiSendExplodeObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer)); MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); ASSERT(hit_obj->flags & OF_CLIENT_KNOWS); @@ -6779,7 +6784,7 @@ void MultiDoRobotExplode(uint8_t *data) { hit_objnum = Server_object_list[MultiGetUshort(data, &count)]; if (hit_objnum == 65535) { - mprintf((0, "Bad hit_objnum(%d) MultiDoRobotExplode\n", hit_objnum)); + mprintf(0, "Bad hit_objnum(%d) MultiDoRobotExplode\n", hit_objnum); ASSERT(1); return; } @@ -6790,7 +6795,7 @@ void MultiDoRobotExplode(uint8_t *data) { killer_objnum = Server_object_list[killer_objnum]; if (killer_objnum == 65535) { - mprintf((0, "Bad killer_objnum(%d) in MultiDoRobotExplode()\n", killer_objnum)); + mprintf(0, "Bad killer_objnum(%d) in MultiDoRobotExplode()\n", killer_objnum); } } @@ -6819,10 +6824,10 @@ void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int we uint8_t data[MAX_GAME_DATA_SIZE]; uint16_t hit_objnum, killer_objnum; - // mprintf((0,"MultiSendDamageObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer))); + // mprintf(0,"MultiSendDamageObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer)); MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); ASSERT(hit_obj->flags & OF_CLIENT_KNOWS); - // mprintf((0,"$"));//KBTEST + // mprintf(0,"$");//KBTEST size = START_DATA(MP_ROBOT_DAMAGE, data, &count, 1); // Get the dying objnum hit_objnum = OBJNUM(hit_obj); @@ -6850,7 +6855,7 @@ void MultiDoRobotDamage(uint8_t *data) { if (hit_objnum == 65535 || killer_objnum == 65535 || !(Objects[hit_objnum].flags & OF_SERVER_OBJECT) || !(Objects[killer_objnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Bad hit_objnum(%d) or killer_objnum(%d) in MultiDoRobotDamage()\n", hit_objnum, killer_objnum)); + mprintf(0, "Bad hit_objnum(%d) or killer_objnum(%d) in MultiDoRobotDamage()\n", hit_objnum, killer_objnum); // Int3(); // Get Jason, bad object number return; } @@ -6869,7 +6874,7 @@ void MultiDoRobotDamage(uint8_t *data) { void MultiAddObjAnimUpdate(int objnum) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); ASSERT(Objects[objnum].flags & OF_CLIENT_KNOWS); - // mprintf((0,"D`")); + // mprintf(0,"D`"); for (int i = 0; i < MAX_NET_PLAYERS; i++) { if (i == Player_num) continue; @@ -6903,7 +6908,7 @@ int MultiStuffObjAnimUpdate(uint16_t objnum, uint8_t *data) { return 0; } - // mprintf((0,"MultiStuffObjAnimUpdate Sending object %d\n",objnum)); + // mprintf(0,"MultiStuffObjAnimUpdate Sending object %d\n",objnum); if (ObjGetAnimUpdate(objnum, &multi_anim_info)) // Checks if obj is still alive and all { ASSERT(Objects[objnum].flags & OF_CLIENT_KNOWS); @@ -6928,7 +6933,7 @@ void MultiDoObjAnimUpdate(uint8_t *data) { int objnum; int count = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); - // mprintf((0,"R`")); + // mprintf(0,"R`"); SKIP_HEADER(data, &count); int serverobjnum = MultiGetUshort(data, &count); objnum = Server_object_list[serverobjnum]; @@ -6942,7 +6947,7 @@ void MultiDoObjAnimUpdate(uint8_t *data) { multi_anim_info.anim_sound_index = MultiGetShort(data, &count); if (objnum == 65535) { - mprintf((0, "bad objnum in MultiDoObjAnimUpdate() server=%d\n", serverobjnum)); + mprintf(0, "bad objnum in MultiDoObjAnimUpdate() server=%d\n", serverobjnum); // Int3(); // Get Jason, bad object number return; } @@ -6966,7 +6971,7 @@ void MultiDoPlay3dSound(uint8_t *data) { uint8_t priority = MultiGetByte(data, &count); if (objnum == 65535 || !(Objects[objnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Bad server objnum(%d) in MultiDoPlay3dSound().\n", serverobjnum)); + mprintf(0, "Bad server objnum(%d) in MultiDoPlay3dSound().\n", serverobjnum); // Int3(); // Get Jason, bad object number return; } @@ -6980,7 +6985,7 @@ void MultiPlay3dSound(int16_t soundidx, uint16_t objnum, int priority) { int size = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); ASSERT(Objects[objnum].flags & OF_CLIENT_KNOWS); - // mprintf((0,"^"));//KBTEST + // mprintf(0,"^");//KBTEST size = START_DATA(MP_PLAY_3D_SOUND_FROM_OBJ, data, &count); MultiAddUshort(objnum, data, &count); MultiAddShort(soundidx, data, &count); @@ -7007,9 +7012,9 @@ void MultiSendRobotFireSound(int16_t soundidx, uint16_t objnum) { int size; int count = 0; uint8_t data[MAX_GAME_DATA_SIZE]; - // mprintf((0,"&"));//KBTEST + // mprintf(0,"&");//KBTEST MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); - // mprintf((0,"Sending Robot %d fire sound.\n",objnum)); + // mprintf(0,"Sending Robot %d fire sound.\n",objnum); object *obj = &Objects[objnum]; ASSERT(obj->flags & OF_CLIENT_KNOWS); @@ -7049,7 +7054,7 @@ void MultiDoRobotFireSound(uint8_t *data) { soundidx = MultiGetShort(data, &count); if (objnum == 65535 || !(Objects[objnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Bad server objnum(%d) in MultiDoRobotFireSound().Objnum = %d\n", serverobjnum, objnum)); + mprintf(0, "Bad server objnum(%d) in MultiDoRobotFireSound().Objnum = %d\n", serverobjnum, objnum); // Int3(); // Get Jason, bad object number return; } @@ -7088,7 +7093,7 @@ int MultiStuffTurretUpdate(uint16_t objnum, uint8_t *data) { int count = 0; int size = 0; multi_turret multi_turret_info; - // mprintf((0,"MultiStuffTurretUpdate Sending object %d\n",objnum)); + // mprintf(0,"MultiStuffTurretUpdate Sending object %d\n",objnum); if (Netgame.local_role != LR_SERVER) { BailOnMultiplayer(NULL); return 0; @@ -7134,7 +7139,7 @@ void MultiDoTurretUpdate(uint8_t *data) { objnum = Server_object_list[serverobjnum]; if (objnum == 65535 || !(Objects[objnum].flags & OF_SERVER_OBJECT)) { - mprintf((0, "Bad server objnum(%d) in MultiDoTurretUpdate().\n", serverobjnum)); + mprintf(0, "Bad server objnum(%d) in MultiDoTurretUpdate().\n", serverobjnum); // Int3(); // Get Jason , bad object number return; } @@ -7155,9 +7160,9 @@ void MultiDoTurretUpdate(uint8_t *data) { void MultiSendClientInventoryUseItem(int type, int id) { if (id == -1) { - mprintf((0, "Asking server to use objnum %d\n", OBJNUM(ObjGet(type)))); + mprintf(0, "Asking server to use objnum %d\n", OBJNUM(ObjGet(type))); } else { - mprintf((0, "Asking server to use T=%d ID=%d\n", type, id)); + mprintf(0, "Asking server to use T=%d ID=%d\n", type, id); } int size = 0; @@ -7185,8 +7190,10 @@ void MultiSendClientInventoryUseItem(int type, int id) { int server_objnum = Local_object_list[OBJNUM(local_obj)]; ASSERT(server_objnum != 65535); - mprintf((0, "Inven Use: Requesting to use server objnum %d. T=%d i=%d\n", server_objnum, local_obj->type, - local_obj->id)); + mprintf(0, "Inven Use: Requesting to use server objnum %d. T=%d i=%d\n", + server_objnum, + local_obj->type, + local_obj->id); size = START_DATA(MP_CLIENT_USE_INVENTORY_ITEM, data, &count, 1); MultiAddUshort(server_objnum, data, &count); @@ -7217,13 +7224,13 @@ void MultiDoClientInventoryUseItem(int slot, uint8_t *data) { int server_objnum; server_objnum = type; - mprintf((0, "Inven: use request objnum %d\n", server_objnum)); + mprintf(0, "Inven: use request objnum %d\n", server_objnum); // the objnum coming in better be in our object list ASSERT(server_objnum >= 0 && server_objnum < MAX_OBJECTS); ASSERT(Objects[server_objnum].type != OBJ_NONE); - mprintf((0, "Client is asking me to use objnum %d\n", server_objnum)); + mprintf(0, "Client is asking me to use objnum %d\n", server_objnum); // convert type to objhandle type = Objects[server_objnum].handle; @@ -7237,25 +7244,25 @@ void MultiDoClientInventoryUseItem(int slot, uint8_t *data) { id = MultiMatchGeneric(hash); } - mprintf((0, "Client is asking me to use T=%d ID=%d\n", type, id)); + mprintf(0, "Client is asking me to use T=%d ID=%d\n", type, id); } if (is_counter_measure) { if (Players[slot].counter_measures.FindPos(type, id)) { - mprintf((0, "I found it, so I'm going to use it\n")); + mprintf(0, "I found it, so I'm going to use it\n"); if (Players[slot].counter_measures.UsePos(&Objects[Players[slot].objnum])) { // Tell clients to remove this item MultiSendInventoryRemoveItem(slot, type, id); } } else { - mprintf((0, "But I couldn't find it in my copy of his inventory\n")); + mprintf(0, "But I couldn't find it in my copy of his inventory\n"); } } else { if (Players[slot].inventory.FindPos(type, id)) { if (id == -1) { - mprintf((0, "I found it, so I'm going to use it, type=%d id=%d\n", type, id)); + mprintf(0, "I found it, so I'm going to use it, type=%d id=%d\n", type, id); } else { - mprintf((0, "I found it, so I'm going to use it, handle=0x%x id=%d\n", type, id)); + mprintf(0, "I found it, so I'm going to use it, handle=0x%x id=%d\n", type, id); } if (Players[slot].inventory.UsePos(&Objects[Players[slot].objnum])) { @@ -7263,7 +7270,7 @@ void MultiDoClientInventoryUseItem(int slot, uint8_t *data) { MultiSendInventoryRemoveItem(slot, type, id); } } else { - mprintf((0, "But I couldn't find it in my copy of his inventory\n")); + mprintf(0, "But I couldn't find it in my copy of his inventory\n"); } } } @@ -7295,7 +7302,7 @@ void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data) { ASSERT(type >= 0 && type < MAX_OBJECTS); ASSERT(Objects[type].type != OBJ_NONE); - mprintf((0, "Server is telling me to remove objnum %d\n", type)); + mprintf(0, "Server is telling me to remove objnum %d\n", type); // convert type to objhandle type = Objects[type].handle; @@ -7306,11 +7313,11 @@ void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data) { if (type == OBJ_WEAPON) { id = MultiMatchWeapon(hash); - mprintf((0, "Server is telling me to remove T=%d ID=%d from %d\n", type, id, pnum)); + mprintf(0, "Server is telling me to remove T=%d ID=%d from %d\n", type, id, pnum); Players[pnum].counter_measures.Remove(type, id); } else { id = MultiMatchGeneric(hash); - mprintf((0, "Server is telling me to remove T=%d ID=%d from %d\n", type, id, pnum)); + mprintf(0, "Server is telling me to remove T=%d ID=%d from %d\n", type, id, pnum); Players[pnum].inventory.Remove(type, id); } } @@ -7319,9 +7326,9 @@ void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data) { // Tell the clients to remove an item from a player's inventory void MultiSendInventoryRemoveItem(int slot, int type, int id) { if (id == -1) { - mprintf((0, "Telling clients to remove objnum %d from %d\n", OBJNUM(ObjGet(type)), slot)); + mprintf(0, "Telling clients to remove objnum %d from %d\n", OBJNUM(ObjGet(type)), slot); } else { - mprintf((0, "Telling clients to remove inven item T=%d ID=%d from %d\n", type, id, slot)); + mprintf(0, "Telling clients to remove inven item T=%d ID=%d from %d\n", type, id, slot); } int size = 0; @@ -7392,7 +7399,7 @@ void MultiDoAudioTauntTime(uint8_t *data) { void MultiAddObjWBAnimUpdate(int objnum) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); ASSERT(Objects[objnum].flags & OF_CLIENT_KNOWS); - // mprintf((0,"D`")); + // mprintf(0,"D`"); for (int i = 0; i < MAX_NET_PLAYERS; i++) { if (i == Player_num) continue; @@ -7427,7 +7434,7 @@ int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data) { } ASSERT(Objects[objnum].flags & OF_CLIENT_KNOWS); - // mprintf((0,"%"));//KBTEST + // mprintf(0,"%");//KBTEST /* if(ObjGetAnimUpdate(objnum, &multi_anim_info)) // Checks if obj is still alive and all { @@ -7453,7 +7460,7 @@ void MultiDoObjWBAnimUpdate(uint8_t *data) { // int objnum; int count = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); - // mprintf((0,"R`")); + // mprintf(0,"R`"); SKIP_HEADER(data, &count); /* objnum = Server_object_list[MultiGetUshort (data,&count)]; @@ -7520,9 +7527,9 @@ void MultiDoBytesSent(uint8_t *data) { Bandwidth_throttle--; Bandwidth_throttle--; } - // mprintf_at((2,1,0,"Packet Loss: %d%% ",pct_loss)); + // mprintf_at(2,1,0,"Packet Loss: %d%% ",pct_loss); } else { - // mprintf_at((2,1,0,"Packet Loss: 0%% ")); + // mprintf_at(2,1,0,"Packet Loss: 0%% "); NetPlayers[Player_num].percent_loss = 0; Bandwidth_throttle--; } @@ -7552,7 +7559,7 @@ void MultiSendPPSSet(int pps) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); size = START_DATA(MP_CLIENT_SET_PPS, data, &count, 1); MultiAddByte(pps, data, &count); - mprintf((0, "Telling the server we want a PPS of %d\n", pps)); + mprintf(0, "Telling the server we want a PPS of %d\n", pps); END_DATA(count, data, size); nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, false); } @@ -7561,7 +7568,7 @@ void MultiDoPPSSet(uint8_t *data, int slot) { int count = 0; SKIP_HEADER(data, &count); NetPlayers[slot].pps = MultiGetByte(data, &count); - mprintf((0, "%s changed his PPS to %d\n", Players[slot].callsign, NetPlayers[slot].pps)); + mprintf(0, "%s changed his PPS to %d\n", Players[slot].callsign, NetPlayers[slot].pps); } void MultiSendGreetings(uint32_t id) { @@ -7572,7 +7579,7 @@ void MultiSendGreetings(uint32_t id) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); size = START_DATA(MP_GREETINGS_FROM_CLIENT, data, &count); MultiAddUint(id, data, &count); - mprintf((0, "Saying hello to the server\n")); + mprintf(0, "Saying hello to the server\n"); END_DATA(count, data, size); nw_Send(&Netgame.server_address, data, count, 0); } @@ -7582,9 +7589,9 @@ void MultiDoGreetings(uint8_t *data, network_address *addr) { SKIP_HEADER(data, &count); uint32_t id = MultiGetUint(data, &count); int i; - // mprintf((0,"Got a greeting packet with an id of %d\n")); + // mprintf(0,"Got a greeting packet with an id of %d\n"); for (i = 0; i < MAX_NET_PLAYERS; i++) { - // mprintf((0,"Netplayer[%d] has an id of %d\n",i,NetPlayers[i].secret_net_id)); + // mprintf(0,"Netplayer[%d] has an id of %d\n",i,NetPlayers[i].secret_net_id); if (NetPlayers[i].secret_net_id == id) { // Get the address memcpy(&NetPlayers[i].addr, addr, sizeof(network_address)); @@ -7602,14 +7609,14 @@ void MultiAskForFile(uint16_t file_id, uint16_t file_who, uint16_t who) { int size = 0; uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - //@@mprintf((0,"Asking player %d for a file (%d) from player %d\n",who,file_id,file_who)); + //@@mprintf(0,"Asking player %d for a file (%d) from player %d\n",who,file_id,file_who); if (NetPlayers[who].file_xfer_flags != NETFILE_NONE) { - mprintf((0, "File already in progress, can't start another one!\n")); + mprintf(0, "File already in progress, can't start another one!\n"); Int3(); return; // Make sure a file isn't in progress } if (who == Player_num) { - mprintf((0, "Can't send a file to myself!\n")); + mprintf(0, "Can't send a file to myself!\n"); return; } // Check to see if this file exists already @@ -7625,18 +7632,18 @@ void MultiAskForFile(uint16_t file_id, uint16_t file_who, uint16_t who) { snprintf(szcrc, sizeof(szcrc), "_%.8x", cf_GetfileCRC(p)); // See if the the CRC is already in the filename if (strnicmp(szcrc, file + (strlen(file) - 9), 9) != 0) { - mprintf((0, "Bad CRC on file %s! It must be corrupt! File will not be used, and is being deleted!\n", p)); + mprintf(0, "Bad CRC on file %s! It must be corrupt! File will not be used, and is being deleted!\n", p); ddio_DeleteFile(p); } else { // Hey hey, we already have this file - mprintf((0, "Using existing file: %s\n", p)); + mprintf(0, "Using existing file: %s\n", p); DoNextPlayerFile(file_who); return; } } } else { // No file - mprintf((0, "No custom file %d for player %d\n", file_id, file_who)); + mprintf(0, "No custom file %d for player %d\n", file_id, file_who); DoNextPlayerFile(file_who); return; } @@ -7648,7 +7655,7 @@ void MultiAskForFile(uint16_t file_id, uint16_t file_who, uint16_t who) { END_DATA(count, data, size); if (Netgame.local_role == LR_SERVER) { // If we are a server, send a request to the client asking for a file of theirs - mprintf((0, "Asking client %d for a file.\n", who)); + mprintf(0, "Asking client %d for a file.\n", who); nw_SendReliable(NetPlayers[who].reliable_socket, data, count); NetPlayers[who].file_xfer_flags = NETFILE_ASKING; NetPlayers[who].file_xfer_pos = 0; @@ -7656,7 +7663,7 @@ void MultiAskForFile(uint16_t file_id, uint16_t file_who, uint16_t who) { NetPlayers[who].file_xfer_who = file_who; } else { // If we are a client, ask the server for a file - mprintf((0, "Asking server for a file.\n")); + mprintf(0, "Asking server for a file.\n"); nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count); NetPlayers[file_who].file_xfer_flags = NETFILE_ASKING; NetPlayers[file_who].file_xfer_pos = 0; @@ -7680,28 +7687,28 @@ void MultiDoFileReq(uint8_t *data) { strcpy(filewithpath, GetFileNameFromPlayerAndID(filewho, filenum)); // ddio_MakePath(filewithpath,LocalD3Dir,"custom","cache",filename,NULL); if (filewithpath[0] == 0) { - mprintf((0, "Got a file request for a file that doesn't exist (%s).\n", filewithpath)); + mprintf(0, "Got a file request for a file that doesn't exist (%s).\n", filewithpath); DenyFile(playernum, filenum, NetPlayers[playernum].file_xfer_who); } else { cfp = cfopen(filewithpath, "rb"); if (!cfp) { - mprintf((0, "Couldn't open a file (%s) for transfer.\n", filewithpath)); + mprintf(0, "Couldn't open a file (%s) for transfer.\n", filewithpath); DenyFile(playernum, filenum, NetPlayers[playernum].file_xfer_who); return; // We couldn't create the file, so cancel the attempt to transfer it. } - mprintf((0, "Sending first data chunk!\n")); + mprintf(0, "Sending first data chunk!\n"); NetPlayers[playernum].file_xfer_who = filewho; NetPlayers[playernum].file_xfer_cfile = cfp; NetPlayers[playernum].file_xfer_pos = 0; NetPlayers[playernum].file_xfer_flags = NETFILE_SENDING; NetPlayers[playernum].file_xfer_total_len = cfp->size; NetPlayers[playernum].file_xfer_id = filenum; - mprintf((0, "File size = %d\n", cfp->size)); + mprintf(0, "File size = %d\n", cfp->size); SendDataChunk(playernum); } } else { - mprintf((0, "Got a file request while one was already in progress!\n")); + mprintf(0, "Got a file request while one was already in progress!\n"); DenyFile(playernum, filenum, NetPlayers[playernum].file_xfer_who); } } @@ -7753,7 +7760,7 @@ void MultiDoFileDenied(uint8_t *data) { uint16_t filenum = MultiGetUshort(data, &count); uint16_t playernum = MultiGetUshort(data, &count); uint16_t filewho = MultiGetUshort(data, &count); - mprintf((0, "Got a file denied packet from %d\n", playernum)); + mprintf(0, "Got a file denied packet from %d\n", playernum); DoNextPlayerFile(filewho); } @@ -7778,13 +7785,13 @@ void MultiDoFileData(uint8_t *data) { playernum = MultiGetUshort(data, &count); // file_who = MultiGetUshort (data,&count); data_len = MultiGetUshort(data, &count); - // mprintf((0,"Got a data packet from %d\n",playernum)); + // mprintf(0,"Got a data packet from %d\n",playernum); if ((NetPlayers[playernum].file_xfer_flags == NETFILE_RECEIVING) || (NetPlayers[playernum].file_xfer_flags == NETFILE_ASKING)) { // Find out if this is the first packet of this file. if so, create and open the file if (NetPlayers[playernum].file_xfer_pos == 0) { - mprintf((0, "Creating file...\n")); + mprintf(0, "Creating file...\n"); CFILE *cfp; // char filename[_MAX_PATH]; char filewithpath[_MAX_PATH * 2]; @@ -7793,7 +7800,7 @@ void MultiDoFileData(uint8_t *data) { cfp = cfopen(filewithpath, "wb"); if (!cfp) { - mprintf((0, "Can't create file %s\n", filewithpath)); + mprintf(0, "Can't create file %s\n", filewithpath); // We couldn't create the file, so cancel the attempt to transfer it. MultiCancelFile(playernum, file_id, NetPlayers[playernum].file_xfer_who); return; @@ -7806,7 +7813,7 @@ void MultiDoFileData(uint8_t *data) { // Write the data to the file int data_wrote = cf_WriteBytes(data + count, data_len, NetPlayers[playernum].file_xfer_cfile); if (data_wrote != data_len) { - mprintf((0, "cf_WriteBytes() should have written %d bytes, but only wrote %d!\n", data_len, data_wrote)); + mprintf(0, "cf_WriteBytes() should have written %d bytes, but only wrote %d!\n", data_len, data_wrote); Int3(); } @@ -7818,7 +7825,7 @@ void MultiDoFileData(uint8_t *data) { NetPlayers[playernum].file_xfer_cfile = NULL; NetPlayers[playernum].file_xfer_pos = 0; DoNextPlayerFile(playernum); - mprintf((0, "Finished downloading file!\n")); + mprintf(0, "Finished downloading file!\n"); return; // Don't ack the last packet } // Ack the sender @@ -7832,7 +7839,7 @@ void MultiDoFileData(uint8_t *data) { nw_SendReliable(NetPlayers[Player_num].reliable_socket, outdata, outcount, true); } } else { - mprintf((0, "Received file transfer data from someone who we aren't expecting data from!\n")); + mprintf(0, "Received file transfer data from someone who we aren't expecting data from!\n"); } } @@ -7845,7 +7852,7 @@ void MultiDoFileAck(uint8_t *data) { SKIP_HEADER(data, &count); playernum = MultiGetUshort(data, &count); len_recvd = MultiGetUint(data, &count); - // mprintf((0,"Got a ACK packet from %d\n",playernum)); + // mprintf(0,"Got a ACK packet from %d\n",playernum); if (NetPlayers[playernum].file_xfer_flags == NETFILE_SENDING) { if (NetPlayers[playernum].file_xfer_pos == len_recvd) { SendDataChunk(playernum); @@ -7853,7 +7860,7 @@ void MultiDoFileAck(uint8_t *data) { Int3(); // This shouldn't happen because the reliable network code should handle it } } else { - mprintf((0, "Received an ACK from someone we weren't sending a file to!\n")); + mprintf(0, "Received an ACK from someone we weren't sending a file to!\n"); } } @@ -7864,13 +7871,13 @@ void SendDataChunk(int playernum) { int size; int dataread; int done = 0; - // mprintf((0,"Sending a data chunk to %d.\n",playernum)); + // mprintf(0,"Sending a data chunk to %d.\n",playernum); // Read the next chunk of the file and send it! if ((DATA_CHUNK_SIZE + NetPlayers[playernum].file_xfer_pos) > (uint32_t)NetPlayers[playernum].file_xfer_cfile->size) { dataread = NetPlayers[playernum].file_xfer_cfile->size - NetPlayers[playernum].file_xfer_pos; // This is the end of the file - mprintf((0, "End of file detected!\n")); + mprintf(0, "End of file detected!\n"); done = 1; } else { dataread = DATA_CHUNK_SIZE; @@ -7922,7 +7929,7 @@ void MultiDoFileCancelled(uint8_t *data) { SKIP_HEADER(data, &count); playernum = MultiGetUshort(data, &count); filewho = MultiGetUshort(data, &count); - mprintf((0, "Got a cancelled packet from %d for %d\n", playernum, filewho)); + mprintf(0, "Got a cancelled packet from %d for %d\n", playernum, filewho); if (NetPlayers[filewho].file_xfer_cfile) { char delfile[_MAX_PATH * 2]; strcpy(delfile, NetPlayers[filewho].file_xfer_cfile->name); @@ -7945,7 +7952,7 @@ void MultiSendClientCustomData(int slot, int whoto) { int count = 0; int size_offset; - //@@mprintf((0,"Sending player %d's data to %d.\n",slot,whoto)); + //@@mprintf(0,"Sending player %d's data to %d.\n",slot,whoto); size_offset = START_DATA(MP_PLAYER_CUSTOM_DATA, data, &count); // Who we are talking about @@ -8038,12 +8045,12 @@ void MultiDoCustomPlayerData(uint8_t *data) { playernum = MultiGetUshort(data, &count); if (playernum == Player_num) return; - mprintf((0, "Got custom data in MultiDoCustomPlayerData()\n")); + mprintf(0, "Got custom data in MultiDoCustomPlayerData()\n"); NetPlayers[playernum].custom_file_seq = NETFILE_ID_SHIP_TEX; // First in the sequence of files we will request int16_t logo_len = MultiGetUshort(data, &count); memcpy(NetPlayers[playernum].ship_logo, data + count, logo_len); count += logo_len; - mprintf((0, "%s uses custom ship logo %s\n", Players[playernum].callsign, NetPlayers[playernum].ship_logo)); + mprintf(0, "%s uses custom ship logo %s\n", Players[playernum].callsign, NetPlayers[playernum].ship_logo); for (int t = 0; t < 4; t++) { char *filename; @@ -8076,11 +8083,11 @@ char *GetFileNameFromPlayerAndID(int16_t playernum, int16_t id) { rval[0] = '\0'; if (playernum >= MAX_NET_PLAYERS) { - mprintf((0, "Invalid playernum (%d) passed to GetFileNameFromPlayerAndID()\n", playernum)); + mprintf(0, "Invalid playernum (%d) passed to GetFileNameFromPlayerAndID()\n", playernum); return rval; } if (id > NETFILE_ID_LAST_FILE) { - mprintf((0, "Invalid file id (%d) passed to GetFileNameFromPlayerAndID()\n", id)); + mprintf(0, "Invalid file id (%d) passed to GetFileNameFromPlayerAndID()\n", id); return rval; } switch (id) { @@ -8108,7 +8115,7 @@ char *GetFileNameFromPlayerAndID(int16_t playernum, int16_t id) { ddio_MakePath(rval, Base_directory, "custom", "sounds", NetPlayers[playernum].voice_taunt4, NULL); break; default: - mprintf((0, "Unknown id (%d) passed to GetFileNameFromPlayerAndID()\n", id)); + mprintf(0, "Unknown id (%d) passed to GetFileNameFromPlayerAndID()\n", id); Int3(); break; } @@ -8116,10 +8123,10 @@ char *GetFileNameFromPlayerAndID(int16_t playernum, int16_t id) { CFILE *cfp; cfp = cfopen(rval, "rb"); if (!cfp) { - mprintf((0, "Multiplayer file xfer File does not exist, not using file %d for player %d!\n", id, playernum)); + mprintf(0, "Multiplayer file xfer File does not exist, not using file %d for player %d!\n", id, playernum); // rval[0] = '\0'; } else if (32768 < cfilelength(cfp)) { - mprintf((0, "Multiplayer file xfer File to long, not using file %d for player %d!\n", id, playernum)); + mprintf(0, "Multiplayer file xfer File to long, not using file %d for player %d!\n", id, playernum); rval[0] = '\0'; } if (cfp) @@ -8310,7 +8317,7 @@ void MultiSendRequestPlayTaunt(int index) { } if (!cfexist(audio_file)) { - mprintf((0, "Ignoring request to play audio taunt...it does not exist\n")); + mprintf(0, "Ignoring request to play audio taunt...it does not exist\n"); return; } @@ -8350,10 +8357,10 @@ void MultiDoTypeIcon(uint8_t *data) { bit = bit << pnum; if (typing) { - mprintf((0, "%s is typing\n", Players[pnum].callsign)); + mprintf(0, "%s is typing\n", Players[pnum].callsign); Players_typing |= bit; } else { - mprintf((0, "%s is done typing\n", Players[pnum].callsign)); + mprintf(0, "%s is done typing\n", Players[pnum].callsign); Players_typing &= ~bit; } } @@ -8427,7 +8434,7 @@ void MultiDoAiWeaponFlags(uint8_t *data) { flags = MultiGetInt(data, &count); wb_index = MultiGetByte(data, &count); if (obj_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", obj_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", obj_num); Int3(); return; } @@ -8476,12 +8483,12 @@ void MultiDoAttach(uint8_t *data) { f_aligned = MultiGetByte(data, &count) ? true : false; if (parent_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", parent_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", parent_num); Int3(); return; } if (child_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", child_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", child_num); Int3(); return; } @@ -8523,12 +8530,12 @@ void MultiDoAttachRad(uint8_t *data) { child = &Objects[child_num]; if (parent_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", parent_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", parent_num); Int3(); return; } if (child_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", child_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", child_num); Int3(); return; } @@ -8562,7 +8569,7 @@ void MultiDoUnattach(uint8_t *data) { uint16_t child_num = Server_object_list[server_objnum]; child = &Objects[child_num]; if (child_num == 65535) { - mprintf((0, "Client/Server object lists don't match! (Server num %d)\n", child_num)); + mprintf(0, "Client/Server object lists don't match! (Server num %d)\n", child_num); Int3(); return; } @@ -8596,7 +8603,7 @@ void MultiDoThiefSteal(uint8_t *data) { // Sets whether or not we want the logos to be displayed on ships void MultiSetLogoState(bool state) { Multi_logo_state = state; - mprintf((0, "Setting multi_logo_state to %d\n", state)); + mprintf(0, "Setting multi_logo_state to %d\n", state); } void MultiDoPermissionToFire(uint8_t *data) { @@ -8713,7 +8720,7 @@ void MultiSendPermissionToFire(int pnum) { #ifdef RELIABLE_SECONDARIES if ((Player_fire_packet[pnum].wb_index >= SECONDARY_INDEX) && (Player_fire_packet[pnum].wb_index != FLARE_INDEX)) { // send reliably - // mprintf((0,"PCS: SENDING RELIABLE FIRE FOR %d\n",pnum)); + // mprintf(0,"PCS: SENDING RELIABLE FIRE FOR %d\n",pnum); MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_PLAYING, true); } else #endif @@ -8775,7 +8782,7 @@ void MultiSendRequestToFire(int wb_index, int fire_mask, float scalar) { // should we send reliably? (secondaries) if ((wb_index >= SECONDARY_INDEX) && (wb_index != FLARE_INDEX)) { // send reliably - // mprintf((0,"PCS: Sending fire request reliably\n")); + // mprintf(0,"PCS: Sending fire request reliably\n"); nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, true); } else #endif @@ -9046,7 +9053,7 @@ void MultiDoRequestToMove(uint8_t *data) { // If there is too much client error then adjust if (client_error) { - mprintf((0, "Correcting, deltatime=%f dist=%f\n", delta_time, vm_VectorDistance(&pos, &obj->pos))); + mprintf(0, "Correcting, deltatime=%f dist=%f\n", delta_time, vm_VectorDistance(&pos, &obj->pos)); MultiSendAdjustPosition(slot, timestamp); Last_update_time[slot] = Gametime; } @@ -9187,7 +9194,7 @@ void MultiDoStripPlayer(int slot, uint8_t *data) { return; } - mprintf((0, "I'm stripping %d bare! (of weapons)\n", slot)); + mprintf(0, "I'm stripping %d bare! (of weapons)\n", slot); object *pobj = &Objects[Players[slot].objnum]; @@ -9274,7 +9281,7 @@ void MultiDoInitialRank(uint8_t *data) { int pnum = MultiGetByte(data, &count); float rank = MultiGetFloat(data, &count); - mprintf((0, "Got initial rank for player %d (%f)\n", pnum, rank)); + mprintf(0, "Got initial rank for player %d (%f)\n", pnum, rank); Players[pnum].rank = rank; } @@ -9290,7 +9297,7 @@ void MultiSendInitialRank(int pnum) { MultiAddByte(pnum, data, &count); MultiAddFloat(Players[pnum].rank, data, &count); - mprintf((0, "Sending initial rank for player %d\n", pnum)); + mprintf(0, "Sending initial rank for player %d\n", pnum); END_DATA(count, data, size_offset); @@ -9344,7 +9351,7 @@ void MultiClearGuidebot(int slot) { int size_offset; uint8_t data[MAX_GAME_DATA_SIZE]; - mprintf((0, "Sending Buddy_handle update to clients for Buddy#%d\n", slot)); + mprintf(0, "Sending Buddy_handle update to clients for Buddy#%d\n", slot); size_offset = START_DATA(MP_WORLD_STATES, data, &count); @@ -9406,7 +9413,7 @@ bool Multi_got_player_list = false; void DoPlayerListData(uint8_t *data, int len) { int count = 0; if (Multi_recieved_player_list == NULL) { - mprintf((0, "Received a player list packet when we weren't expecting one. Ignoring.\n")); + mprintf(0, "Received a player list packet when we weren't expecting one. Ignoring.\n"); return; } SKIP_HEADER(data, &count); @@ -9450,7 +9457,7 @@ void MultiDoBashPlayerShip(uint8_t *data) { AddHUDMessage("Switching to %s", Ships[ship_index].name); PlayerChangeShip(Player_num, ship_index); - mprintf((0, "Server told us to switch ships to the %s\n", (char *)data + count)); + mprintf(0, "Server told us to switch ships to the %s\n", (char *)data + count); FreeCockpit(); CloseShipHUD(); @@ -9486,10 +9493,10 @@ void MultiSendHeartbeat() { if (Netgame.local_role == LR_SERVER) { - mprintf((0, "Server sending heartbeat.\n")); + mprintf(0, "Server sending heartbeat.\n"); MultiSendToAllExcept(Player_num, outdata, count, -1); } else { - mprintf((0, "Client sending heartbeat.\n")); + mprintf(0, "Client sending heartbeat.\n"); nw_Send(&Netgame.server_address, outdata, count, 0); } @@ -9921,9 +9928,9 @@ void MultiProcessData(uint8_t *data, int len, int slot, network_address *from_ad case MP_HEARTBEAT: if (Netgame.local_role == LR_CLIENT) { Got_heartbeat = true; - mprintf((0, "Got heartbeat from server.\n")); + mprintf(0, "Got heartbeat from server.\n"); } else - mprintf((0, "Got heartbeat from slot %d.\n", slot)); + mprintf(0, "Got heartbeat from slot %d.\n", slot); break; case MP_INITIAL_RANK: MultiDoInitialRank(data); @@ -9940,7 +9947,7 @@ void MultiProcessData(uint8_t *data, int len, int slot, network_address *from_ad ACCEPT_CONDITION(-1, -1); MultiDoServerRejectedChecksum(data); default: - mprintf((0, "Invalid packet type %d!\n", type)); + mprintf(0, "Invalid packet type %d!\n", type); Int3(); // Invalid packet type!!!! break; } @@ -9970,7 +9977,7 @@ void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr) { // We aren't going to process this packet because otherwise they // might try to join which wouldn't work and they would be credited // with sending a packet and the server wouldn't disconnect them. - mprintf((0, "Ignoring game info request from a currently connected user (%s)\n", Players[slot].callsign)); + mprintf(0, "Ignoring game info request from a currently connected user (%s)\n", Players[slot].callsign); return; } } @@ -9981,14 +9988,13 @@ void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr) { sub_len = INTEL_SHORT((*(int16_t *)(buf + bytes_processed + 1))); if (sub_len < 3 || type == 0 || (len - bytes_processed) < 2) { - mprintf((0, "Got a corrupted packet!\n")); + mprintf(0, "Got a corrupted packet!\n"); Int3(); return; // just throw the rest out } if ((bytes_processed + sub_len) > len) { - mprintf( - (1, "multi_process_bigdata: packet type %d too int16_t (%d>%d)!\n", type, (bytes_processed + sub_len), len)); + mprintf(1, "multi_process_bigdata: packet type %d too int16_t (%d>%d)!\n", type, (bytes_processed + sub_len), len); Int3(); return; } diff --git a/Descent3/multi_client.cpp b/Descent3/multi_client.cpp index 21d46bd5..4e83b975 100644 --- a/Descent3/multi_client.cpp +++ b/Descent3/multi_client.cpp @@ -161,7 +161,7 @@ void MultiSendMyInfo() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending my info\n")); + mprintf(0, "Sending my info\n"); char pshipmodel[PAGENAME_LEN]; Current_pilot.get_ship(pshipmodel); @@ -227,7 +227,7 @@ void MultiSendRequestForPlayers() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending request for players\n")); + mprintf(0, "Sending request for players\n"); size = START_DATA(MP_REQUEST_PLAYERS, data, &count); MultiAddByte(Player_num, data, &count); @@ -242,7 +242,7 @@ void MultiSendRequestForBuildings() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending request for buildings\n")); + mprintf(0, "Sending request for buildings\n"); size = START_DATA(MP_REQUEST_BUILDINGS, data, &count); MultiAddByte(Player_num, data, &count); @@ -257,7 +257,7 @@ void MultiSendRequestForWorldStates() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending request for world states\n")); + mprintf(0, "Sending request for world states\n"); size = START_DATA(MP_REQUEST_WORLD_STATES, data, &count); MultiAddByte(Player_num, data, &count); @@ -278,7 +278,7 @@ void MultiSendRequestForObjects() { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending request for objects\n")); + mprintf(0, "Sending request for objects\n"); size = START_DATA(MP_REQUEST_OBJECTS, data, &count); MultiAddByte(Player_num, data, &count); @@ -296,7 +296,7 @@ int ServerTimedOut() { return 0; if (!nw_CheckReliableSocket(NetPlayers[Player_num].reliable_socket)) { - mprintf((0, "Reliable connection to the server was broken. Disconnecting.\n")); + mprintf(0, "Reliable connection to the server was broken. Disconnecting.\n"); ShowProgressScreen(TXT_RELIABLE_OVERRUN); Sleep(1000); return 1; @@ -343,7 +343,7 @@ void MultiDoClientFrame() { // Wait for server response if ((timer_GetTime() - First_gametime_req) > NET_CLIENT_GAMETIME_REQ_TIMEOUT) { // Giving up, we waited too long. - mprintf((0, "Server disconnected while waiting for gametime!\n")); + mprintf(0, "Server disconnected while waiting for gametime!\n"); MultiLeaveGame(); ShowProgressScreen(TXT_MLTDISCFRMSERV); Sleep(2000); @@ -472,7 +472,7 @@ void MultiDoClientFrame() { // TODO: SEND RELIABLE WEAPON FIRE if (Player_fire_packet[Player_num].fired_on_this_frame == PFP_FIRED_RELIABLE) { - // mprintf((0,"I NEED TO SEND RELIABLE FIRE\n")); + // mprintf(0,"I NEED TO SEND RELIABLE FIRE\n"); count = MultiStuffPlayerFire(Player_num, data); nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, true); } @@ -484,7 +484,7 @@ void MultiDoClientFrame() { } if (ServerTimedOut()) { - mprintf((0, "Server disconnected!\n")); + mprintf(0, "Server disconnected!\n"); MultiLeaveGame(); ShowProgressScreen(TXT_MLTDISCFRMSERV); Sleep(2000); diff --git a/Descent3/multi_connect.cpp b/Descent3/multi_connect.cpp index 62f5676a..da11a1b7 100644 --- a/Descent3/multi_connect.cpp +++ b/Descent3/multi_connect.cpp @@ -365,7 +365,7 @@ int TryToJoinServer(network_address *addr) { connected = true; NetPlayers[Player_num].reliable_socket = DPID_SERVERPLAYER; } else { - mprintf((0, "Unable to join DirectPlay session!\n")); + mprintf(0, "Unable to join DirectPlay session!\n"); } } else #endif @@ -382,7 +382,7 @@ int TryToJoinServer(network_address *addr) { } return 0; } else - mprintf((0, "Server says its ok to join!\n")); + mprintf(0, "Server says its ok to join!\n"); nw_ConnectToServer(&sock, addr); if (sock != INVALID_SOCKET && sock != 0) { @@ -397,14 +397,14 @@ int TryToJoinServer(network_address *addr) { { MultiSetServerAddress(addr); } - mprintf((0, "Client mode set! Polling...\n")); + mprintf(0, "Client mode set! Polling...\n"); MultiPollForConnectionAccepted(); if (NetPlayers[Player_num].flags & NPF_CONNECTED) return 1; else { - mprintf((0, "Couldn't join game for some reason!\n")); + mprintf(0, "Couldn't join game for some reason!\n"); #ifdef USE_DIRECTPLAY if (!Use_DirectPlay) #endif @@ -413,7 +413,7 @@ int TryToJoinServer(network_address *addr) { } } } else { - mprintf((0, "nw_ConnectToServer says it can't find a good socket!\n")); + mprintf(0, "nw_ConnectToServer says it can't find a good socket!\n"); } return 0; @@ -431,11 +431,11 @@ void MultiDoConnectionAccepted(uint8_t *data) { server_version = MultiGetShort(data, &count); if (server_version != MULTI_VERSION) { - mprintf((0, "Client and server code versions don't match. Do an update!\n")); + mprintf(0, "Client and server code versions don't match. Do an update!\n"); return; } else { // Versions match, get info about the game and then connect! - mprintf((0, "Client/server versions match.\n")); + mprintf(0, "Client/server versions match.\n"); // Check if we have the mission needed uint8_t len = MultiGetByte(data, &count); @@ -443,9 +443,9 @@ void MultiDoConnectionAccepted(uint8_t *data) { count += len; if (!LoadMission(Netgame.mission)) { - mprintf((0, "We don't have this mission: %s!\n", Netgame.mission)); + mprintf(0, "We don't have this mission: %s!\n", Netgame.mission); } else - mprintf((0, "Using mission %s...\n", Netgame.mission)); + mprintf(0, "Using mission %s...\n", Netgame.mission); len = MultiGetByte(data, &count); memcpy(Netgame.name, &data[count], len); @@ -466,14 +466,14 @@ void MultiDoConnectionAccepted(uint8_t *data) { memcpy(&tempplayer, &NetPlayers[Player_num], sizeof(netplayer)); Player_num = player_num; - mprintf((0, "Server tells me that my player num is %d!\n", Player_num)); + mprintf(0, "Server tells me that my player num is %d!\n", Player_num); strcpy(Players[Player_num].callsign, name); memcpy(&NetPlayers[Player_num], &tempplayer, sizeof(netplayer)); NetPlayers[Player_num].flags = NPF_CONNECTED; // Hurray! We're connected // Get packets per second Netgame.packets_per_second = MultiGetByte(data, &count); - mprintf((0, "Server is sending %d packets per second\n", Netgame.packets_per_second)); + mprintf(0, "Server is sending %d packets per second\n", Netgame.packets_per_second); // Get the secret code we will use to identify ourselves to the server uint32_t secret_code = MultiGetUint(data, &count); @@ -481,9 +481,9 @@ void MultiDoConnectionAccepted(uint8_t *data) { // Get the peer-peer flag int flags = MultiGetInt(data, &count); if (flags & NF_PEER_PEER) - mprintf((0, "Using Peer/Peer model\n")); + mprintf(0, "Using Peer/Peer model\n"); else - mprintf((0, "Using Client/Server model\n")); + mprintf(0, "Using Client/Server model\n"); Netgame.flags = flags; @@ -517,7 +517,7 @@ void MultiPollForConnectionAccepted() { } if (!connected) { - mprintf((0, "Couldn't get a connection_accepted packet for some reason!\n")); + mprintf(0, "Couldn't get a connection_accepted packet for some reason!\n"); } } @@ -530,7 +530,7 @@ void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr int count = 0; int size_offset; - mprintf((0, "Sending connection accepted packet to slot %d!\n", slotnum)); + mprintf(0, "Sending connection accepted packet to slot %d!\n", slotnum); NetPlayers[slotnum].reliable_socket = sock; memcpy(&NetPlayers[slotnum].addr, addr, sizeof(network_address)); @@ -556,7 +556,7 @@ void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr memcpy(&data[count], Netgame.mission, len); count += len; - mprintf((0, "Sending netgame mission %s with length of %d!\n", Netgame.mission, len)); + mprintf(0, "Sending netgame mission %s with length of %d!\n", Netgame.mission, len); len = strlen(Netgame.name) + 1; MultiAddByte(len, data, &count); @@ -628,7 +628,7 @@ int MultiPollForLevelInfo() { while ((size = nw_Receive(data, &from_addr)) > 0) { if (data[0] == MP_HEARTBEAT) { - mprintf((0, "Got a heart beat from the server.\n")); + mprintf(0, "Got a heart beat from the server.\n"); Got_heartbeat = true; } } @@ -765,7 +765,7 @@ void MultiSendLevelInfo(int slot) { MultiAddByte(JOIN_ANSWER_NOT_SERVER, data, &count); // Do level number (of the mission) - mprintf((0, "Sending current mission level %d!\n", Current_mission.cur_level)); + mprintf(0, "Sending current mission level %d!\n", Current_mission.cur_level); MultiAddByte(Current_mission.cur_level, data, &count); // Send the difficulty @@ -814,7 +814,7 @@ void MultiSendReadyForLevel() { int count = 0; int size_offset; - mprintf((0, "Sending ready for level!\n")); + mprintf(0, "Sending ready for level!\n"); char pshipmodel[PAGENAME_LEN]; Current_pilot.get_ship(pshipmodel); @@ -843,10 +843,10 @@ extern int Multi_packet_tracking[]; // Clears all connections // Server and Client void MultiCloseGame() { - mprintf((0, "Multi close game!\n")); + mprintf(0, "Multi close game!\n"); if (!(Game_mode & GM_NETWORK)) { - mprintf((0, "Not network game!\n")); + mprintf(0, "Not network game!\n"); return; } @@ -855,7 +855,7 @@ void MultiCloseGame() { CFILE *outfile; outfile = cfopen("PacketTracking", "wt"); if (!outfile) { - mprintf((0, "Couldn't open packet tracking file!\n")); + mprintf(0, "Couldn't open packet tracking file!\n"); } else { for (int i = 0; i < 255; i++) { cfprintf(outfile, "Packet %d = %d\n", i, Multi_packet_tracking[i]); @@ -977,6 +977,6 @@ void UpdateAndPackGameList(void) { // Sets whether or not the server answsers to a connection request void MultiSetAcceptState(bool state) { - mprintf((0, "Setting multi_accept_state to %s.\n", state ? "true" : "false")); + mprintf(0, "Setting multi_accept_state to %s.\n", state ? "true" : "false"); Multi_accept_state = state; } diff --git a/Descent3/multi_dll_mgr.cpp b/Descent3/multi_dll_mgr.cpp index 70c03e79..dcfedc2d 100644 --- a/Descent3/multi_dll_mgr.cpp +++ b/Descent3/multi_dll_mgr.cpp @@ -578,7 +578,7 @@ void FreeMultiDLL() { mod_FreeModule(&MultiDLLHandle); // Try deleting the file now! if (!ddio_DeleteFile(Multi_conn_dll_name)) { - mprintf((0, "Couldn't delete the tmp dll")); + mprintf(0, "Couldn't delete the tmp dll"); } DLLMultiCall = NULL; DLLMultiInit = NULL; @@ -623,7 +623,7 @@ int LoadMultiDLL(const char *name) { // Copy the DLL // ddio_MakePath(dll_path_name,Base_directory,"online",tmp_dll_name,NULL); if (!cf_CopyFile(tmp_dll_name, dll_name)) { - mprintf((0, "DLL copy failed!\n")); + mprintf(0, "DLL copy failed!\n"); return 0; } strcpy(Multi_conn_dll_name, tmp_dll_name); @@ -631,14 +631,14 @@ loaddll: if (!mod_LoadModule(&MultiDLLHandle, tmp_dll_name)) { int err = mod_GetLastError(); - mprintf((0, "You are missing the DLL %s!\n", name)); + mprintf(0, "You are missing the DLL %s!\n", name); return 0; } DLLMultiInit = (DLLMultiInit_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiInit", 4); if (!DLLMultiInit) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLMultiInit!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLMultiInit!\n"); Int3(); FreeMultiDLL(); return 0; @@ -646,7 +646,7 @@ loaddll: DLLMultiCall = (DLLMultiCall_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiCall", 4); if (!DLLMultiCall) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLMultiCall!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLMultiCall!\n"); Int3(); FreeMultiDLL(); return 0; @@ -654,7 +654,7 @@ loaddll: DLLMultiClose = (DLLMultiClose_fp)mod_GetSymbol(&MultiDLLHandle, "DLLMultiClose", 0); if (!DLLMultiClose) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLMultiClose!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLMultiClose!\n"); Int3(); FreeMultiDLL(); return 0; @@ -686,7 +686,7 @@ loaddll: if (!DLLMultiScoreCall) { int err = mod_GetLastError(); - mprintf((0, "Couldn't get a handle to the dll function DLLMultiScoreCall!\n")); + mprintf(0, "Couldn't get a handle to the dll function DLLMultiScoreCall!\n"); Int3(); Supports_score_api = false; } @@ -751,7 +751,7 @@ const char *ListGetItem(UIListBox *item, int index) { if (ui_item) return ui_item->GetBuffer(); else { - mprintf((0, "No listbox item found for index %d\n", index)); + mprintf(0, "No listbox item found for index %d\n", index); return ""; } } @@ -761,10 +761,10 @@ void DatabaseRead(const char *label, char *entry, int *entrylen) { Database->rea void DatabaseWrite(const char *label, const char *entry, int entrylen) { Database->write(label, entry, entrylen); } void DatabaseReadInt(const char *label, int *val) { Database->read_int(label, val); - mprintf((0, "Read int: %s:%d\n", label, *val)); + mprintf(0, "Read int: %s:%d\n", label, *val); } void DatabaseWriteInt(const char *label, int val) { - mprintf((0, "Writing int: %s:%d\n", label, val)); + mprintf(0, "Writing int: %s:%d\n", label, val); Database->write(label, val); } void DescentDefer(void) { Descent->defer(); } @@ -930,7 +930,7 @@ const char *OldListGetItem(UIListBox *item, int index) { if (ti) return ti->GetBuffer(); else { - mprintf((0, "No listbox item found for index %d\n", index)); + mprintf(0, "No listbox item found for index %d\n", index); return ""; } } diff --git a/Descent3/multi_save_setting.cpp b/Descent3/multi_save_setting.cpp index 4e35183a..049b071c 100644 --- a/Descent3/multi_save_setting.cpp +++ b/Descent3/multi_save_setting.cpp @@ -261,7 +261,7 @@ int MultiLoadSettings(const char *filename) { if ((Netgame.difficulty > 4) || (Netgame.difficulty < 0)) Netgame.difficulty = 0; } else { - mprintf((0, "Unknown line in multiplayer config file %s\t%s\n", toklabel, tokval)); + mprintf(0, "Unknown line in multiplayer config file %s\t%s\n", toklabel, tokval); } }; return 1; diff --git a/Descent3/multi_server.cpp b/Descent3/multi_server.cpp index 5c1a83b0..bff570d0 100644 --- a/Descent3/multi_server.cpp +++ b/Descent3/multi_server.cpp @@ -783,7 +783,7 @@ void MultiStartServer(int playing, char *scriptname, int dedicated_server_num_te if (t == 0) t = 5.0f; - mprintf((0, "MULTI: Setting audio taunt delay time to %.2f seconds\n", t)); + mprintf(0, "MULTI: Setting audio taunt delay time to %.2f seconds\n", t); taunt_SetDelayTime(t); } else { taunt_SetDelayTime(5.0f); @@ -853,7 +853,7 @@ int CheckMissionForScript(char *mission, char *script, int dedicated_server_num_ GetDLLNumTeamInfo(script, &min_teams, &max_teams); if (min_teams > teams) { - mprintf((0, "This multiplayer game requires more teams than the mission supports!\n")); + mprintf(0, "This multiplayer game requires more teams than the mission supports!\n"); return SCRIPTBADFORMISSION; } // Use whatever is smaller, the dll's max teams, or what the missions supports @@ -927,7 +927,7 @@ void MultiCheckListen() { // if we didn't find a player, close the socket if (i == MAX_NET_PLAYERS) { - mprintf((0, "Got accept on my listen socket, but no free slots. Closing socket.\n")); + mprintf(0, "Got accept on my listen socket, but no free slots. Closing socket.\n"); nw_CloseSocket(&sock); } } @@ -939,7 +939,7 @@ void MultiSendDonePlayers(int slot) { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending done players\n")); + mprintf(0, "Sending done players\n"); size = START_DATA(MP_DONE_PLAYERS, data, &count); int num = MultiCountPlayers(); @@ -955,7 +955,7 @@ void MultiSendDoneBuildings(int slot) { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending done buildings\n")); + mprintf(0, "Sending done buildings\n"); size = START_DATA(MP_DONE_BUILDINGS, data, &count); END_DATA(count, data, size); @@ -969,7 +969,7 @@ void MultiSendDoneObjects(int slot) { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending done objects\n")); + mprintf(0, "Sending done objects\n"); // Take the level checksum and clone it. MD5 playermd5(*Level_md5); @@ -997,7 +997,7 @@ void MultiSendDoneWorldStates(int slot) { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending done world states\n")); + mprintf(0, "Sending done world states\n"); size = START_DATA(MP_DONE_WORLD_STATES, data, &count); END_DATA(count, data, size); @@ -1053,20 +1053,24 @@ void MultiDisconnectDeadPlayers() { float cur_time = timer_GetTime(); if (!nw_CheckReliableSocket(NetPlayers[i].reliable_socket)) { - mprintf((0, "Disconnecting player %d because the reliable socket closed.\n", i)); + mprintf(0, "Disconnecting player %d because the reliable socket closed.\n", i); AddHUDMessage("%s (%s)", TXT_RELIABLE_OVERRUN, Players[i].callsign); MultiDisconnectPlayer(i); } else if (NetPlayers[i].sequence > NETSEQ_LEVEL_START && NetPlayers[i].sequence != NETSEQ_LEVEL_END) { if (cur_time - NetPlayers[i].last_packet_time > DISCONNECT_TIME) { - mprintf((0, "8sec disconnecting player %d. Last packet time=%f Sequence=%d\n", i, - cur_time - NetPlayers[i].last_packet_time, NetPlayers[i].sequence)); + mprintf(0, "8sec disconnecting player %d. Last packet time=%f Sequence=%d\n", + i, + cur_time - NetPlayers[i].last_packet_time, + NetPlayers[i].sequence); MultiDisconnectPlayer(i); } } else // If not playing (ie joining, give them longer) { if (cur_time - NetPlayers[i].last_packet_time > (DISCONNECT_TIME * 15)) { - mprintf((0, "Too long...disconnecting player %d. Last packet time=%f Sequence=%d\n", i, - cur_time - NetPlayers[i].last_packet_time, NetPlayers[i].sequence)); + mprintf(0, "Too long...disconnecting player %d. Last packet time=%f Sequence=%d\n", + i, + cur_time - NetPlayers[i].last_packet_time, + NetPlayers[i].sequence); MultiDisconnectPlayer(i); } } @@ -1083,7 +1087,7 @@ void MultiDisconnectPlayer(int slot) { CallGameDLL(EVT_GAMEPLAYERDISCONNECT, &DLLInfo); if (NetPlayers[slot].flags & NPF_CONNECTED) { - mprintf((0, "Disconnecting player %d (%s)...\n", slot, Players[slot].callsign)); + mprintf(0, "Disconnecting player %d (%s)...\n", slot, Players[slot].callsign); if (NetPlayers[slot].file_xfer_flags != NETFILE_NONE) { MultiCancelFile(slot, NetPlayers[slot].custom_file_seq, NetPlayers[slot].file_xfer_who); } @@ -1103,7 +1107,7 @@ void MultiDisconnectPlayer(int slot) { Players[slot].flags = 0; } else - mprintf((0, "Trying to disconnect a non-existant player!\n")); + mprintf(0, "Trying to disconnect a non-existant player!\n"); } // Sends existing players to a joining player @@ -1116,7 +1120,7 @@ void MultiSendPlayer(int slot, int which) { int count = 0; int size_offset; - mprintf((0, "Sending MP_PLAYER packet to player %d!\n", slot)); + mprintf(0, "Sending MP_PLAYER packet to player %d!\n", slot); size_offset = START_DATA(MP_PLAYER, data, &count); @@ -1208,7 +1212,7 @@ void MultiSendBuildings(int slot) { int count = 0; int size_offset; - mprintf((0, "Sending MP_BUILDING packet to player %d!\n", slot)); + mprintf(0, "Sending MP_BUILDING packet to player %d!\n", slot); size_offset = START_DATA(MP_BUILDING, data, &count); @@ -1266,7 +1270,7 @@ void MultiSendJoinDemoObjects(int slot) { ASSERT((num_demo_objects * sizeof(uint16_t) + sizeof(uint16_t)) < MAX_GAME_DATA_SIZE); - mprintf((0, "Sending DemoJoinObjects (%d)\n", num_demo_objects)); + mprintf(0, "Sending DemoJoinObjects (%d)\n", num_demo_objects); count = 0; size_offset = START_DATA(MP_SEND_DEMO_OBJECT_FLAGS, data, &count); @@ -1363,7 +1367,7 @@ void MultiSendJoinObjects(int slot) { int size_offset; int i; - mprintf((0, "Sending MP_JOIN_OBJECTS packet to player %d!\n", slot)); + mprintf(0, "Sending MP_JOIN_OBJECTS packet to player %d!\n", slot); uint16_t total_objects = 0; last_sent_bytes[slot] = timer_GetTime(); @@ -1450,7 +1454,7 @@ void MultiSendJoinObjects(int slot) { void MultiStoreWorldPacket(int slot, uint8_t *big_data, int *big_count, uint8_t *cur_data, int *cur_count, int *size_offset) { if (*big_count + *cur_count >= (MAX_GAME_DATA_SIZE - 3)) { - mprintf((0, "Starting another world packet!\n")); + mprintf(0, "Starting another world packet!\n"); MultiAddByte(WS_END, big_data, big_count); END_DATA(*big_count, big_data, *size_offset); @@ -1480,7 +1484,7 @@ void MultiSendWorldStates(int slot) { int count = 0; int size_offset; - mprintf((0, "Sending MP_WORLD_STATES packet to player %d!\n", slot)); + mprintf(0, "Sending MP_WORLD_STATES packet to player %d!\n", slot); size_offset = START_DATA(MP_WORLD_STATES, data, &count); @@ -1795,7 +1799,7 @@ void MultiSendWorldStates(int slot) { MultiStoreWorldPacket(slot, data, &count, cur_data, &cur_count, &size_offset); } } - mprintf((0, "Send %d spew events\n", spewcount)); + mprintf(0, "Send %d spew events\n", spewcount); // Send buddybot handles if needed if (Netgame.flags & NF_ALLOWGUIDEBOT) { @@ -1926,7 +1930,7 @@ void MultiCheckToRepositionPowerups() { } if (changed > 0) { - mprintf((0, "Stopped=%d\n", changed)); + mprintf(0, "Stopped=%d\n", changed); } } @@ -1953,13 +1957,13 @@ void MultiCheckToRespawnPowerups() { } if (num_cand == 0) { - mprintf((0, "Couldn't find a good spot to respawn!!!\n")); + mprintf(0, "Couldn't find a good spot to respawn!!!\n"); return; } t = candidates[ps_rand() % num_cand]; - mprintf((0, "Respawning powerup with id of %d.\n", Powerup_timer[i].id)); + mprintf(0, "Respawning powerup with id of %d.\n", Powerup_timer[i].id); Powerup_respawn[t].used = 1; int objnum = ObjCreate(OBJ_POWERUP, Powerup_timer[i].id, Powerup_respawn[t].roomnum, &Powerup_respawn[t].pos, NULL); @@ -2137,7 +2141,7 @@ void MultiSendPositionalUpdates(int to_slot) { // TODO: SEND RELIABLE WEAPON FIRE HERE if (Player_fire_packet[i].fired_on_this_frame == PFP_FIRED_RELIABLE) { - // mprintf((0,"NEED TO SEND RELIABLE FIRE FOR %d\n",i)); + // mprintf(0,"NEED TO SEND RELIABLE FIRE FOR %d\n",i); count = MultiStuffPlayerFire(i, data); nw_SendReliable(NetPlayers[to_slot].reliable_socket, data, count, true); } @@ -2161,7 +2165,7 @@ void MultiUpdateRobotMovedList(int slot) { if (MultiIsValidMovedObject(obj)) { if ((obj->flags & OF_MOVED_THIS_FRAME)) { skip_this_obj = false; - // mprintf ((0,"Object %d (type=%d) moved this frame!\n",a,obj->type)); + // mprintf(0,"Object %d (type=%d) moved this frame!\n",a,obj->type); // Check to see if this robot is on the list already for (int b = 0; b < Num_moved_robots[slot] && !skip_this_obj; b++) { if (Moved_robots[slot][b] == obj->handle) { @@ -2377,7 +2381,7 @@ void MultiDoServerRobotFrame(int slot) { int objnum = Moved_robots[slot][m] & HANDLE_OBJNUM_MASK; if (Moved_robots[slot][m] != Objects[objnum].handle) { - mprintf((0, "Caught handle objnum problem!\n")); + mprintf(0, "Caught handle objnum problem!\n"); continue; } @@ -2409,7 +2413,7 @@ void MultiDoServerRobotFrame(int slot) { object *obj = &Objects[objnum]; if (Changed_anim[m][slot] != obj->handle) { - mprintf((0, "Caught anim handle objnum problem!\n")); + mprintf(0, "Caught anim handle objnum problem!\n"); continue; } @@ -2437,7 +2441,7 @@ void MultiDoServerRobotFrame(int slot) { object *obj = &Objects[objnum]; if (Changed_turret[m][slot] != obj->handle) { - mprintf((0, "Caught turret handle objnum problem!\n")); + mprintf(0, "Caught turret handle objnum problem!\n"); continue; } @@ -2465,7 +2469,7 @@ void MultiDoServerRobotFrame(int slot) { object *obj = &Objects[objnum]; if (Changed_wb_anim[m][slot] != obj->handle) { - mprintf((0, "Caught wb anim handle objnum problem!\n")); + mprintf(0, "Caught wb anim handle objnum problem!\n"); continue; } @@ -2725,7 +2729,7 @@ void MultiDoServerFrame() { for (i = 0; i < MAX_NET_PLAYERS; i++) Player_fire_packet[i].fired_on_this_frame = PFP_NO_FIRED; - mprintf_at((2, 5, 0, "Occ=%d ", Multi_occluded)); + mprintf_at(2, 5, 0, "Occ=%d ", Multi_occluded); // If this is a dedicated server then we should get possible input if (Dedicated_server) @@ -2742,8 +2746,8 @@ void MultiSendClientExecuteDLL(int eventnum, int me_objnum, int it_objnum, int t if (to == Player_num) return; - // mprintf ((0,"Sending MP_EXECUTE_DLL packet to slot %d! type=%d - // id=%d\n",to,Objects[me_objnum].type,Objects[me_objnum].id)); + // mprintf(0,"Sending MP_EXECUTE_DLL packet to slot %d! type=%d + // id=%d\n",to,Objects[me_objnum].type,Objects[me_objnum].id); size_offset = START_DATA(MP_EXECUTE_DLL, data, &count, 1); @@ -2915,7 +2919,7 @@ float CalculateNewRanking (object *obj_a,object *obj_b,int won) if (new_rank<0) new_rank=0; - mprintf ((0,"Player %s rating is now %f\n",Players[obj_a->id].callsign,new_rank)); + mprintf(0,"Player %s rating is now %f\n",Players[obj_a->id].callsign,new_rank); return new_rank; } @@ -2964,7 +2968,7 @@ void MultiSendChangeRank(int pnum, char *str, uint8_t goodnews) { uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; - mprintf((0, "Sending change rank!\n")); + mprintf(0, "Sending change rank!\n"); size = START_DATA(MP_CHANGE_RANK, data, &count); MultiAddByte(pnum, data, &count); diff --git a/Descent3/multi_ui.cpp b/Descent3/multi_ui.cpp index b3fb5edf..64013e94 100644 --- a/Descent3/multi_ui.cpp +++ b/Descent3/multi_ui.cpp @@ -379,7 +379,7 @@ void DisplayNetDLLHelp(const char *topic); int MainMultiplayerMenu() { - mprintf((0, "Entering MainMultiplayerMenu()\n")); + mprintf(0, "Entering MainMultiplayerMenu()\n"); #ifdef USE_DIRECTPLAY Num_directplay_games = 0; @@ -1500,7 +1500,7 @@ void MultiGameOptionsMenu(int alloptions) { MULTI_OPT_TOGGLES_X, pcs_y, 180, 30, UIF_FIT); Netgame.flags &= ~NF_PEER_PEER; Netgame.flags &= ~NF_PERMISSABLE; - mprintf((0, "Using Client/Server model\n")); + mprintf(0, "Using Client/Server model\n"); } else if (res == PP_MODE_HS_ID) { cs_mode_hs.Destroy(); pp_mode_hs.Destroy(); @@ -1515,7 +1515,7 @@ void MultiGameOptionsMenu(int alloptions) { Netgame.flags |= NF_PEER_PEER; Netgame.flags &= ~NF_PERMISSABLE; - mprintf((0, "Using Peer/Peer model\n")); + mprintf(0, "Using Peer/Peer model\n"); } else if (res == PS_MODE_HS_ID) { cs_mode_hs.Destroy(); pp_mode_hs.Destroy(); @@ -1530,7 +1530,7 @@ void MultiGameOptionsMenu(int alloptions) { Netgame.flags |= NF_PERMISSABLE; Netgame.flags &= ~NF_PEER_PEER; - mprintf((0, "Using Permissable model\n")); + mprintf(0, "Using Permissable model\n"); } else if (res == ROT_VEL_HS_ID) { rot_vel_hs.Destroy(); diff --git a/Descent3/multisafe.cpp b/Descent3/multisafe.cpp index dedd9d22..37f924a1 100644 --- a/Descent3/multisafe.cpp +++ b/Descent3/multisafe.cpp @@ -715,7 +715,7 @@ bool VALIDATE_ROOM_PORTAL(int roomnum, int portalnum) { object *VALIDATE_OBJECT(int handle) { object *objp = ObjGet(handle); if (!objp) { - mprintf((0, "Invalid object passed to multisafe.\n")); + mprintf(0, "Invalid object passed to multisafe.\n"); } return objp; } @@ -1314,7 +1314,7 @@ void msafe_CallFunction(uint8_t type, msafe_struct *mstruct) { break; case MSAFE_WEATHER_LIGHTNING_BOLT: { if (mstruct->texnum == -1) { - mprintf((0, "Failing bolt because texnum is -1\n")); + mprintf(0, "Failing bolt because texnum is -1\n"); return; } @@ -1603,7 +1603,7 @@ void msafe_CallFunction(uint8_t type, msafe_struct *mstruct) { if (mstruct->objhandle != OBJECT_HANDLE_NONE) { object *keyobj = ObjGet(mstruct->objhandle); if (keyobj) { - mprintf((0, "Adding key from multisafe to player %d\n", slot)); + mprintf(0, "Adding key from multisafe to player %d\n", slot); Sound_system.Play3dSound(SOUND_POWERUP_PICKUP, SND_PRIORITY_HIGH, keyobj); Players[slot].inventory.Add(keyobj->type, keyobj->id, NULL, -1, -1, INVAF_NOTSPEWABLE, mstruct->message); diff --git a/Descent3/multisafe_server.cpp b/Descent3/multisafe_server.cpp index 9b4a4fd6..317e30be 100644 --- a/Descent3/multisafe_server.cpp +++ b/Descent3/multisafe_server.cpp @@ -244,11 +244,11 @@ void MultiDoMSafeFunction(uint8_t *data) { mstruct->lifetime = MultiGetFloat(data, &count); mstruct->size = MultiGetFloat(data, &count); mstruct->speed = MultiGetFloat(data, &count); - mprintf((0, "Got a START SPEW. Index=%d\n", mstruct->id)); + mprintf(0, "Got a START SPEW. Index=%d\n", mstruct->id); break; case MSAFE_OBJECT_STOP_SPEW: mstruct->id = MultiGetUbyte(data, &count); - mprintf((0, "Got STOP SPEW. index=%d\n", mstruct->id)); + mprintf(0, "Got STOP SPEW. index=%d\n", mstruct->id); mstruct->id = Server_spew_list[mstruct->id]; ASSERT(mstruct->id != 65535); break; @@ -1086,7 +1086,7 @@ void MultiSendMSafeFunction(uint8_t type, msafe_struct *mstruct) { break; default: - mprintf((0, "Type %d is not handled in multisafe server...fix me!!\n", type)); + mprintf(0, "Type %d is not handled in multisafe server...fix me!!\n", type); Int3(); // Illegal type passed to multisafe function break; } @@ -1157,7 +1157,7 @@ void MultiSendMSafePowerup(msafe_struct *mstruct) { size_offset = START_DATA(MP_MSAFE_POWERUP, data, &count); - mprintf((0, "Sending powerup objnum of %d\n", mstruct->objhandle & HANDLE_OBJNUM_MASK)); + mprintf(0, "Sending powerup objnum of %d\n", mstruct->objhandle & HANDLE_OBJNUM_MASK); MultiAddUshort(mstruct->objhandle & HANDLE_OBJNUM_MASK, data, &count); MultiAddUshort(mstruct->ithandle & HANDLE_OBJNUM_MASK, data, &count); diff --git a/Descent3/newui.cpp b/Descent3/newui.cpp index a15ed7d1..4d1cf05d 100644 --- a/Descent3/newui.cpp +++ b/Descent3/newui.cpp @@ -754,7 +754,7 @@ bool DoEditDialog(const char *title, char *buffer, int buflen, bool showcancel) if (res != UID_CANCEL && res != NEWUIRES_FORCEQUIT) { if (strcmp(edit, NEWUI_EDIT_CANCELED_STR) != 0) { strcpy(buffer, edit); - mprintf((0, "editdialog=%s\n", buffer)); + mprintf(0, "editdialog=%s\n", buffer); } else { res = UID_CANCEL; } diff --git a/Descent3/newui_core.cpp b/Descent3/newui_core.cpp index c7480d6d..235f6e75 100644 --- a/Descent3/newui_core.cpp +++ b/Descent3/newui_core.cpp @@ -2250,9 +2250,9 @@ void newuiMenuOptionButton::OnMouseBtnDown(int btn) { if ((m_State != UI_BTS_ACTIVATED) && PT_IN_GADGET(m_Wnd, this, UI_input.mx, UI_input.my)) { m_State = UI_BTS_ACTIVATED; LOCK_FOCUS(this); - // mprintf((0, "mouse down in button gadget (%d)\n", GetID())); + // mprintf(0, "mouse down in button gadget (%d)\n", GetID()); if (m_mono_press) { - // mprintf((0, "selected button gadget (%d)\n", GetID())); + // mprintf(0, "selected button gadget (%d)\n", GetID()); OnSelect(); m_State = UI_BTS_HILITE; } @@ -2901,7 +2901,7 @@ void newuiListBox::RemoveItem(const char *name) { } } if (found == -1) { - mprintf((0, "newuiListBox:: Didn't find item to remove!\n")); + mprintf(0, "newuiListBox:: Didn't find item to remove!\n"); return; } @@ -3058,7 +3058,7 @@ bool newuiListBox::SetCurrentItem(const char *name) { } if (!found) { - mprintf((0, "newuiListBox::SelectItem item not found!\n")); + mprintf(0, "newuiListBox::SelectItem item not found!\n"); return false; } @@ -3263,9 +3263,9 @@ void newuiListBox::OnMouseBtnDown(int btn) { if (m_nclicks == 0) { LOCK_FOCUS(this); m_nclicks = 1; - // mprintf((0, "click 1\n")); + // mprintf(0, "click 1\n"); } else if (m_nclicks == 2) { - // mprintf((0, "click 2\n")); + // mprintf(0, "click 2\n"); LOCK_FOCUS(this); if (((m_click_time - old_click_time) < UI_DBLCLICK_DELAY)) { if (abs(m_mse_x - m_last_mse_x) < UI_DBLCLICK_MSEDELTA && abs(m_mse_y - m_last_mse_y) < UI_DBLCLICK_MSEDELTA) { @@ -3278,7 +3278,7 @@ void newuiListBox::OnMouseBtnDown(int btn) { if (m_mse_y >= y && m_mse_y <= (y + item.height() - 1)) { if (m_mse_x > m_boffs && m_mse_x < (m_W - m_boffs - 12)) { OnSelect(); - // mprintf((0, "select!\n")); + // mprintf(0, "select!\n"); m_nclicks = 0; break; } @@ -3641,7 +3641,7 @@ void newuiComboBox::RemoveItem(const char *name) { } } if (found == -1) { - mprintf((0, "newuiComboBox:: Didn't find item to remove!\n")); + mprintf(0, "newuiComboBox:: Didn't find item to remove!\n"); return; } @@ -3768,7 +3768,7 @@ bool newuiComboBox::SetCurrentItem(const char *name) { } if (!found) { - mprintf((0, "newuiComboBox::SelectItem item not found!\n")); + mprintf(0, "newuiComboBox::SelectItem item not found!\n"); return false; } diff --git a/Descent3/newui_filedlg.cpp b/Descent3/newui_filedlg.cpp index 8fbb2ae3..1c44b6fe 100644 --- a/Descent3/newui_filedlg.cpp +++ b/Descent3/newui_filedlg.cpp @@ -210,7 +210,7 @@ void FileSelectCallback(int index) { strncpy(path_edit, file, _MAX_PATH - 1); path_edit[_MAX_PATH - 1] = '\0'; - mprintf((0, "New Path: %s\n", path_edit)); + mprintf(0, "New Path: %s\n", path_edit); fdlg_working_sheet->UpdateChanges(); } @@ -453,9 +453,9 @@ bool DoPathFileDialog(bool save_dialog, char *path, const char *title, const cha } if (ret) { - mprintf((0, "Selected Filename: %s\n", path)); + mprintf(0, "Selected Filename: %s\n", path); } else { - mprintf((0, "Cancel!\n")); + mprintf(0, "Cancel!\n"); } window.Close(); diff --git a/Descent3/object.cpp b/Descent3/object.cpp index 5087ab79..20f82799 100644 --- a/Descent3/object.cpp +++ b/Descent3/object.cpp @@ -1569,14 +1569,14 @@ int FreeObjectSlots(int num_used) { original_num_to_free = num_to_free; if (num_to_free > olind) { - mprintf((1, "Warning: Asked to free %i objects, but can only free %i.\n", num_to_free, olind)); + mprintf(1, "Warning: Asked to free %i objects, but can only free %i.\n", num_to_free, olind); num_to_free = olind; } for (i = 0; i < num_to_free; i++) if (Objects[obj_list[i]].type == OBJ_DEBRIS) { num_to_free--; - mprintf((0, "Freeing DEBRIS object %3i\n", obj_list[i])); + mprintf(0, "Freeing DEBRIS object %3i\n", obj_list[i]); SetObjectDeadFlag(&Objects[obj_list[i]]); } @@ -1598,7 +1598,7 @@ int FreeObjectSlots(int num_used) { for (i = 0; i < num_to_free; i++) if (Objects[obj_list[i]].type == OBJ_WEAPON) { num_to_free--; - mprintf((0, "Freeing WEAPON object %3i\n", obj_list[i])); + mprintf(0, "Freeing WEAPON object %3i\n", obj_list[i]); SetObjectDeadFlag(&Objects[obj_list[i]]); } @@ -1616,11 +1616,11 @@ int ObjAllocate(void) { int num_freed; num_freed = FreeObjectSlots(MAX_OBJECTS - 10); - mprintf((0, " *** Freed %i objects in frame %i\n", num_freed, FrameCount)); + mprintf(0, " *** Freed %i objects in frame %i\n", num_freed, FrameCount); } if (Num_objects >= MAX_OBJECTS) { - mprintf((1, "Object creation failed - too many objects!\n")); + mprintf(1, "Object creation failed - too many objects!\n"); return -1; } @@ -1630,7 +1630,7 @@ int ObjAllocate(void) { Highest_object_index = objnum; if (Highest_object_index > Highest_ever_object_index) { Highest_ever_object_index = Highest_object_index; - mprintf((0, "Highest ever Object %d\n", Highest_ever_object_index)); + mprintf(0, "Highest ever Object %d\n", Highest_ever_object_index); } } @@ -1723,7 +1723,7 @@ int ObjCreate(uint8_t type, uint16_t id, int roomnum, vector *pos, const matrix #ifdef _DEBUG if (print_object_info) { - mprintf((0, "Created object %d of type %d\n", objnum, obj->type)); + mprintf(0, "Created object %d of type %d\n", objnum, obj->type); } #endif @@ -1839,14 +1839,14 @@ void ObjDelete(int objnum) { /* if ((Game_mode & GM_MULTI) && Netgame.local_role==LR_CLIENT && Objects[objnum].type==OBJ_POWERUP) { - mprintf ((0,"Deleting object number %d type=%d id=%d\n",objnum,obj->type,obj->id)); + mprintf(0,"Deleting object number %d type=%d id=%d\n",objnum,obj->type,obj->id); }*/ if ((Game_mode & GM_MULTI) && (obj->flags & OF_SERVER_OBJECT)) { if (Netgame.local_role == LR_CLIENT && NetPlayers[Player_num].sequence > NETSEQ_OBJECTS && NetPlayers[Player_num].sequence != NETSEQ_LEVEL_END) { if (!(obj->flags & OF_SERVER_SAYS_DELETE)) { - mprintf((0, "Illegally deleting server object! Objnum=%d type=%d id=%d\n", objnum, obj->type, obj->id)); + mprintf(0, "Illegally deleting server object! Objnum=%d type=%d id=%d\n", objnum, obj->type, obj->id); Int3(); return; } @@ -1871,10 +1871,10 @@ void ObjDelete(int objnum) { //?? if (obj->type==OBJ_WEAPON && obj->id==GUIDEDMISS_ID) { //?? int pnum=Objects[obj->ctype.laser_info.parent_num].id; - //?? mprintf ((0,"Deleting a guided missile! Player %d\n\n",pnum)); + //?? mprintf(0,"Deleting a guided missile! Player %d\n\n",pnum); //?? //?? if (pnum!=Player_num) { - //?? mprintf ((0,"deleting missile that belongs to %d (%s)!\n",pnum,Players[pnum].callsign)); + //?? mprintf(0,"deleting missile that belongs to %d (%s)!\n",pnum,Players[pnum].callsign); //?? Guided_missile[pnum]=NULL; //?? } //?? else if (Newdemo_state==ND_STATE_RECORDING) @@ -1897,7 +1897,7 @@ void ObjDelete(int objnum) { #ifdef _DEBUG if (print_object_info) { - mprintf((0, "Deleting object %d of type %d\n", objnum, Objects[objnum].type)); + mprintf(0, "Deleting object %d of type %d\n", objnum, Objects[objnum].type); } #endif @@ -1905,7 +1905,7 @@ void ObjDelete(int objnum) { int pnum = Objects[(obj->parent_handle & HANDLE_OBJNUM_MASK)].id; if (Players[pnum].guided_obj == obj) { - mprintf((0, "Deleting a guided missile!")); + mprintf(0, "Deleting a guided missile!"); Players[pnum].guided_obj = NULL; } } @@ -1914,7 +1914,7 @@ void ObjDelete(int objnum) { int pnum = Objects[(obj->parent_handle & HANDLE_OBJNUM_MASK)].id; if (Players[pnum].user_timeout_obj == obj) { - mprintf((0, "Deleting a timeout missile!")); + mprintf(0, "Deleting a timeout missile!"); Players[pnum].user_timeout_obj = NULL; } } @@ -1934,7 +1934,7 @@ void ObjDelete(int objnum) { Gametime + (Netgame.respawn_time * Object_info[obj->id].respawn_scalar); Powerup_timer[Num_powerup_timer].id = obj->id; Num_powerup_timer++; - mprintf((0, "Adding powerup id %d to respawn list! count=%d\n", obj->id, Num_powerup_timer)); + mprintf(0, "Adding powerup id %d to respawn list! count=%d\n", obj->id, Num_powerup_timer); } } } @@ -2139,7 +2139,7 @@ void DoCycledAnim(object *obj) { ASSERT(from <= to); if (obj->rtype.pobj_info.anim_frame < from || obj->rtype.pobj_info.anim_frame > to) { - mprintf((0, "NonAI-Animation: Correcting for an incorrect frame number\n")); + mprintf(0, "NonAI-Animation: Correcting for an incorrect frame number\n"); obj->rtype.pobj_info.anim_frame = from; } @@ -3024,7 +3024,7 @@ void ObjDoFrameAll() { // Blend all lights that are needed BlendAllLightingEdges(); - mprintf_at((1, 5, 40, "Objs=%d ", objs_live)); + mprintf_at(1, 5, 40, "Objs=%d ", objs_live); // Delete everything that died ObjDeleteDead(); @@ -3239,7 +3239,7 @@ void ClearTransientObjects(int clear_all) { (objp->type == OBJ_FIREBALL) || (objp->type == OBJ_DEBRIS) || (objp->type == OBJ_SHARD) || (objp->type == OBJ_SHOCKWAVE) || (objp->type == OBJ_PARTICLE) || (objp->type == OBJ_SPLINTER) || ((objp->type != OBJ_NONE) && (objp->flags & OF_DYING))) { - mprintf((0, "Clearing object %d type = %d\n", objnum, objp->type)); + mprintf(0, "Clearing object %d type = %d\n", objnum, objp->type); ObjDelete(objnum); } } @@ -3453,7 +3453,7 @@ void ObjSetTurretUpdate(uint16_t objnum, multi_turret *multi_turret_info) { p_info->multi_turret_info.flags = FMT_NEW_DATA; } else { - mprintf((0, "Woops, no turret here to update!\n")); + mprintf(0, "Woops, no turret here to update!\n"); } } @@ -3510,7 +3510,7 @@ void ObjUnGhostObject(int objnum) { //@@if(obj->flags&OF_INPLAYERINVENTORY) //@@ return; if (obj->flags & OF_INPLAYERINVENTORY) { - mprintf((0, "UnGhosting Object in that is currently in a player's inventory!\n")); + mprintf(0, "UnGhosting Object in that is currently in a player's inventory!\n"); } obj->type = obj->dummy_type; diff --git a/Descent3/object_lighting.cpp b/Descent3/object_lighting.cpp index 91f4be0c..9381b6d7 100644 --- a/Descent3/object_lighting.cpp +++ b/Descent3/object_lighting.cpp @@ -375,7 +375,7 @@ void DoObjectLight(object *obj) { int factor = li->flicker_distance; if (factor == 0) { - mprintf((0, "You have a flicker_slightly light that has a flicker factor of zero!\n")); + mprintf(0, "You have a flicker_slightly light that has a flicker factor of zero!\n"); return; } @@ -463,12 +463,12 @@ void ClearObjectLightmaps(object *obj) { poly_model *pm = &Poly_models[obj->rtype.pobj_info.model_num]; ASSERT(pm->n_models < MAX_SUBOBJECTS); - mprintf((1, "CLEAR %d %s", obj->handle, obj->name)); + mprintf(1, "CLEAR %d %s", obj->handle, obj->name); int faceCount = 0; for (Mnum = 0; Mnum < pm->n_models; Mnum++) { if (!IsNonRenderableSubmodel(pm, Mnum)) { - mprintf((1, " %X\n", obj->lm_object.lightmap_faces[Mnum][0].u2)); + mprintf(1, " %X\n", obj->lm_object.lightmap_faces[Mnum][0].u2); mem_free(obj->lm_object.lightmap_faces[Mnum][0].u2); break; } @@ -528,7 +528,7 @@ void SetupObjectLightmapMemory(object *obj) { ASSERT(pm->n_models < MAX_SUBOBJECTS); int uv2size = 0; - mprintf((1, "SETUP %d %s", obj->handle, obj->name)); + mprintf(1, "SETUP %d %s", obj->handle, obj->name); for (Mnum = 0; Mnum < pm->n_models; Mnum++) { if (IsNonRenderableSubmodel(pm, Mnum)) { obj->lm_object.num_faces[Mnum] = 0; @@ -552,7 +552,7 @@ void SetupObjectLightmapMemory(object *obj) { } if (uv2size) { float *uvblock = (float *)mem_malloc(2 * uv2size * sizeof(float)); - mprintf((1, " %X %d\n", uvblock, uv2size)); + mprintf(1, " %X %d\n", uvblock, uv2size); for (Mnum = 0; Mnum < pm->n_models; Mnum++) { if (!IsNonRenderableSubmodel(pm, Mnum)) { diff --git a/Descent3/objinfo.cpp b/Descent3/objinfo.cpp index 1ae5e644..1261e443 100644 --- a/Descent3/objinfo.cpp +++ b/Descent3/objinfo.cpp @@ -120,7 +120,7 @@ int AllocObjectID(int type, bool f_anim, bool f_weapons, bool f_ai) { for (int i = NUM_STATIC_OBJECTS; i < MAX_OBJECT_IDS; i++) { if (Object_info[i].type == OBJ_NONE) { - mprintf((1, "%d ", type)); + mprintf(1, "%d ", type); memset(&Object_info[i], 0, sizeof(*Object_info)); extern void AISetDefault(t_ai_info * ai_info_ptr); diff --git a/Descent3/osiris_predefs.cpp b/Descent3/osiris_predefs.cpp index 57f2297b..fcef38ad 100644 --- a/Descent3/osiris_predefs.cpp +++ b/Descent3/osiris_predefs.cpp @@ -556,18 +556,18 @@ int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags path_information path_info; if (!obj) { - mprintf((0, "Illegal object passed to AIGoalFollowPathSimple\n")); + mprintf(0, "Illegal object passed to AIGoalFollowPathSimple\n"); return -1; } if (path_id == -1) { - mprintf((0, "Illegal Path Id Passed To AIGoalFollowPathSimple\n")); + mprintf(0, "Illegal Path Id Passed To AIGoalFollowPathSimple\n"); Int3(); return -1; } if (obj->control_type != CT_AI) { - mprintf((0, "Illegal Object CT Passed To AIGoalFollowPathSimple\n")); + mprintf(0, "Illegal Object CT Passed To AIGoalFollowPathSimple\n"); Int3(); return -1; } @@ -588,7 +588,7 @@ int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags int osipf_AIPowerSwitch(int objhandle, uint8_t f_power_on) { object *obj = ObjGet(objhandle); if (!obj) { - mprintf((0, "Illegal Object passed to AIPowerSwitch\n")); + mprintf(0, "Illegal Object passed to AIPowerSwitch\n"); return -1; } @@ -605,7 +605,7 @@ void osipf_SoundTouch(char *str) { int id = FindSoundName(IGNORE_TABLE(str)); if (id == -1) { - mprintf((0, "Sound %s was not found. Unable to touch.\n", str)); + mprintf(0, "Sound %s was not found. Unable to touch.\n", str); Int3(); } else Sound_system.CheckAndForceSoundDataAlloc(id); @@ -617,7 +617,7 @@ void osipf_RoomValue(int roomnum, char op, char vtype, void *ptr, int index) { if (vtype == RMV_C_USED) *(char *)ptr = 0; else - mprintf((0, "RoomValue: Illegal Room Passed\n")); + mprintf(0, "RoomValue: Illegal Room Passed\n"); return; } @@ -742,7 +742,7 @@ void osipf_PlayerValue(int obj_handle, char op, char vhandle, void *ptr, int ind objp = ObjGet(obj_handle); if (!objp || (!(objp->type == OBJ_PLAYER || objp->type == OBJ_GHOST || objp->type == OBJ_OBSERVER))) { - mprintf((0, "Player Value: Illegal Object Passed\n")); + mprintf(0, "Player Value: Illegal Object Passed\n"); return; } @@ -891,7 +891,7 @@ void osipf_ObjectCustomAnim(int handle, float start, float end, float time, char object *objp = ObjGet(handle); if (!objp) { - mprintf((0, "AIValue: Illegal Object Passed\n")); + mprintf(0, "AIValue: Illegal Object Passed\n"); return; } @@ -907,7 +907,7 @@ void osipf_ObjectCustomAnim(int handle, float start, float end, float time, char if (objp->ai_info) objp->ai_info->next_animation_type = AS_CUSTOM; else - mprintf((0, "ERROR: Changing animation for non-AI object.\n")); + mprintf(0, "ERROR: Changing animation for non-AI object.\n"); if (flags & AIAF_IMMEDIATE) { AIUpdateAnim(objp); @@ -936,7 +936,7 @@ float osipf_ObjectGetTimeLived(int objhandle) { object *objp = ObjGet(objhandle); if (!objp) { - mprintf((0, "Illegal object passed to ObjectGetTimeLived\n")); + mprintf(0, "Illegal object passed to ObjectGetTimeLived\n"); return 0; } @@ -947,12 +947,12 @@ void osipf_AIValue(int objhandle, char op, char vtype, void *ptr) { object *objp = ObjGet(objhandle); if (!objp) { - mprintf((0, "AIValue: Illegal Object Passed\n")); + mprintf(0, "AIValue: Illegal Object Passed\n"); return; } if ((objp->control_type != CT_AI) && (objp->control_type != CT_DYING_AND_AI)) { - mprintf((0, "AIValue: Illegal Object CT Passed\n")); + mprintf(0, "AIValue: Illegal Object CT Passed\n"); return; } @@ -1636,12 +1636,12 @@ uint8_t osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec) { object *objp = ObjGet(objhandle); if (!objp) { - mprintf((0, "AITurnTowardsVectors: Illegal Object Passed\n")); + mprintf(0, "AITurnTowardsVectors: Illegal Object Passed\n"); return 0; } if (objp->control_type != CT_AI) { - mprintf((0, "AITurnTowardsVectors: Illegal Object CT Passed\n")); + mprintf(0, "AITurnTowardsVectors: Illegal Object CT Passed\n"); return 0; } @@ -1655,12 +1655,12 @@ void osipf_AISetType(int objhandle, int type) { object *objp = ObjGet(objhandle); if (!objp) { - mprintf((0, "AISetType: Illegal Object Passed\n")); + mprintf(0, "AISetType: Illegal Object Passed\n"); return; } if (objp->control_type != CT_AI) { - mprintf((0, "AISetType: Illegal Object CT Passed\n")); + mprintf(0, "AISetType: Illegal Object CT Passed\n"); return; } @@ -1678,28 +1678,28 @@ vector osipf_AIFindHidePos(int hideobjhandle, int viewobjhandle, float time, int int hroom; if (hide_obj == NULL) { - mprintf((0, "Illegal Hide Object Passed To AIFindHidePos\n")); + mprintf(0, "Illegal Hide Object Passed To AIFindHidePos\n"); *hide_room = -1; return Zero_vector; } if (hide_obj->control_type != CT_AI) { - mprintf((0, "Illegal Object CT Passed To AIFindHidePos\n")); + mprintf(0, "Illegal Object CT Passed To AIFindHidePos\n"); *hide_room = -1; return Zero_vector; } if (view_obj == NULL) { - mprintf((0, "Illegal View Object Passed To AIFindHidePos\n")); + mprintf(0, "Illegal View Object Passed To AIFindHidePos\n"); *hide_room = hide_obj->roomnum; return hide_obj->pos; } if (time <= 0.0) { - mprintf((0, "AIFindHidePos: Illegal Time Passed bashing to 1sec\n")); + mprintf(0, "AIFindHidePos: Illegal Time Passed bashing to 1sec\n"); time = 1.0f; } else if (time > 15.0) { - mprintf((0, "AIFindHidePos: Illegal Time Passed bashing to 15sec\n")); + mprintf(0, "AIFindHidePos: Illegal Time Passed bashing to 15sec\n"); time = 15.0f; } @@ -1716,7 +1716,7 @@ int osipf_AIGoalAddEnabler(int objhandle, int goal_index, int enabler_type, floa obj = ObjGet(objhandle); if (obj == NULL || obj->ai_info == NULL) { - mprintf((0, "Illegal object passed to AIGoalAddEnabler\n")); + mprintf(0, "Illegal object passed to AIGoalAddEnabler\n"); return -1; } @@ -1733,7 +1733,7 @@ int osipf_AIGoalAdd(int objhandle, int goal_type, int level, float influence, in obj = ObjGet(objhandle); if (obj == NULL || obj->ai_info == NULL) { - mprintf((0, "Illegal object passed to AIGoalAdd\n")); + mprintf(0, "Illegal object passed to AIGoalAdd\n"); return -1; } @@ -1896,7 +1896,7 @@ int osipf_AIGoalAdd(int objhandle, int goal_type, int level, float influence, in } break; default: - mprintf((0, "AIGoalAdd Error: Get chris - goal %d is not available of scripting\n", goal_type)); + mprintf(0, "AIGoalAdd Error: Get chris - goal %d is not available of scripting\n", goal_type); } return -1; @@ -1906,12 +1906,12 @@ void osipf_AIGoalClear(int objhandle, int goal_index) { object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Invalid Object Passed To AIGoalClear\n")); + mprintf(0, "Invalid Object Passed To AIGoalClear\n"); return; } if (obj->control_type != CT_AI) { - mprintf((0, "AIGoalClear: Illegal Object CT Passed\n")); + mprintf(0, "AIGoalClear: Illegal Object CT Passed\n"); return; } @@ -1927,7 +1927,7 @@ int osipf_AIFindObjOfType(int objhandle, int type, int id, bool f_ignore_init_ro object *f_obj; if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AIFindObjOfType\n")); + mprintf(0, "Illegal Object Passed To AIFindObjOfType\n"); return OBJECT_HANDLE_NONE; } @@ -1945,7 +1945,7 @@ int osipf_ObjMakeListOfType(int objhandle, int type, int id, bool f_ignore_init_ int i; if (obj == NULL) { - mprintf((0, "Illegal Object Passed To Obj_MakeListOfType\n")); + mprintf(0, "Illegal Object Passed To Obj_MakeListOfType\n"); return OBJECT_HANDLE_NONE; } @@ -2001,7 +2001,7 @@ int osipf_AIFindEnergyCenter(int objhandle) { object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AIFindEnergyCenter\n")); + mprintf(0, "Illegal Object Passed To AIFindEnergyCenter\n"); return -1; } @@ -2016,12 +2016,12 @@ float osipf_AIGetDistToObj(int objhandle, int otherobjhandle) { float dist; if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AIGetDistToObj\n")); + mprintf(0, "Illegal Object Passed To AIGetDistToObj\n"); return 0; } if (fobj == NULL) { - mprintf((0, "Illegal Find Object Passed To AIGetDistToObj\n")); + mprintf(0, "Illegal Find Object Passed To AIGetDistToObj\n"); return 0; } @@ -2034,12 +2034,12 @@ int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, uint8_t f_en object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AISetGoalFlags\n")); + mprintf(0, "Illegal Object Passed To AISetGoalFlags\n"); return 0; } if (obj->control_type != CT_AI) { - mprintf((0, "Non-AI Object Passed To AISetGoalFlags\n")); + mprintf(0, "Non-AI Object Passed To AISetGoalFlags\n"); return 0; } @@ -2059,12 +2059,12 @@ void osipf_AISetGoalCircleDist(int objhandle, int goal_handle, float dist) { object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AISetGoalCircleDist\n")); + mprintf(0, "Illegal Object Passed To AISetGoalCircleDist\n"); return; } if (obj->control_type != CT_AI) { - mprintf((0, "Non-AI Object Passed To AISetGoalCircleDist\n")); + mprintf(0, "Non-AI Object Passed To AISetGoalCircleDist\n"); return; } @@ -2079,7 +2079,7 @@ void osipf_GetGunPos(int objhandle, int gun_number, vector *gun_pnt, vector *gun object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Illegal Object Passed To AIGetGunPosition\n")); + mprintf(0, "Illegal Object Passed To AIGetGunPosition\n"); *gun_pnt = Zero_vector; *gun_normal = Zero_vector; return; @@ -2092,7 +2092,7 @@ void osipf_GetGroundPos(int objhandle, int ground_number, vector *ground_pnt, ve object *obj = ObjGet(objhandle); if (obj == NULL) { - mprintf((0, "Illegal Object Passed To Obj_GetGroundPos\n")); + mprintf(0, "Illegal Object Passed To Obj_GetGroundPos\n"); *ground_pnt = Zero_vector; *ground_normal = Zero_vector; return; @@ -2402,7 +2402,7 @@ int osipf_RayCast(int objhandle, vector *p0, vector *p1, int start_roomnum, floa int *ilist = hack_ilist; object *obj = ObjGet(objhandle); if (!obj && objhandle != OBJECT_HANDLE_NONE) { - mprintf((0, "Invalid object passed to RayCast\n")); + mprintf(0, "Invalid object passed to RayCast\n"); return 0; } @@ -2638,12 +2638,12 @@ void osipf_ObjWBValue(int obj_handle, char wb_index, char op, char vtype, void * object *objp = ObjGet(obj_handle); if (!objp) { - mprintf((0, "Obj_WBValue: Illegal Object Passed\n")); + mprintf(0, "Obj_WBValue: Illegal Object Passed\n"); return; } if (objp->control_type != CT_AI && objp->type != OBJ_PLAYER && objp->type != OBJ_OBSERVER) { - mprintf((0, "Obj_WBValue: Illegal Object CT Passed\n")); + mprintf(0, "Obj_WBValue: Illegal Object CT Passed\n"); return; } @@ -2794,7 +2794,7 @@ void osipf_ObjWBValue(int obj_handle, char wb_index, char op, char vtype, void * // value is 0 to clear, or 1 to set void osipf_MissionFlagSet(int flag, uint8_t value) { if (flag < 1 && flag > 32) { - mprintf((0, "Invalid flag passed to osipf_MissionFlagSet(%d)\n", flag)); + mprintf(0, "Invalid flag passed to osipf_MissionFlagSet(%d)\n", flag); return; } @@ -2813,7 +2813,7 @@ void osipf_MissionFlagSet(int flag, uint8_t value) { // flag is what mission flag to get. Returns 1 if set, 0 if not. int osipf_MissionFlagGet(int flag) { if (flag < 1 && flag > 32) { - mprintf((0, "Invalid flag passed to osipf_MissionFlagGet(%d)\n", flag)); + mprintf(0, "Invalid flag passed to osipf_MissionFlagGet(%d)\n", flag); return 0; } @@ -3696,7 +3696,7 @@ void osipf_PathValue(int path_id, int node_id, char op, int changes, void *ptr) } if (path_id < 0 || path_id >= Num_game_paths) { - mprintf((0, "Invalid Path\n")); + mprintf(0, "Invalid Path\n"); Int3(); return; } @@ -3710,7 +3710,7 @@ void osipf_PathValue(int path_id, int node_id, char op, int changes, void *ptr) if (op == VF_GET) { if (changes & PV_ALL) { if (node_id < 0 || node_id >= cpath->num_nodes) { - mprintf((0, "Invalid node on path\n")); + mprintf(0, "Invalid node on path\n"); Int3(); return; } @@ -3752,7 +3752,7 @@ void osipf_PathValue(int path_id, int node_id, char op, int changes, void *ptr) } else if (op == VF_SET) { if (changes & PV_ALL) { if (node_id < 0 || node_id >= cpath->num_nodes) { - mprintf((0, "Invalid node on path\n")); + mprintf(0, "Invalid node on path\n"); Int3(); return; } diff --git a/Descent3/pilot.cpp b/Descent3/pilot.cpp index 80c23d49..88d9b61c 100644 --- a/Descent3/pilot.cpp +++ b/Descent3/pilot.cpp @@ -896,9 +896,9 @@ void PilotListSelectChangeCallback(int index) { Pilot->set_difficulty(difficulty); Pilot->set_audiotaunts(audiotaunts); PltWriteFile(&working_pilot); - mprintf((0, "Pilot saved\n")); + mprintf(0, "Pilot saved\n"); } else { - mprintf((0, "Skipping pilot save...has the old pilot been deleted?\n")); + mprintf(0, "Skipping pilot save...has the old pilot been deleted?\n"); } working_pilot.clean(true); @@ -919,7 +919,7 @@ void PilotListSelectChangeCallback(int index) { if (in_edit) PilotChooseDialogInfo.edit->sheet->UpdateChanges(); Pilot->get_name(name); - mprintf((0, "Pilot has changed to: %s\n", name)); + mprintf(0, "Pilot has changed to: %s\n", name); if (PilotChooseDialogInfo.edit->pilot_name) { strncpy(PilotChooseDialogInfo.edit->pilot_name, name, 63); @@ -1039,11 +1039,11 @@ void PilotSelect(void) { char pname[PILOT_STRING_SIZE]; Current_pilot.get_name(pname); - mprintf((0, "Pilot To Use: %s\n", pname)); + mprintf(0, "Pilot To Use: %s\n", pname); if (VerifyPilotData(&Current_pilot)) { // save out updated pilot since it had to be fixed - mprintf((0, "PILOT: Saving out Pilot info due to bad data in pilot file\n")); + mprintf(0, "PILOT: Saving out Pilot info due to bad data in pilot file\n"); PltWriteFile(&Current_pilot); } @@ -1078,10 +1078,10 @@ void PilotSelect(void) { char pname[PILOT_STRING_SIZE]; Current_pilot.get_name(pname); - mprintf((0, "Pilot To Use: %s\n", pname)); + mprintf(0, "Pilot To Use: %s\n", pname); if (VerifyPilotData(&Current_pilot)) { // save out updated pilot since it had to be fixed - mprintf((0, "PILOT: Saving out Pilot info due to bad data in pilot file\n")); + mprintf(0, "PILOT: Saving out Pilot info due to bad data in pilot file\n"); PltWriteFile(&Current_pilot); } done = true; @@ -1273,7 +1273,7 @@ bool PilotCreate(pilot *Pilot, bool forceselection) { to_ret = false; } } else { - mprintf((0, "Creating Pilot!")); + mprintf(0, "Creating Pilot!"); // call this to initialize pilot data for player. PilotInitData(Pilot); @@ -1383,7 +1383,7 @@ void PilotCopyDefaultControls(pilot *Pilot) { if (cfexist(spfilename)) { PltCopyKeyConfig(&s_pil, Pilot); } else { - mprintf((0, "%s does not exist...not copying\n", spfilename)); + mprintf(0, "%s does not exist...not copying\n", spfilename); Int3(); } } @@ -1515,7 +1515,7 @@ void NewPltUpdate(newuiListBox *list, char **flist, int filecount, int selected, if (filename && (cfexist(filename) != CFES_NOT_FOUND)) { // get the selected pilot from the filename - mprintf((0, "Looking for Pilot: %s\n", filename)); + mprintf(0, "Looking for Pilot: %s\n", filename); for (int d = 0; d < filecount; d++) { if (!stricmp(flist[d], filename)) { // ok we found the filename that they want as the pilot @@ -1542,7 +1542,7 @@ void CurrentPilotUpdateMissionStatus(bool just_add_data) { if (index == -1) { // this mission doesn't exist for the pilot yet, so add the mission to the pilot - mprintf((0, "PILOT: New Mission being added to mission data (%s)\n", Current_mission.name)); + mprintf(0, "PILOT: New Mission being added to mission data (%s)\n", Current_mission.name); mission_to_use.highest_level = 0; mission_to_use.finished = false; mission_to_use.num_restores = 0; @@ -1558,7 +1558,7 @@ void CurrentPilotUpdateMissionStatus(bool just_add_data) { } else { // this pilot has flown this mission before, just update it - mprintf((0, "PILOT: Updating previously flown mission data (%s)\n", Current_mission.name)); + mprintf(0, "PILOT: Updating previously flown mission data (%s)\n", Current_mission.name); Current_pilot.get_mission_data(index, &mission_to_use); } @@ -1791,7 +1791,7 @@ void PltReadFile(pilot *Pilot, bool keyconfig, bool missiondata) { filever = cf_ReadInt(file); cfclose(file); } catch (...) { - mprintf((0, "File exception has occured\n")); + mprintf(0, "File exception has occured\n"); Int3(); Error(TXT_MAJORPLTERROR); return; @@ -1811,7 +1811,7 @@ void PltReadFile(pilot *Pilot, bool keyconfig, bool missiondata) { try { _ReadOldPilotFile(Pilot, keyconfig, missiondata); } catch (...) { - mprintf((0, "File exception has occured\n")); + mprintf(0, "File exception has occured\n"); Int3(); Error(TXT_MAJORPLTERROR); return; @@ -1875,7 +1875,7 @@ char **PltGetPilots(int *count, char *ignore_filename, int display_default_confi if (ddio_FindFileStart(search, buffer)) { if (ignore_filename && !stricmp(ignore_filename, buffer)) { - mprintf((0, "Getting Pilots...found %s, but ignoring\n", buffer)); + mprintf(0, "Getting Pilots...found %s, but ignoring\n", buffer); } else { if (root == NULL) { root = curr = (tPGetPilotStruct *)mem_malloc(sizeof(tPGetPilotStruct)); @@ -1891,7 +1891,7 @@ char **PltGetPilots(int *count, char *ignore_filename, int display_default_confi if (curr->filename) { (*count)++; - mprintf((0, "Getting Pilots..found %s\n", buffer)); + mprintf(0, "Getting Pilots..found %s\n", buffer); } else { Error(TXT_OUTOFMEMORY); } @@ -1900,7 +1900,7 @@ char **PltGetPilots(int *count, char *ignore_filename, int display_default_confi while (ddio_FindNextFile(buffer)) { if (ignore_filename && !stricmp(ignore_filename, buffer)) { - mprintf((0, "Getting Pilots...found %s, but ignoring\n", buffer)); + mprintf(0, "Getting Pilots...found %s, but ignoring\n", buffer); } else { if (root == NULL) { root = curr = (tPGetPilotStruct *)mem_malloc(sizeof(tPGetPilotStruct)); @@ -1916,7 +1916,7 @@ char **PltGetPilots(int *count, char *ignore_filename, int display_default_confi if (curr->filename) { (*count)++; - mprintf((0, "Getting Pilots..found %s\n", buffer)); + mprintf(0, "Getting Pilots..found %s\n", buffer); } else { Error(TXT_OUTOFMEMORY); } @@ -1953,7 +1953,7 @@ char **PltGetPilots(int *count, char *ignore_filename, int display_default_confi } pltgetname_count = (*count); - mprintf((0, "Found %d pilots\n", (*count))); + mprintf(0, "Found %d pilots\n", (*count)); return pltgetname_list; } @@ -2197,7 +2197,7 @@ bool CreateCRCFileName(const char *src, char *dest) { uint32_t crc_value = cf_GetfileCRC((char *)src); if (crc_value == 0) { - mprintf((0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n")); + mprintf(0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n"); } char hex_string[10]; snprintf(hex_string, sizeof(hex_string), "_%08X", crc_value); @@ -2228,7 +2228,7 @@ bool CreateCRCFileName(const char *src, char *base, char *newfilename) { uint32_t crc_value = cf_GetfileCRC((char *)src); if (crc_value == 0) { - mprintf((0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n")); + mprintf(0, "CRC WARNING: A CRC of 0 HAS BEEN GENERATED!\n"); } char hex_string[10]; snprintf(hex_string, sizeof(hex_string), "_%08X", crc_value); @@ -2326,7 +2326,7 @@ float getdist(angle ang, float height) { bool ImportGraphic(char *pathname, char *newfile) { ASSERT(pathname); if (cfexist(pathname) != CFES_ON_DISK) { - mprintf((0, "'%s' not found\n", pathname)); + mprintf(0, "'%s' not found\n", pathname); return false; } @@ -2345,13 +2345,13 @@ bool ImportGraphic(char *pathname, char *newfile) { if (!ddio_GetTempFileName(Descent3_temp_directory, "d3i", tempfilename)) { // there was an error trying to create a temporary filename bm_FreeBitmap(bm_handle); - mprintf((0, "Error creating temp filename\n")); + mprintf(0, "Error creating temp filename\n"); return false; } // save out the file if (bm_SaveFileBitmap(tempfilename, bm_handle) == -1) { - mprintf((0, "Error importing\n")); + mprintf(0, "Error importing\n"); bm_FreeBitmap(bm_handle); return false; } @@ -2363,7 +2363,7 @@ bool ImportGraphic(char *pathname, char *newfile) { StripCRCFileName(pathname, blah); // make sure all CRC are out of the filename ddio_SplitPath(blah, NULL, filename, ext); if (!CreateCRCFileName(tempfilename, filename, p)) { - mprintf((0, "Error creating CRC File\n")); + mprintf(0, "Error creating CRC File\n"); ddio_DeleteFile(tempfilename); return false; } @@ -2377,13 +2377,13 @@ bool ImportGraphic(char *pathname, char *newfile) { // tempfilename contains old filename bm_handle = bm_AllocLoadFileBitmap(IGNORE_TABLE(tempfilename), 0); if (bm_handle <= BAD_BITMAP_HANDLE) { - mprintf((0, "Error reloading bitmap for rename\n")); + mprintf(0, "Error reloading bitmap for rename\n"); ddio_DeleteFile(tempfilename); return false; } if (bm_SaveFileBitmap(p, bm_handle) == -1) { - mprintf((0, "Error importing\n")); + mprintf(0, "Error importing\n"); bm_FreeBitmap(bm_handle); ddio_DeleteFile(tempfilename); return false; @@ -2450,7 +2450,7 @@ bool UpdateGraphicsListbox(tCustomListInfo *cust_bmps, newuiListBox *lb, char *s size += FindAllFiles("*.ogf", &cust_bmps->files[size], totalcount, &count); totalcount -= count; } else - mprintf((0, "Unable to allocate memory for %d bytes\n", totalsize)); + mprintf(0, "Unable to allocate memory for %d bytes\n", totalsize); } } @@ -2940,7 +2940,7 @@ bool PltSelectShip(pilot *Pilot) { // find the ship in the page int index = FindShipName(DEFAULT_SHIP); if (index == -1) { - mprintf((0, "WARNING: CAN'T FIND DEFAULT SHIP IN TABLE\n")); + mprintf(0, "WARNING: CAN'T FIND DEFAULT SHIP IN TABLE\n"); } else { // go through all the id's of the ships we found and find the ship (if FindShipName found it, // then we'll have it here somewhere. @@ -2954,7 +2954,7 @@ bool PltSelectShip(pilot *Pilot) { } // end else } else { // NO SHIPS IN THE TABLE!!! - mprintf((0, "WARNING: NO SHIPS IN THE TABLE!?\n")); + mprintf(0, "WARNING: NO SHIPS IN THE TABLE!?\n"); } } @@ -3036,16 +3036,16 @@ bool PltSelectShip(pilot *Pilot) { char tempn[PAGENAME_LEN]; Pilot->get_multiplayer_data(NULL, tempn); - mprintf((0, "Audio #1: '%s'\n", tempn)); + mprintf(0, "Audio #1: '%s'\n", tempn); Pilot->get_multiplayer_data(NULL, NULL, tempn); - mprintf((0, "Audio #2: '%s'\n", tempn)); + mprintf(0, "Audio #2: '%s'\n", tempn); Pilot->get_multiplayer_data(NULL, NULL, NULL, NULL, tempn); - mprintf((0, "Audio #3: '%s'\n", tempn)); + mprintf(0, "Audio #3: '%s'\n", tempn); Pilot->get_multiplayer_data(NULL, NULL, NULL, NULL, NULL, tempn); - mprintf((0, "Audio #4: '%s'\n", tempn)); + mprintf(0, "Audio #4: '%s'\n", tempn); ret = true; exit_menu = true; @@ -3132,7 +3132,7 @@ bool PltSelectShip(pilot *Pilot) { char *p = GetStringInList(index - 1, cust_snds.files, cust_snds.needed_size); if (p) { ddio_MakePath(path, LocalCustomSoundsDir, p, NULL); - mprintf((0, "Playing: %s\n", path)); + mprintf(0, "Playing: %s\n", path); bool cenable = taunt_AreEnabled(); taunt_Enable(true); taunt_PlayTauntFile(path); @@ -3148,7 +3148,7 @@ bool PltSelectShip(pilot *Pilot) { char *p = GetStringInList(index - 1, cust_snds.files, cust_snds.needed_size); if (p) { ddio_MakePath(path, LocalCustomSoundsDir, p, NULL); - mprintf((0, "Playing: %s\n", path)); + mprintf(0, "Playing: %s\n", path); bool cenable = taunt_AreEnabled(); taunt_Enable(true); taunt_PlayTauntFile(path); @@ -3164,7 +3164,7 @@ bool PltSelectShip(pilot *Pilot) { char *p = GetStringInList(index - 1, cust_snds.files, cust_snds.needed_size); if (p) { ddio_MakePath(path, LocalCustomSoundsDir, p, NULL); - mprintf((0, "Playing: %s\n", path)); + mprintf(0, "Playing: %s\n", path); bool cenable = taunt_AreEnabled(); taunt_Enable(true); taunt_PlayTauntFile(path); @@ -3181,7 +3181,7 @@ bool PltSelectShip(pilot *Pilot) { char *p = GetStringInList(index - 1, cust_snds.files, cust_snds.needed_size); if (p) { ddio_MakePath(path, LocalCustomSoundsDir, p, NULL); - mprintf((0, "Playing: %s\n", path)); + mprintf(0, "Playing: %s\n", path); bool cenable = taunt_AreEnabled(); taunt_Enable(true); taunt_PlayTauntFile(path); @@ -3211,7 +3211,7 @@ bool PltSelectShip(pilot *Pilot) { ddio_MakePath(tempfile, LocalCustomSoundsDir, filename, NULL); // import the sound - mprintf((0, "Importing: '%s'->'%s'\n", path, tempfile)); + mprintf(0, "Importing: '%s'->'%s'\n", path, tempfile); if (taunt_ImportWave(path, tempfile)) { // success @@ -3354,7 +3354,7 @@ void CustomCallBack(int c) { if (c == 0) { // None selected custom_texture[0] = '\0'; - mprintf((0, "None selected\n")); + mprintf(0, "None selected\n"); bmpwindow->SetInfo(false, -1); GameTextures[ship_pos.texture_id].flags &= ~TF_ANIMATED; GameTextures[ship_pos.texture_id].flags &= ~TF_TEXTURE_32; @@ -3381,8 +3381,7 @@ void CustomCallBack(int c) { bmpwindow->SetInfo(ship_pos.texture_type ? true : false, ship_pos.bm_handle); - mprintf( - (0, "Loaded texture (%s). Type=%d, ID=%d\n", custom_texture, ship_pos.texture_type, ship_pos.texture_id)); + mprintf(0, "Loaded texture (%s). Type=%d, ID=%d\n", custom_texture, ship_pos.texture_type, ship_pos.texture_id); } else goto load_texture_err; } @@ -3396,7 +3395,7 @@ load_texture_err: GameTextures[ship_pos.texture_id].flags |= TF_TEXTURE_64; GameTextures[ship_pos.texture_id].bm_handle = BAD_BITMAP_HANDLE; strcpy(custom_texture, ""); - mprintf((0, "Unable to load texture\n")); + mprintf(0, "Unable to load texture\n"); bmpwindow->SetInfo(false, -1); } @@ -3408,7 +3407,7 @@ void ShipSelectCallBack(int c) { float size; ship_model = Ships[lp_ship_info->idlist[c]].model_handle; if (ship_model == -1) { - mprintf((0, "ship_model is -1\n")); + mprintf(0, "ship_model is -1\n"); Int3(); } @@ -3436,7 +3435,7 @@ void ShipSelectDeleteLogo(tCustomListInfo *cust_bmps, newuiListBox *lb) { // check for None selected if (selected_index == 0) { - mprintf((0, "Listbox selected item is None\n")); + mprintf(0, "Listbox selected item is None\n"); return; } @@ -3448,7 +3447,7 @@ void ShipSelectDeleteLogo(tCustomListInfo *cust_bmps, newuiListBox *lb) { strncpy(custom_filename, p, 383); custom_filename[383] = '\0'; } else { - mprintf((0, "Listbox selected item not found\n")); + mprintf(0, "Listbox selected item not found\n"); Int3(); return; } @@ -3457,7 +3456,7 @@ void ShipSelectDeleteLogo(tCustomListInfo *cust_bmps, newuiListBox *lb) { char buffer[512]; snprintf(buffer, sizeof(buffer), TXT_PLTOKDEL, custom_logoname); if (DoMessageBox(TXT_PLTDELCONF, buffer, MSGBOX_YESNO, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL)) { - mprintf((0, "Deleting pilot logo %s (%s)\n", custom_logoname, custom_filename)); + mprintf(0, "Deleting pilot logo %s (%s)\n", custom_logoname, custom_filename); char olddir[_MAX_PATH]; ddio_GetWorkingDir(olddir, _MAX_PATH); @@ -3466,7 +3465,7 @@ void ShipSelectDeleteLogo(tCustomListInfo *cust_bmps, newuiListBox *lb) { // Update the list box, select none UpdateGraphicsListbox(cust_bmps, lb, NULL); } else { - mprintf((0, "Unable to delete file %s\n", custom_filename)); + mprintf(0, "Unable to delete file %s\n", custom_filename); Int3(); } ddio_SetWorkingDir(olddir); @@ -3486,7 +3485,7 @@ void ShipSelectDeleteTaunt(pilot *Pilot, tCustomListInfo *cust_snds, newuiComboB // check for None selected if (selected_index == 0) { - mprintf((0, "Listbox selected item is None\n")); + mprintf(0, "Listbox selected item is None\n"); return; } @@ -3498,7 +3497,7 @@ void ShipSelectDeleteTaunt(pilot *Pilot, tCustomListInfo *cust_snds, newuiComboB strncpy(custom_filename, p, 383); custom_filename[383] = '\0'; } else { - mprintf((0, "Listbox selected item not found\n")); + mprintf(0, "Listbox selected item not found\n"); Int3(); return; } @@ -3507,7 +3506,7 @@ void ShipSelectDeleteTaunt(pilot *Pilot, tCustomListInfo *cust_snds, newuiComboB char buffer[512]; snprintf(buffer, sizeof(buffer), TXT_PLTOKDEL, custom_logoname); if (DoMessageBox(TXT_PLTDELCONF, buffer, MSGBOX_YESNO, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL)) { - mprintf((0, "Deleting audio taunt %s (%s)\n", custom_logoname, custom_filename)); + mprintf(0, "Deleting audio taunt %s (%s)\n", custom_logoname, custom_filename); char olddir[_MAX_PATH]; ddio_GetWorkingDir(olddir, _MAX_PATH); @@ -3517,7 +3516,7 @@ void ShipSelectDeleteTaunt(pilot *Pilot, tCustomListInfo *cust_snds, newuiComboB UpdateAudioTauntBoxes(cust_snds, taunt_boxes->taunt_a, taunt_boxes->taunt_b, taunt_boxes->taunt_c, taunt_boxes->taunt_d, Pilot); } else { - mprintf((0, "Unable to delete file %s\n", custom_filename)); + mprintf(0, "Unable to delete file %s\n", custom_filename); Int3(); } ddio_SetWorkingDir(olddir); @@ -3539,7 +3538,7 @@ void UI3DWindow::OnDraw() { rend_SetFlatColor(0); if (ship_model == -1) { - mprintf((0, "Shipmodel is -1\n")); + mprintf(0, "Shipmodel is -1\n"); return; } @@ -3714,7 +3713,7 @@ void ShowPilotPicDialogListCallback(int index) { if (index <= PPicDlgInfo.size) { int handle = PPic_GetBitmapHandle(PPicDlgInfo.id_list[index - 1]); if (handle <= BAD_BITMAP_HANDLE) { - mprintf((0, "Couldn't get ID#%d's bitmap\n", PPicDlgInfo.id_list[index - 1])); + mprintf(0, "Couldn't get ID#%d's bitmap\n", PPicDlgInfo.id_list[index - 1]); Int3(); PPicDlgInfo.curr_bmp = PPicDlgInfo.blank_bmp; new_idx = 0; @@ -3722,7 +3721,7 @@ void ShowPilotPicDialogListCallback(int index) { PPicDlgInfo.curr_bmp = handle; } } else { - mprintf((0, "Invalid index\n")); + mprintf(0, "Invalid index\n"); Int3(); PPicDlgInfo.curr_bmp = PPicDlgInfo.blank_bmp; new_idx = 0; @@ -3757,7 +3756,7 @@ void ShowPilotPicDialog(pilot *Pilot) { // only display the dialog if there is a pilot to choose from if (num_pilots == 0) { - mprintf((0, "No Pilot Pics available for %s\n", pname)); + mprintf(0, "No Pilot Pics available for %s\n", pname); uint16_t pid; pid = PPIC_INVALID_ID; Pilot->set_multiplayer_data(NULL, NULL, NULL, &pid); @@ -3772,7 +3771,7 @@ void ShowPilotPicDialog(pilot *Pilot) { pid = PPIC_INVALID_ID; Pilot->set_multiplayer_data(NULL, NULL, NULL, &pid); - mprintf((0, "Couldn't alloc bitmap\n")); + mprintf(0, "Couldn't alloc bitmap\n"); DoMessageBox(TXT_ERROR, TXT_ERRCREATINGDIALOG, MSGBOX_OK, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL); return; } @@ -3813,7 +3812,7 @@ void ShowPilotPicDialog(pilot *Pilot) { if (!id_list) { // out of memory - mprintf((0, "Out of memory\n")); + mprintf(0, "Out of memory\n"); goto clean_up; } diff --git a/Descent3/pilot_class.cpp b/Descent3/pilot_class.cpp index 66f49f2a..a83fd2e4 100644 --- a/Descent3/pilot_class.cpp +++ b/Descent3/pilot_class.cpp @@ -426,7 +426,7 @@ int pilot::flush(bool new_file) { if (new_file && cfexist(real_filename)) { // the file already exists, we can't write out - mprintf((0, "PLTW: File (%s) exists, can't create\n", real_filename)); + mprintf(0, "PLTW: File (%s) exists, can't create\n", real_filename); return PLTW_FILE_EXISTS; } @@ -435,7 +435,7 @@ int pilot::flush(bool new_file) { file = cfopen(real_filename, "wb"); if (!file) { - mprintf((0, "PLTW: File (%s) can't be opened\n", real_filename)); + mprintf(0, "PLTW: File (%s) can't be opened\n", real_filename); return PLTW_FILE_CANTOPEN; } @@ -461,22 +461,22 @@ int pilot::flush(bool new_file) { } catch (cfile_error) { // catch and handle CFILE errors - mprintf((0, "PLTW: CFILE Exception writing data\n")); + mprintf(0, "PLTW: CFILE Exception writing data\n"); Int3(); try { cfclose(file); } catch (...) { - mprintf((0, "PLTW: Unable to close file due to exception\n")); + mprintf(0, "PLTW: Unable to close file due to exception\n"); } return PLTW_CFILE_FATAL; } catch (...) { // catch all errors - mprintf((0, "PLTW: Unknown exception writing data\n")); + mprintf(0, "PLTW: Unknown exception writing data\n"); Int3(); try { cfclose(file); } catch (...) { - mprintf((0, "PLTW: Unable to close file due to exception\n")); + mprintf(0, "PLTW: Unable to close file due to exception\n"); } return PLTW_UNKNOWN_FATAL; } @@ -520,14 +520,14 @@ int pilot::read(bool skip_config, bool skip_mission_data) { if (!cfexist(real_filename)) { // the file already exists, we can't write out - mprintf((0, "PLTR: File (%s) does not exist\n", real_filename)); + mprintf(0, "PLTR: File (%s) does not exist\n", real_filename); return PLTR_FILE_NOEXIST; } try { file = cfopen(real_filename, "rb"); if (!file) { - mprintf((0, "PLTR: File (%s) can't be opened\n", real_filename)); + mprintf(0, "PLTR: File (%s) can't be opened\n", real_filename); return PLTR_FILE_CANTOPEN; } @@ -588,23 +588,23 @@ int pilot::read(bool skip_config, bool skip_mission_data) { cfclose(file); } catch (cfile_error) { // catch and handle CFILE errors - mprintf((0, "PLTR: CFILE Exception reading data\n")); + mprintf(0, "PLTR: CFILE Exception reading data\n"); Int3(); try { cfclose(file); } catch (...) { - mprintf((0, "PLTR: Unable to close file due to exception\n")); + mprintf(0, "PLTR: Unable to close file due to exception\n"); } verify(); return PLTR_CFILE_FATAL; } catch (...) { // catch all errors - mprintf((0, "PLTR: Unknown exception reading data\n")); + mprintf(0, "PLTR: Unknown exception reading data\n"); Int3(); try { cfclose(file); } catch (...) { - mprintf((0, "PLTR: Unable to close file due to exception\n")); + mprintf(0, "PLTR: Unable to close file due to exception\n"); } verify(); return PLTR_UNKNOWN_FATAL; @@ -858,7 +858,7 @@ void pilot::set_hud_data(uint8_t *hmode, uint16_t *hstat, uint16_t *hgraphicalst write_pending = true; break; default: - mprintf((0, "PILOT: Trying to set hode mode to invalid mode (%d)\n", *hmode)); + mprintf(0, "PILOT: Trying to set hode mode to invalid mode (%d)\n", *hmode); } } @@ -912,15 +912,15 @@ void pilot::add_mission_data(tMissionData *mdata) { if (find_mission_data(mdata->mission_name) != -1) { Int3(); - mprintf((0, "Mission already exists\n")); + mprintf(0, "Mission already exists\n"); return; } - mprintf((0, "Adding new mission data for (%s)\n", mdata->mission_name)); + mprintf(0, "Adding new mission data for (%s)\n", mdata->mission_name); tMissionData *new_data = (tMissionData *)mem_malloc((num_missions_flown + 1) * sizeof(tMissionData)); if (!new_data) { - mprintf((0, "Out of memory\n")); + mprintf(0, "Out of memory\n"); return; } @@ -939,14 +939,14 @@ void pilot::add_mission_data(tMissionData *mdata) { } void pilot::edit_mission_data(int index, tMissionData *mdata) { if (index < 0 || index >= num_missions_flown) { - mprintf((0, "Invalid mission index\n")); + mprintf(0, "Invalid mission index\n"); Int3(); return; } if (!mission_data) { Int3(); - mprintf((0, "No mission data\n")); + mprintf(0, "No mission data\n"); return; } @@ -960,14 +960,14 @@ void pilot::edit_mission_data(int index, tMissionData *mdata) { void pilot::get_mission_data(int index, tMissionData *mdata) { if (index < 0 || index >= num_missions_flown) { - mprintf((0, "Invalid mission index\n")); + mprintf(0, "Invalid mission index\n"); Int3(); return; } if (!mission_data) { Int3(); - mprintf((0, "No mission data\n")); + mprintf(0, "No mission data\n"); return; } @@ -1384,7 +1384,7 @@ void pilot::write_controls(CFILE *file) { cf_WriteByte(file, N_MOUSE_AXIS); for (i = 0; i < N_MOUSE_AXIS; i++) { cf_WriteFloat(file, mouse_sensitivity[i]); - mprintf((0, "pilot mousesens[%d]=%f\n", i, mouse_sensitivity[i])); + mprintf(0, "pilot mousesens[%d]=%f\n", i, mouse_sensitivity[i]); } cf_WriteByte(file, N_JOY_AXIS); @@ -1457,7 +1457,7 @@ void pilot::read_controls(CFILE *file, bool skip) { for (i = 0; i < temp_b; i++) { temp_f = cf_ReadFloat(file); mouse_sensitivity[i] = temp_f; - mprintf((0, "pilot mousesens[%d]=%f\n", i, mouse_sensitivity[i])); + mprintf(0, "pilot mousesens[%d]=%f\n", i, mouse_sensitivity[i]); } for (; i < N_MOUSE_AXIS; i++) { mouse_sensitivity[i] = 1.0f; diff --git a/Descent3/procedurals.cpp b/Descent3/procedurals.cpp index a6f08b92..0b5532fe 100644 --- a/Descent3/procedurals.cpp +++ b/Descent3/procedurals.cpp @@ -157,7 +157,7 @@ void InitProcedurals() { // Load easter egg bitmap Easter_egg_handle = bm_AllocLoadFileBitmap("FreakyEye.ogf", 0); if (Easter_egg_handle == -1) { - mprintf((0, "Failed to load easter egg!\n")); + mprintf(0, "Failed to load easter egg!\n"); } for (i = 0; i < MAX_PROC_ELEMENTS; i++) { DynamicProcElements[i].type = PROC_NONE; @@ -240,7 +240,7 @@ void InitProcedurals() { int g=((WaterProcTableHi[i][127]>>5) & 0x1f); g+=((WaterProcTableLo[i][255]>>5) & 0x1f); int b=(WaterProcTableLo[i][255]) & 0x1f; - mprintf ((0,"index=%d r=%d g=%d b=%d\n",i,r,g,b)); + mprintf(0,"index=%d r=%d g=%d b=%d\n",i,r,g,b); }*/ // Init our default palette for (i = 0; i < 128; i++) { @@ -254,7 +254,7 @@ void InitProcedurals() { // Returns the next free procelement int ProcElementAllocate() { if (Num_proc_elements == MAX_PROC_ELEMENTS) { - // mprintf ((0,"Couldn't allocate proc element!\n")); + // mprintf(0,"Couldn't allocate proc element!\n"); return -1; } @@ -1352,7 +1352,7 @@ void EvaluateProcedural(int handle) { int dest_bitmap = procedural->procedural_bitmap; if (bm_w(dest_bitmap, 0) != PROC_SIZE) { - mprintf((0, "Couldn't evaluate procedural because its not %d x %d!\n", PROC_SIZE, PROC_SIZE)); + mprintf(0, "Couldn't evaluate procedural because its not %d x %d!\n", PROC_SIZE, PROC_SIZE); return; } if (GameTextures[handle].flags & TF_WATER_PROCEDURAL) diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 8a80535d..3674bee0 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -758,7 +758,7 @@ void CheckFogPortalExtents(int roomnum, int portalnum) { if (found_room == -1) { // Couldn't find this room in our list, so make a new one if (Num_fogged_rooms_this_frame >= MAX_FOGGED_ROOMS_PER_FRAME) { - mprintf((0, "Too many fogged rooms in view cone!\n")); + mprintf(0, "Too many fogged rooms in view cone!\n"); return; } @@ -1136,7 +1136,7 @@ void BuildRoomList(int start_room_num) { wnd.right = Render_width; wnd.bot = Render_height; BuildRoomListSub(start_room_num, &wnd, 0); -// mprintf((0,"N_render_rooms = %d ",N_render_rooms)); +// mprintf(0,"N_render_rooms = %d ",N_render_rooms); #ifdef EDITOR // Add all external rooms to render list if that flag set if (Editor_view_mode == VM_MINE && In_editor_mode) { @@ -3661,7 +3661,7 @@ void SortStates(state_limited_element *state_array, int cellcount) { // Builds a list of mirror faces for each room and allocs memory accordingly void ConsolidateMineMirrors() { int i, t; - mprintf((0, "Consolidating mine mirrors!\n")); + mprintf(0, "Consolidating mine mirrors!\n"); for (i = 0; i < MAX_ROOMS; i++) { room *rp = &Rooms[i]; if (!rp->used) diff --git a/Descent3/renderobject.cpp b/Descent3/renderobject.cpp index e115662f..45cf5a21 100644 --- a/Descent3/renderobject.cpp +++ b/Descent3/renderobject.cpp @@ -726,7 +726,7 @@ static void DrawNumber(int num, vector pos, float size, ddgr_color c1) { } int num_numbers = (int)(log10f((float)num) + 1); if (num_numbers > 10) { - mprintf((0, "Cannot represent a number with over 10 digits\n")); + mprintf(0, "Cannot represent a number with over 10 digits\n"); Int3(); return; } @@ -1207,7 +1207,7 @@ void RenderObject(object *obj) { float normalized_time[MAX_SUBOBJECTS]; bool render_it = false; if (obj->type == OBJ_NONE) { - mprintf((1, "ERROR!!!! Bogus obj %d in room %d is rendering!\n", OBJNUM(obj), obj->roomnum)); + mprintf(1, "ERROR!!!! Bogus obj %d in room %d is rendering!\n", OBJNUM(obj), obj->roomnum); Int3(); return; } @@ -1447,7 +1447,7 @@ void RenderObject(object *obj) { if (rend_GetPixel(TSearch_x, TSearch_y) != oldcolor) { TSearch_found_type = TSEARCH_FOUND_OBJECT; TSearch_seg = obj - Objects; - mprintf((0, "TR:objnum=%d\n", obj - Objects)); + mprintf(0, "TR:objnum=%d\n", obj - Objects); } } #endif diff --git a/Descent3/robotfire.cpp b/Descent3/robotfire.cpp index a0b1c166..87b6fa92 100644 --- a/Descent3/robotfire.cpp +++ b/Descent3/robotfire.cpp @@ -52,7 +52,7 @@ void FireOnOffWeapon(object *objp) { } else if (objp->ai_info) { char wb_index = objp->ai_info->last_special_wb_firing; if (wb_index > MAX_WBS_PER_OBJ) { // DAJ - mprintf((2, "FireOnOffWeapon wb_index %d > MAX_WBS_PER_OBJ\n", wb_index)); + mprintf(2, "FireOnOffWeapon wb_index %d > MAX_WBS_PER_OBJ\n", wb_index); return; } diff --git a/Descent3/room.cpp b/Descent3/room.cpp index 3d686091..18461934 100644 --- a/Descent3/room.cpp +++ b/Descent3/room.cpp @@ -709,10 +709,10 @@ void FreeRoom(room *rp) { void FreeAllRooms() { int rn; room *rp; - mprintf((1, "Freeing rooms...Higest_room_index %d\n", Highest_room_index)); + mprintf(1, "Freeing rooms...Higest_room_index %d\n", Highest_room_index); for (rn = 0, rp = Rooms; rn <= Highest_room_index; rn++, rp++) { if (rp->used) { - // mprintf((2, "rn %d\n", rn)); + // mprintf(2, "rn %d\n", rn); FreeRoom(rp); } } @@ -721,7 +721,7 @@ void FreeAllRooms() { RoomMemClose(); - // mprintf((2,"Done\n")); + // mprintf(2,"Done\n"); } #ifdef EDITOR @@ -799,7 +799,7 @@ bool ComputeFaceNormal(room *rp, int facenum) { ok = ComputeNormal(&fp->normal, fp->num_verts, fp->face_verts, rp->verts); if (!ok) { - mprintf((1, "Warning: Low precision normal for room:face = %d:%d\n", ROOMNUM(rp), facenum)); + mprintf(1, "Warning: Low precision normal for room:face = %d:%d\n", ROOMNUM(rp), facenum); } return ok; @@ -835,8 +835,11 @@ bool ComputeNormal(vector *normal, int num_verts, short *vertnum_list, vector *v } if (largest_mag < MIN_NORMAL_MAG) { - mprintf((1, "Warning: Normal has low precision. mag = %f, norm = %f,%f,%f\n", largest_mag, normal->x, normal->y, - normal->z)); + mprintf(1, "Warning: Normal has low precision. mag = %f, norm = %f,%f,%f\n", + largest_mag, + normal->x, + normal->y, + normal->z); return 0; } else return 1; @@ -1233,7 +1236,7 @@ int FindFirstUsedRoom() { // returns true on successs bool ChangeRoomFaceTexture(int room_num, int face_num, int texture) { if ((room_num < 0) || (room_num > Highest_room_index) || ROOMNUM_OUTSIDE(room_num) || (!Rooms[room_num].used)) { - mprintf((0, "Invalid room passed to ChangeRoomFaceTexture\n")); + mprintf(0, "Invalid room passed to ChangeRoomFaceTexture\n"); Int3(); return false; } @@ -1241,16 +1244,15 @@ bool ChangeRoomFaceTexture(int room_num, int face_num, int texture) { room *rp = &Rooms[room_num]; if (face_num < 0 || face_num >= rp->num_faces) { - mprintf((0, - "Invalid face number passed to ChangeRoomFaceTexture. Room=%d, you gave face #%d, there are only %d in " - "the room\n", - room_num, face_num, rp->num_faces)); + mprintf(0, "Invalid face number passed to ChangeRoomFaceTexture." + " Room=%d, you gave face #%d, there are only %d in the room\n", + room_num, face_num, rp->num_faces); Int3(); return false; } if (texture == -1) { - mprintf((0, "not a valid texture, passed to ChangeRoomFaceTexture\n")); + mprintf(0, "not a valid texture, passed to ChangeRoomFaceTexture\n"); Int3(); return false; } diff --git a/Descent3/scorch.cpp b/Descent3/scorch.cpp index ec9c7d94..9bccd7b0 100644 --- a/Descent3/scorch.cpp +++ b/Descent3/scorch.cpp @@ -149,7 +149,7 @@ void DeleteScorch(int index) { scorch *sp; int i; - // mprintf((0,"Deleting scorch %d\n",index)); + // mprintf(0,"Deleting scorch %d\n",index); // Look through all the scorches to see if there are other scorches on the same face for (i = Scorch_start, sp = &Scorches[Scorch_start];;) { @@ -171,7 +171,7 @@ void DeleteScorch(int index) { // If we're here, there are no other scorches on the face, so clear the flag Rooms[RF_ROOM(roomface)].faces[RF_FACE(roomface)].flags &= ~FF_SCORCHED; - // mprintf((0,"Clearing scorch flag from %d:%d\n",RF_ROOM(roomface),RF_FACE(roomface))); + // mprintf(0,"Clearing scorch flag from %d:%d\n",RF_ROOM(roomface),RF_FACE(roomface)); } // Add a scorch mark diff --git a/Descent3/screens.cpp b/Descent3/screens.cpp index af6c70f9..d7845506 100644 --- a/Descent3/screens.cpp +++ b/Descent3/screens.cpp @@ -600,7 +600,7 @@ void PaintPLRSinglePlayerText() { if (all_done_painting) { if (paint_in_sound_handle != -1) { - mprintf((0, "Stopping paint in sound\n")); + mprintf(0, "Stopping paint in sound\n"); Sound_system.StopSoundImmediate(paint_in_sound_handle); paint_in_sound_handle = -1; } diff --git a/Descent3/spew.cpp b/Descent3/spew.cpp index 7a45f5dc..3f04ef1d 100644 --- a/Descent3/spew.cpp +++ b/Descent3/spew.cpp @@ -153,14 +153,14 @@ bool SpewObjectNeedsEveryFrameUpdate(object *obj, int gunpoint); // Initializes the Spew system void SpewInit() { - mprintf((0, "Initializing Spew System\n")); + mprintf(0, "Initializing Spew System\n"); int count; spew_count = 0; for (count = 0; count < MAX_SPEW_EFFECTS; count++) { SpewClearEvent(count, true); } - mprintf((0, "Done Initializing Spew System\n")); + mprintf(0, "Done Initializing Spew System\n"); } // Creates a Spew effect @@ -251,7 +251,7 @@ int SpewCreate(spewinfo *spew) { veffect->start_time = Gametime; - // mprintf((0,"Creating Spew Effect (%d)\n",veffect->handle)); + // mprintf(0,"Creating Spew Effect (%d)\n",veffect->handle); return veffect->handle; // return the handle } @@ -395,7 +395,7 @@ void SpewEmitAll(void) { } else { vector vel_vector; - // mprintf((0,"Emitting Point based Spew %d\n",count)); + // mprintf(0,"Emitting Point based Spew %d\n",count); // calc velocity vector vel_vector = spew->pt.normal * speed; @@ -411,8 +411,11 @@ void SpewEmitAll(void) { } // end while if (num_spewed == 0) { - mprintf((0, "Max spews per frame hit! Handle=%d Interval=%f Lifetime=%f Longevity=%f\n", spew->handle, - spew->time_int, spew->lifetime, spew->longevity)); + mprintf(0, "Max spews per frame hit! Handle=%d Interval=%f Lifetime=%f Longevity=%f\n", + spew->handle, + spew->time_int, + spew->lifetime, + spew->longevity); spew->time_until_next_blob = spew->time_int; } @@ -435,14 +438,14 @@ void SpewClearEvent(int handle, bool force) { if ((slot < 0) || (slot > MAX_SPEW_EFFECTS)) return; - // mprintf((0,"Clearing spew event %d - %d....",handle,slot)); + // mprintf(0,"Clearing spew event %d - %d....",handle,slot); vis = &SpewEffects[slot]; if ((!force) && (handle != vis->handle)) return; - // mprintf((0,"handle OK\n")); + // mprintf(0,"handle OK\n"); vis->inuse = vis->random = vis->use_gunpoint = vis->real_obj = false; vis->pt.origin.x = vis->pt.origin.y = vis->pt.origin.z = 0.0f; diff --git a/Descent3/subtitles.cpp b/Descent3/subtitles.cpp index c011995b..550fe8d8 100644 --- a/Descent3/subtitles.cpp +++ b/Descent3/subtitles.cpp @@ -176,13 +176,13 @@ void SubtParseSubtitles(CFILE *file) { // starting frame number p = parse_int(p, &first_frame); if (!p) { - mprintf((0, "Couldn't parse first_frame\n")); + mprintf(0, "Couldn't parse first_frame\n"); goto subt_parse_error; } p = parse_int(p, &last_frame); if (!p) { - mprintf((0, "Couldn't parse last_frame\n")); + mprintf(0, "Couldn't parse last_frame\n"); goto subt_parse_error; } @@ -201,7 +201,7 @@ void SubtParseSubtitles(CFILE *file) { } return; subt_parse_error: - mprintf((0, "Error Parsing SubTitle File!\n")); + mprintf(0, "Error Parsing SubTitle File!\n"); SubtResetSubTitles(); } @@ -250,11 +250,11 @@ void SubtInitSubtitles(const char *filename) { ddio_MakePath(subtitle_path, LocalD3Dir, "movies", subtitle_file, NULL); - mprintf((0, "Looking for the subtitle file %s\n", subtitle_path)); + mprintf(0, "Looking for the subtitle file %s\n", subtitle_path); ifile = cfopen(subtitle_path, "rt"); if (!ifile) { - mprintf((0, "Movie: Couldn't find subtitle file %s\n", subtitle_path)); + mprintf(0, "Movie: Couldn't find subtitle file %s\n", subtitle_path); return; } diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index 5342692b..494ac30c 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -311,7 +311,7 @@ void BuildMinMaxTerrain() { int row_width, xoffset, yoffset, total_rows; int minheight, maxheight, cellheight; - mprintf((0, "Building min/max terrain table.\n")); + mprintf(0, "Building min/max terrain table.\n"); // Calculate our integer y positions (0-255) for (i = 0; i < TERRAIN_WIDTH * TERRAIN_DEPTH; i++) { @@ -821,7 +821,7 @@ int LoadPCXTerrain(char *filename) { lando = (uint8_t *)mem_malloc(total); - mprintf((0, "Heightmap is %d x %d\n", width, height)); + mprintf(0, "Heightmap is %d x %d\n", width, height); while (run < total) { buf = cf_ReadByte(infile); diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index b54275e4..2f9b3978 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -1432,7 +1432,7 @@ void RenderTerrain(uint8_t from_mine, int left, int top, int right, int bot) { RenderAllTerrainObjects(); } - mprintf_at((2, 5, 0, "Objs Drawn=%5d", Terrain_objects_drawn)); + mprintf_at(2, 5, 0, "Objs Drawn=%5d", Terrain_objects_drawn); Last_terrain_render_time = Gametime; } @@ -2706,9 +2706,9 @@ void DisplayTerrainList(int cellcount, bool from_automap) { rend_SetOverlayType(OT_NONE); rend_SetWrapType(WT_WRAP); - mprintf_at((2, 1, 0, "%5d cells", cellcount)); - mprintf_at((2, 2, 0, "%5d trans", GlobalTransCount)); - mprintf_at((2, 3, 0, "Tdepth=%5d", TotalDepth)); + mprintf_at(2, 1, 0, "%5d cells", cellcount); + mprintf_at(2, 2, 0, "%5d trans", GlobalTransCount); + mprintf_at(2, 3, 0, "Tdepth=%5d", TotalDepth); } // Arrays for drawing static int src[256]; diff --git a/Descent3/trigger.cpp b/Descent3/trigger.cpp index a43efc15..dd9762fb 100644 --- a/Descent3/trigger.cpp +++ b/Descent3/trigger.cpp @@ -241,7 +241,7 @@ void CheckTrigger(int roomnum, int facenum, object *objp, int event_type) { // Check if this object is a valid activator for this trigger if (tp->activator & type) { - mprintf((0, "Hit trigger %d\n", tp - Triggers)); + mprintf(0, "Hit trigger %d\n", tp - Triggers); // Execute this trigger's script tOSIRISEventInfo ei; diff --git a/Descent3/vclip.cpp b/Descent3/vclip.cpp index b393b1da..b92fc3e6 100644 --- a/Descent3/vclip.cpp +++ b/Descent3/vclip.cpp @@ -178,7 +178,7 @@ int Num_vclips = 0; #define VCLIP_VERSION 1 // Frees all the memory used by vclips void FreeAllVClips() { - mprintf((0, "Freeing all vclips!\n")); + mprintf(0, "Freeing all vclips!\n"); for (int i = 0; i < MAX_VCLIPS; i++) { if (GameVClips[i].used > 0) { @@ -250,7 +250,7 @@ int SaveVClip(const char *filename, int num) { outfile = (CFILE *)cfopen(filename, "wb"); if (!outfile) { - mprintf((0, "Couldn't save vclip %s!\n", filename)); + mprintf(0, "Couldn't save vclip %s!\n", filename); return 0; } @@ -267,7 +267,7 @@ int SaveVClip(const char *filename, int num) { // Now save each frame of this vclip for (int i = 0; i < vc->num_frames; i++) { if (bm_SaveBitmap(outfile, vc->frames[i]) != 1) { - mprintf((0, "Couldn't save frame %d of vclip %s!\n", i, filename)); + mprintf(0, "Couldn't save frame %d of vclip %s!\n", i, filename); Int3(); cfclose(outfile); return 0; @@ -301,7 +301,7 @@ void PageInVClip(int vcnum) { while ((end_ptr >= start_ptr) && (*end_ptr != '\\')) end_ptr--; if (end_ptr < start_ptr) { - mprintf((0, "Couldn't load vclip %s!\n", vc->name)); + mprintf(0, "Couldn't load vclip %s!\n", vc->name); return; } @@ -310,12 +310,12 @@ void PageInVClip(int vcnum) { infile = (CFILE *)cfopen(end_ptr, "rb"); if (!infile) { - mprintf((0, "Couldn't load vclip %s!\n", vc->name)); + mprintf(0, "Couldn't load vclip %s!\n", vc->name); return; } } - mprintf((0, "Paging in vclip %s!\n", vc->name)); + mprintf(0, "Paging in vclip %s!\n", vc->name); uint8_t start_val = cf_ReadByte(infile); int version = 0; @@ -428,7 +428,7 @@ int AllocLoadVClip(const char *filename, int texture_size, int mipped, int pagea return i; } - // mprintf ((0,"Loading OAF vclip %s\n",name)); + // mprintf(0,"Loading OAF vclip %s\n",name); int vcnum = AllocVClip(); @@ -474,11 +474,11 @@ int AllocLoadIFLVClip(const char *filename, int texture_size, int mipped, int fo infile = (CFILE *)cfopen(filename, "rt"); if (!infile) { - mprintf((0, "Couldn't load IFL vclip %s!\n", filename)); + mprintf(0, "Couldn't load IFL vclip %s!\n", filename); return -1; } - mprintf((0, "Loading IFL vclip %s\n", name)); + mprintf(0, "Loading IFL vclip %s\n", name); int vcnum = AllocVClip(); @@ -595,7 +595,7 @@ int AllocLoadIFLVClip(const char *filename, int texture_size, int mipped, int fo cfclose(infile); if (vc->num_frames == 0) { - mprintf((0, "vclip had no valid bitmap names!\n")); + mprintf(0, "vclip had no valid bitmap names!\n"); FreeVClip(vcnum); return -1; } diff --git a/Descent3/viseffect.cpp b/Descent3/viseffect.cpp index 38fe21cf..3fb40e6d 100644 --- a/Descent3/viseffect.cpp +++ b/Descent3/viseffect.cpp @@ -519,7 +519,7 @@ void InitVisEffects() { // Returns the next free viseffect int VisEffectAllocate() { if (Num_vis_effects == max_vis_effects) { - mprintf((0, "Couldn't allocate vis effect!\n")); + mprintf(0, "Couldn't allocate vis effect!\n"); return -1; } @@ -703,7 +703,7 @@ int VisEffectCreateControlled(uint8_t type, object *parent, uint8_t id, int room vis->velocity = *velocity; // float mag=vm_GetMagnitudeFast (&vis->velocity); - // mprintf ((0,"CREATION:Velocity mag is %f\n",mag)); + // mprintf(0,"CREATION:Velocity mag is %f\n",mag); if (phys_flags) vis->phys_flags = phys_flags; @@ -2161,7 +2161,7 @@ void VisEffectMoveOne(vis_effect *vis) { if (cellnum >= 0 && cellnum < TERRAIN_WIDTH * TERRAIN_DEPTH) ApplyLightingToTerrain(&vis->pos, cellnum, vis->size * scalar * 3, r, g, b); else - mprintf((0, "Vis effect not in world!\n")); + mprintf(0, "Vis effect not in world!\n"); } else { if (vis->roomnum >= 0 && vis->roomnum <= Highest_room_index && Rooms[vis->roomnum].used) ApplyLightingToRooms(&vis->pos, vis->roomnum, vis->size * scalar * 3, r, g, b); diff --git a/Descent3/voice.cpp b/Descent3/voice.cpp index 6937788a..9d86efca 100644 --- a/Descent3/voice.cpp +++ b/Descent3/voice.cpp @@ -104,7 +104,7 @@ VoiceQueue vq; void StartVoice(char *filename, int flags); bool InitVoices(void) { - mprintf((0, "Voice System: Init\n")); + mprintf(0, "Voice System: Init\n"); CurrentVoiceHandle.handle = -1; CurrentVoiceHandle.flags = 0; CurrentVoiceHandle.chandle = -1; @@ -116,7 +116,7 @@ bool InitVoices(void) { } void CloseVoices(void) { - mprintf((0, "Voice System: Shutdown\n")); + mprintf(0, "Voice System: Shutdown\n"); StopVoice(); } @@ -200,7 +200,7 @@ void UpdateVoices(void) { if (!CurrentVoiceHandle.inuse) { // see if we have something waiting if (vq.GetNextVoice(filename, &flags)) { - mprintf((0, "Playing queued voice %s\n", filename)); + mprintf(0, "Playing queued voice %s\n", filename); StartVoice(filename, flags); return; } @@ -214,7 +214,7 @@ void UpdateVoices(void) { // it isn't, so stop it and play the next voice in the queue if any StopVoice(); if (vq.GetNextVoice(filename, &flags)) { - mprintf((0, "Playing queued voice %s\n", filename)); + mprintf(0, "Playing queued voice %s\n", filename); StartVoice(filename, flags); } } @@ -249,7 +249,7 @@ void VoiceQueue::AddVoice(char *fn, int flg) { int nextpos = (pos + 1) % QUEUE_SIZE; if ((nextpos == currvoice + 1) && (inuse[nextpos])) { // this really shouldn't be since it was reported that the queue isn't full - mprintf((0, "Voice Queue full, missed full bool (this shouldn't happen)\n")); + mprintf(0, "Voice Queue full, missed full bool (this shouldn't happen)\n"); // since the queue is full, remove everything and add just the "mother load" voice Clear(); pos = 1; @@ -317,7 +317,7 @@ void VoiceQueue::Clear(bool onlypowerups) { if (realp == QUEUE_SIZE) { // we're still full :( full = true; - mprintf((0, "Voice Warning: Buffer still full after clean (All Non-powerups voices in queue?)\n")); + mprintf(0, "Voice Warning: Buffer still full after clean (All Non-powerups voices in queue?)\n"); } } else { motherloadat = -1; diff --git a/Descent3/weapon.cpp b/Descent3/weapon.cpp index d8852b7c..cb845942 100644 --- a/Descent3/weapon.cpp +++ b/Descent3/weapon.cpp @@ -1230,7 +1230,7 @@ int SwitchPlayerWeapon(int weapon_type) { ? (((wpn_index - SECONDARY_INDEX) % NUM_SECONDARY_SLOTS) + NUM_PRIMARY_SLOTS) : (wpn_index % NUM_PRIMARY_SLOTS); - // mprintf((0, "wpn_index = %d\n", wpn_index)); + // mprintf(0, "wpn_index = %d\n", wpn_index); if ((Players[Player_num].weapon_flags & HAS_FLAG(wpn_index)) && !(sel_list[new_index] & WPNSEL_SKIP)) { @@ -1253,7 +1253,7 @@ int SwitchPlayerWeapon(int weapon_type) { } new_index++; - // mprintf((0, "new_index = %d\n", new_index)); + // mprintf(0, "new_index = %d\n", new_index); } } diff --git a/Descent3/winmain.cpp b/Descent3/winmain.cpp index ab3b11ae..af2b4398 100644 --- a/Descent3/winmain.cpp +++ b/Descent3/winmain.cpp @@ -436,10 +436,10 @@ bool Win32SystemCheck(HINSTANCE hInst) { } if ((!SupportsKatmai()) || FindArg("-nopentium3")) { - mprintf((0, "No Katmai detected.\n")); + mprintf(0, "No Katmai detected.\n"); Katmai = false; } else { - mprintf((0, "Katmai detected!\n")); + mprintf(0, "Katmai detected!\n"); Katmai = true; } diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index 276ffc41..a3cfef8b 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -472,7 +472,7 @@ void bm_InitBitmaps() { } void bm_ShutdownBitmaps(void) { int i; - mprintf((0, "Freeing all bitmap memory.\n")); + mprintf(0, "Freeing all bitmap memory.\n"); bm_FreeBitmapMain(0); for (i = 0; i < MAX_BITMAPS; i++) { while (GameBitmaps[i].used > 0) @@ -514,7 +514,7 @@ int bm_AllocBitmap(int w, int h, int add_mem) { int n, i; if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return -1; } @@ -527,7 +527,7 @@ int bm_AllocBitmap(int w, int h, int add_mem) { // If we can't find a free slot in which to alloc, bail out if (i == MAX_BITMAPS) { Int3(); - mprintf((0, "ERROR! Couldn't find a free bitmap to alloc!\n")); + mprintf(0, "ERROR! Couldn't find a free bitmap to alloc!\n"); return -1; } memset(&GameBitmaps[n], 0, sizeof(bms_bitmap)); @@ -543,7 +543,7 @@ int bm_AllocNoMemBitmap(int w, int h) { int n, i; if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return -1; } @@ -556,7 +556,7 @@ int bm_AllocNoMemBitmap(int w, int h) { // If we can't find a free slot in which to alloc, bail out if (i == MAX_BITMAPS) { Int3(); - mprintf((0, "ERROR! Couldn't find a free bitmap to alloc!\n")); + mprintf(0, "ERROR! Couldn't find a free bitmap to alloc!\n"); return -1; } // If no go on the malloc, bail out with -1 @@ -582,7 +582,7 @@ int bm_FindBitmapName(const char *name) { strcpy(fbmp.name, name); bm_Node *fnode = bm_findNode(&fbmp); if (fnode) { - // mprintf((0,"Hash table found bitmap %d\n",fnode->data - GameBitmaps)); + // mprintf(0,"Hash table found bitmap %d\n",fnode->data - GameBitmaps); return fnode->data - GameBitmaps; } else return -1; @@ -591,7 +591,7 @@ int bm_FindBitmapName(const char *name) { void bm_FreeBitmap(int handle) { if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return; } if (handle == BAD_BITMAP_HANDLE) @@ -703,7 +703,7 @@ int bm_AllocLoadFileBitmap(const char *fname, int mipped, int format) { CFILE *infile; if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return -1; } @@ -724,19 +724,19 @@ int bm_AllocLoadFileBitmap(const char *fname, int mipped, int format) { while ((end_ptr >= start_ptr) && (*end_ptr != '\\')) end_ptr--; if (end_ptr < start_ptr) { - mprintf((0, "Unable to find bitmap %s\n", fname)); + mprintf(0, "Unable to find bitmap %s\n", fname); return -1; } ASSERT(*end_ptr == '\\'); end_ptr++; filename = end_ptr; - mprintf((0, "Couldn't find %s, so gonna try %s\n", fname, filename)); + mprintf(0, "Couldn't find %s, so gonna try %s\n", fname, filename); } // Check to see if this bitmap is already in memory, if so, just return that // bitmaps handle if ((n = bm_TestName(filename)) != -1) { - mprintf((1, "Found duplicate bitmap %s.\n", GameBitmaps[n].name)); + mprintf(1, "Found duplicate bitmap %s.\n", GameBitmaps[n].name); old_used = GameBitmaps[n].used; GameBitmaps[n].used = 1; bm_FreeBitmap(n); @@ -750,13 +750,13 @@ int bm_AllocLoadFileBitmap(const char *fname, int mipped, int format) { strcpy(name, GameBitmaps[n].name); } if (strlen(name) > 33) { - mprintf((0, "ERROR!! This bitmaps name is too long, try shortening it and retry!\n")); + mprintf(0, "ERROR!! This bitmaps name is too long, try shortening it and retry!\n"); return -1; } // Try to open the file. If we can't load it from the network if possible infile = (CFILE *)cfopen(filename, "rb"); if (!infile) { - mprintf((0, "bm_AllocLoadFileBitmap: Can't open file named %s.\n", filename)); + mprintf(0, "bm_AllocLoadFileBitmap: Can't open file named %s.\n", filename); return BAD_BITMAP_HANDLE; // return the bad texture } @@ -782,7 +782,7 @@ int bm_AllocLoadFileBitmap(const char *fname, int mipped, int format) { } cfclose(infile); if (src_bm < 0) { - mprintf((0, "Couldn't load %s.", filename)); + mprintf(0, "Couldn't load %s.", filename); return -1; } @@ -866,7 +866,7 @@ int bm_AllocLoadFileBitmap(const char *fname, int mipped, int format) { int bm_AllocLoadFileNoMemBitmap(const char *fname, int mipped, int format) { if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return -1; } @@ -884,26 +884,26 @@ int bm_AllocLoadFileNoMemBitmap(const char *fname, int mipped, int format) { while ((end_ptr >= start_ptr) && (*end_ptr != '\\')) end_ptr--; if (end_ptr < start_ptr) { - mprintf((0, "Unable to find bitmap %s\n", fname)); + mprintf(0, "Unable to find bitmap %s\n", fname); return -1; } ASSERT(*end_ptr == '\\'); end_ptr++; filename = end_ptr; - mprintf((0, "Couldn't find %s, so gonna try %s\n", fname, filename)); + mprintf(0, "Couldn't find %s, so gonna try %s\n", fname, filename); } // Check to see if this bitmap is already in memory, if so, just return that // bitmaps handle if ((n = bm_TestName(filename)) != -1) { GameBitmaps[n].used++; - mprintf((1, "Found duplicate bitmap %s.\n", GameBitmaps[n].name)); + mprintf(1, "Found duplicate bitmap %s.\n", GameBitmaps[n].name); return n; } bm_ChangeEndName(filename, name); if (strlen(name) > 33) { - mprintf((0, "ERROR!! This bitmaps name is too long, try shortening it and retry!\n")); + mprintf(0, "ERROR!! This bitmaps name is too long, try shortening it and retry!\n"); return -1; } n = bm_AllocNoMemBitmap(1, 1); @@ -924,7 +924,7 @@ int bm_AllocLoadBitmap(CFILE *infile, int mipped, int format) { int n, src_bm; if (!Bitmaps_initted) { Int3(); - mprintf((0, "Bitmaps not initted!!!\n")); + mprintf(0, "Bitmaps not initted!!!\n"); return -1; } @@ -932,7 +932,7 @@ int bm_AllocLoadBitmap(CFILE *infile, int mipped, int format) { src_bm = bm_tga_alloc_file(infile, name, format); if (src_bm < 0) { - mprintf((0, "Couldn't load %s.", name)); + mprintf(0, "Couldn't load %s.", name); return -1; } @@ -1001,9 +1001,9 @@ int bm_SaveBitmap(CFILE *fp, int handle) { uint8_t dumbbyte = 0, image_type = OUTRAGE_1555_COMPRESSED_MIPPED, pixsize = 32, desc = 8 + 32; int i, done = 0; int num_mips; - mprintf((0, "Saving bitmap %s...\n", GameBitmaps[handle].name)); + mprintf(0, "Saving bitmap %s...\n", GameBitmaps[handle].name); if (!GameBitmaps[handle].used) { - mprintf((0, "bm_SaveBitmap: Trying to save a bitmap that isn't used!\n")); + mprintf(0, "bm_SaveBitmap: Trying to save a bitmap that isn't used!\n"); Int3(); return -1; } @@ -1014,7 +1014,7 @@ int bm_SaveBitmap(CFILE *fp, int handle) { if (GameBitmaps[handle].format == BITMAP_FORMAT_4444) image_type = OUTRAGE_4444_COMPRESSED_MIPPED; if (!fp) { - mprintf((0, "bm_SaveBitmap: Trying to save a bitmap to a closed file!\n")); + mprintf(0, "bm_SaveBitmap: Trying to save a bitmap to a closed file!\n"); Int3(); return -1; } @@ -1072,7 +1072,7 @@ int bm_MakeBitmapResident(int handle) { GameBitmaps[handle].flags &= ~BF_NOT_RESIDENT; GameBitmaps[handle].flags |= BF_CHANGED | BF_BRAND_NEW; } else { - mprintf((0, "Error paging in bitmap %s!\n", GameBitmaps[handle].name)); + mprintf(0, "Error paging in bitmap %s!\n", GameBitmaps[handle].name); return 0; } } @@ -1084,7 +1084,7 @@ int bm_SaveFileBitmap(const char *filename, int handle) { int ret; CFILE *fp; if (!GameBitmaps[handle].used) { - mprintf((0, "bm_SaveBitmap: Trying to save a bitmap that isn't used!\n")); + mprintf(0, "bm_SaveBitmap: Trying to save a bitmap that isn't used!\n"); Int3(); return -1; } @@ -1093,13 +1093,13 @@ int bm_SaveFileBitmap(const char *filename, int handle) { return -1; } if (!bm_MakeBitmapResident(handle)) { - mprintf((0, "There was a problem paging this bitmap in!\n")); + mprintf(0, "There was a problem paging this bitmap in!\n"); return -1; } fp = (CFILE *)cfopen(filename, "wb"); if (!fp) { - mprintf((0, "bm_SaveBitmap: Trying to save a bitmap to a closed file!\n")); + mprintf(0, "bm_SaveBitmap: Trying to save a bitmap to a closed file!\n"); Int3(); return -1; } @@ -1205,7 +1205,7 @@ void bm_GenerateMipMaps(int handle) { int height = bm_h(handle, 0); int jump = 2; // how many pixels to jump in x and y on source - // mprintf ((0,"We got a mipper! %d \n",handle)); + // mprintf(0,"We got a mipper! %d \n",handle); ASSERT(GameBitmaps[handle].used); GameBitmaps[handle].flags |= BF_MIPMAPPED; diff --git a/bitmap/bumpmap.cpp b/bitmap/bumpmap.cpp index d4f714f9..26f4f242 100644 --- a/bitmap/bumpmap.cpp +++ b/bitmap/bumpmap.cpp @@ -46,7 +46,7 @@ void bump_InitBumpmaps() { void bump_ShutdownBumpmaps(void) { int i; - mprintf((0, "Freeing all bumpmap memory.\n")); + mprintf(0, "Freeing all bumpmap memory.\n"); for (i = 0; i < MAX_BUMPMAPS; i++) { while (GameBumpmaps[i].flags & BUMPF_USED) @@ -72,7 +72,7 @@ int bump_AllocBumpmap(int w, int h) { GameBumpmaps[n].data = (uint16_t *)mem_malloc(w * h * 2); if (!GameBumpmaps[n].data) { - mprintf((0, "NOT ENOUGHT MEMORY FOR BUMPMAP!\n")); + mprintf(0, "NOT ENOUGHT MEMORY FOR BUMPMAP!\n"); Int3(); return BAD_BUMP_INDEX; } diff --git a/bitmap/iff.cpp b/bitmap/iff.cpp index 8bf29eb2..9b08b7b3 100644 --- a/bitmap/iff.cpp +++ b/bitmap/iff.cpp @@ -521,7 +521,7 @@ int bm_iff_alloc_file(CFILE *ifile) { cur_sig[i] = cf_ReadByte(ifile); if (strncmp("PBM ", cur_sig, 4)) { - mprintf((0, "IFF file isn't a PBM...aborting.\n")); + mprintf(0, "IFF file isn't a PBM...aborting.\n"); return -1; } if (!strncmp("PBM ", cur_sig, 4)) @@ -532,7 +532,7 @@ int bm_iff_alloc_file(CFILE *ifile) { ret = bm_iff_parse_file(ifile, &bmheader, NULL); if (ret != IFF_NO_ERROR) { - mprintf((0, "Couldn't load IFF file.\n")); + mprintf(0, "Couldn't load IFF file.\n"); return -1; } @@ -571,7 +571,7 @@ int bm_iff_read_animbrush(const char *ifilename, int *bm_list) { form_len = cf_ReadInt(ifile); if (sig != IFF_SIG_FORM) { - mprintf((0, "Not a valid IFF file.\n")); + mprintf(0, "Not a valid IFF file.\n"); cfclose(ifile); return -1; } diff --git a/bitmap/lightmap.cpp b/bitmap/lightmap.cpp index cabb9b0c..ddf16412 100644 --- a/bitmap/lightmap.cpp +++ b/bitmap/lightmap.cpp @@ -48,7 +48,7 @@ void lm_InitLightmaps() { } void lm_ShutdownLightmaps(void) { int i; - mprintf((0, "Freeing all lightmap memory.\n")); + mprintf(0, "Freeing all lightmap memory.\n"); for (i = 0; i < MAX_LIGHTMAPS; i++) { while (GameLightmaps[i].used > 0) lm_FreeLightmap(i); @@ -68,7 +68,7 @@ int lm_AllocLightmap(int w, int h) { memset(&GameLightmaps[n], 0, sizeof(bms_lightmap)); GameLightmaps[n].data = (uint16_t *)mem_malloc((w * h * 2)); if (!GameLightmaps[n].data) { - mprintf((0, "NOT ENOUGHT MEMORY FOR LIGHTMAP!\n")); + mprintf(0, "NOT ENOUGHT MEMORY FOR LIGHTMAP!\n"); Int3(); return BAD_LM_INDEX; } diff --git a/bitmap/pcx.cpp b/bitmap/pcx.cpp index 89734f50..81e468e6 100644 --- a/bitmap/pcx.cpp +++ b/bitmap/pcx.cpp @@ -190,13 +190,13 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { if (temp[1] < 5) { // need at least version 5.0f - mprintf((0, "PCXLoad: PCX Not version 5.0 or greater\n")); + mprintf(0, "PCXLoad: PCX Not version 5.0 or greater\n"); return -1; } if (temp[3] != 8) { // need 8 bits per pixel - mprintf((0, "PCXLoad: PCX Not 8 bpp\n")); + mprintf(0, "PCXLoad: PCX Not 8 bpp\n"); return -1; // nope...bail } @@ -211,7 +211,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { if (temp[65 - PCXHEADER_OFFSET] != 3) { // Must have 3 planes - mprintf((0, "PCXLoad: PCX Not 3 Planes for 24bit encoding\n")); + mprintf(0, "PCXLoad: PCX Not 3 Planes for 24bit encoding\n"); return -1; } @@ -228,7 +228,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { uint8_t *rawdata = (uint8_t *)mem_malloc(total * height); if (!rawdata) { - mprintf((0, "PCXLoad: Out of memory\n")); + mprintf(0, "PCXLoad: Out of memory\n"); return -1; // no memory! } diff --git a/bitmap/tga.cpp b/bitmap/tga.cpp index 3b5a0e9e..072da9cf 100644 --- a/bitmap/tga.cpp +++ b/bitmap/tga.cpp @@ -341,7 +341,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { (image_type != 10 && image_type != 2 && image_type != OUTRAGE_TGA_TYPE && image_type != OUTRAGE_COMPRESSED_OGF && image_type != OUTRAGE_COMPRESSED_MIPPED && image_type != OUTRAGE_NEW_COMPRESSED_MIPPED && image_type != OUTRAGE_1555_COMPRESSED_MIPPED && image_type != OUTRAGE_4444_COMPRESSED_MIPPED)) { - mprintf((0, "bm_tga: Can't read this type of TGA.\n")); + mprintf(0, "bm_tga: Can't read this type of TGA.\n"); return -1; } @@ -377,13 +377,13 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { pixsize = cf_ReadByte(infile); if (pixsize != 32 && pixsize != 24) { - mprintf((0, "bm_tga: This file has a pixsize of field of %d, it should be 32. ", pixsize)); + mprintf(0, "bm_tga: This file has a pixsize of field of %d, it should be 32. ", pixsize); return -1; } descriptor = cf_ReadByte(infile); if (((descriptor & 0x0F) != 8) && ((descriptor & 0x0F) != 0)) { - mprintf((0, "bm_tga: Descriptor field & 0x0F must be 8 or 0, but this is %d.", descriptor & 0x0F)); + mprintf(0, "bm_tga: Descriptor field & 0x0F must be 8 or 0, but this is %d.", descriptor & 0x0F); return -1; } @@ -402,7 +402,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { GameBitmaps[n].flags |= BF_MIPMAPPED; if (n < 0) { - mprintf((0, "bm_tga: Failed to allocate memory.\n")); + mprintf(0, "bm_tga: Failed to allocate memory.\n"); Int3(); return -1; } @@ -550,7 +550,7 @@ int bm_page_in_file(int n) { infile = (CFILE *)cfopen(GameBitmaps[n].name, "rb"); if (!infile) { - mprintf((0, "Couldn't page in bitmap %s!\n", GameBitmaps[n].name)); + mprintf(0, "Couldn't page in bitmap %s!\n", GameBitmaps[n].name); return 0; } // Used for progress bar when loading the level @@ -564,7 +564,7 @@ int bm_page_in_file(int n) { (image_type != 10 && image_type != 2 && image_type != OUTRAGE_TGA_TYPE && image_type != OUTRAGE_COMPRESSED_OGF && image_type != OUTRAGE_COMPRESSED_MIPPED && image_type != OUTRAGE_NEW_COMPRESSED_MIPPED && image_type != OUTRAGE_1555_COMPRESSED_MIPPED && image_type != OUTRAGE_4444_COMPRESSED_MIPPED)) { - mprintf((0, "bm_tga: Can't read this type of TGA.\n")); + mprintf(0, "bm_tga: Can't read this type of TGA.\n"); return -1; } @@ -600,13 +600,13 @@ int bm_page_in_file(int n) { pixsize = cf_ReadByte(infile); if (pixsize != 32 && pixsize != 24) { - mprintf((0, "bm_tga: This file has a pixsize of field of %d, it should be 32. ", pixsize)); + mprintf(0, "bm_tga: This file has a pixsize of field of %d, it should be 32. ", pixsize); return 0; } descriptor = cf_ReadByte(infile); if (((descriptor & 0x0F) != 8) && ((descriptor & 0x0F) != 0)) { - mprintf((0, "bm_tga: Descriptor field & 0x0F must be 8 or 0, but this is %d.", descriptor & 0x0F)); + mprintf(0, "bm_tga: Descriptor field & 0x0F must be 8 or 0, but this is %d.", descriptor & 0x0F); return 0; } @@ -619,7 +619,7 @@ int bm_page_in_file(int n) { int size = (width * height * 2) + (mipped * ((width * height * 2) / 3)) + 2; GameBitmaps[n].data16 = (uint16_t *)mem_malloc(size); if (!GameBitmaps[n].data16) { - mprintf((0, "Out of memory in bm_page_in_file!\n")); + mprintf(0, "Out of memory in bm_page_in_file!\n"); return 0; } @@ -640,7 +640,7 @@ int bm_page_in_file(int n) { strcpy(GameBitmaps[n].name, name); - mprintf((0, "Paging in bitmap %s!\n", GameBitmaps[n].name)); + mprintf(0, "Paging in bitmap %s!\n", GameBitmaps[n].name); if (file_mipped) GameBitmaps[n].flags |= BF_MIPMAPPED; diff --git a/cfile/cfile.cpp b/cfile/cfile.cpp index abc3ff5e..d84949c9 100644 --- a/cfile/cfile.cpp +++ b/cfile/cfile.cpp @@ -318,7 +318,7 @@ CFILE *cf_OpenFileInLibrary(const char *filename, int libhandle) { } else { fp = fopen(lib->name, "rb"); if (!fp) { - mprintf((1, "Error opening library <%s> when opening file <%s>; errno=%d.", lib->name, filename, errno)); + mprintf(1, "Error opening library <%s> when opening file <%s>; errno=%d.", lib->name, filename, errno); Int3(); return nullptr; } @@ -370,7 +370,7 @@ CFILE *open_file_in_lib(const char *filename) { } else { fp = fopen(lib->name, "rb"); if (!fp) { - mprintf((1, "Error opening library <%s> when opening file <%s>; errno=%d.", lib->name, filename, errno)); + mprintf(1, "Error opening library <%s> when opening file <%s>; errno=%d.", lib->name, filename, errno); Int3(); return nullptr; } @@ -398,7 +398,7 @@ CFILE *open_file_in_lib(const char *filename) { #include static int globerrfn(const char *path, int err) { - mprintf((0, "Error accessing %s: %s .... \n", path, strerror(err))); + mprintf(0, "Error accessing %s: %s .... \n", path, strerror(err)); return 0; } @@ -426,7 +426,7 @@ bool CFindFiles::Start(const char *wildcard, char *namebuf) { flags = GLOB_MARK; rc = glob(wildcard, flags, globerrfn, &ffres); if (rc == GLOB_NOSPACE) { - mprintf((0, "Out of space during glob\n")); + mprintf(0, "Out of space during glob\n"); globindex = -1; return false; } @@ -493,7 +493,7 @@ bool cf_FindRealFileNameCaseInsenstive(const char *directory, const char *fname, strcat(file_to_use, t_ext); real_file = (char *)file_to_use; - mprintf((1, "CFILE: Found directory \"%s\" in filename, new filename is \"%s\"\n", real_dir, real_file)); + mprintf(1, "CFILE: Found directory \"%s\" in filename, new filename is \"%s\"\n", real_dir, real_file); } else { use_dir = false; real_dir = nullptr; @@ -590,7 +590,7 @@ bool cf_FindRealFileNameCaseInsenstive(const char *directory, const char *fname, if (found_match) { strcpy(new_filename, namebuffer); - mprintf((1, "CFILE: Using \"%s\" instead of \"%s\"\n", new_filename, real_file)); + mprintf(1, "CFILE: Using \"%s\" instead of \"%s\"\n", new_filename, real_file); break; } } @@ -669,7 +669,7 @@ CFILE *open_file_in_directory(const char *filename, const char *mode, const char return nullptr; } else { // found a version of the file! - mprintf((0, "CFILE: Unable to find %s, but using %s instead\n", filename, using_filename)); + mprintf(0, "CFILE: Unable to find %s, but using %s instead\n", filename, using_filename); cfile = (CFILE *)mem_malloc(sizeof(*cfile)); if (!cfile) Error("Out of memory in open_file_in_directory()"); @@ -898,8 +898,7 @@ int cf_ReadBytes(uint8_t *buf, int count, CFILE *cfp) { if (!feof(cfp->file)) error_msg = strerror(errno); } - mprintf( - (1, "Error reading %d bytes from position %d of file <%s>; errno=%d.", count, cfp->position, cfp->name, errno)); + mprintf(1, "Error reading %d bytes from position %d of file <%s>; errno=%d.", count, cfp->position, cfp->name, errno); return 0; } // The following functions read numeric vales from a CFILE. All values are diff --git a/d3music/musicapi.cpp b/d3music/musicapi.cpp index 5d06cac1..f5b4fcfa 100644 --- a/d3music/musicapi.cpp +++ b/d3music/musicapi.cpp @@ -367,7 +367,7 @@ void D3MusicSongSelector() { switch (MusicAI.cur_song) { case OMS_THEME_TYPE_NONE: if (MusicAI.pending_region > -1) { - mprintf((0, "D3MUSIC: new region request processed.\n")); + mprintf(0, "D3MUSIC: new region request processed.\n"); MusicAI.cur_song = OMS_THEME_TYPE_IDLE; Music_seq.SetCurrentRegion(MusicAI.pending_region); Music_seq.StartSong(MusicAI.cur_song, true); @@ -379,18 +379,18 @@ void D3MusicSongSelector() { if (evt.cmd == OMS_EVT_SONGENDED) { MusicAI.cur_song = OMS_THEME_TYPE_NONE; // if (Music_seq.GetCurrentRegion() == 0) { - // mprintf((0, "Ending Region 0.\n")); + // mprintf(0, "Ending Region 0.\n"); // MusicAI.cur_song = OMS_THEME_TYPE_IDLE; // Music_seq.SetCurrentRegion(1); // Music_seq.StartSong(MusicAI.cur_song, true); // } // else { - // mprintf((0, "D3MUSIC: Song ended normally?\n")); + // mprintf(0, "D3MUSIC: Song ended normally?\n"); // } } else if (evt.cmd == OMS_EVT_LOOPENDING) { // shall we switch regions? if (MusicAI.pending_region > -1) { - mprintf((0, "D3MUSIC: new region request processed.\n")); + mprintf(0, "D3MUSIC: new region request processed.\n"); MusicAI.cur_song = OMS_THEME_TYPE_IDLE; Music_seq.SetCurrentRegion(MusicAI.pending_region); Music_seq.StartSong(MusicAI.cur_song, true); diff --git a/dd_grwin32/ddgrWin32DX.cpp b/dd_grwin32/ddgrWin32DX.cpp index bf1b8ecc..9e4fdb5b 100644 --- a/dd_grwin32/ddgrWin32DX.cpp +++ b/dd_grwin32/ddgrWin32DX.cpp @@ -67,7 +67,7 @@ bool ddgr_dx_Init(oeApplication *app) { DX_DATA(vidrefs) = 0; // reset video reference count. DX_DATA(init) = true; - mprintf((0, "DX system initialized.\n")); + mprintf(0, "DX system initialized.\n"); return true; } @@ -84,7 +84,7 @@ void ddgr_dx_Close() { DX_DATA(hPrimaryWnd) = NULL; DX_DATA(init) = false; - mprintf((0, "DX system closed.\n")); + mprintf(0, "DX system closed.\n"); } // Initializes the display for use with the DX subsystem. diff --git a/dd_grwin32/ddgrWin32GDI.cpp b/dd_grwin32/ddgrWin32GDI.cpp index f7487af0..512f6ab5 100644 --- a/dd_grwin32/ddgrWin32GDI.cpp +++ b/dd_grwin32/ddgrWin32GDI.cpp @@ -148,7 +148,7 @@ bool ddgr_gdi_Init(oeApplication *app, bool fullscreen, bool ddraw) { GDI_DATA(vidrefs) = 0; // reset video reference count. GDI_DATA(init) = true; - mprintf((0, "GDI system initialized.\n")); + mprintf(0, "GDI system initialized.\n"); return true; } @@ -183,7 +183,7 @@ void ddgr_gdi_Close() { GDI_DATA(hPrimaryWnd) = NULL; GDI_DATA(init) = false; - mprintf((0, "GDI system closed.\n")); + mprintf(0, "GDI system closed.\n"); } // --------------------------------------------------------------------------- diff --git a/dd_video/vidWin32FS.cpp b/dd_video/vidWin32FS.cpp index f1521042..1407a1b5 100644 --- a/dd_video/vidWin32FS.cpp +++ b/dd_video/vidWin32FS.cpp @@ -80,11 +80,11 @@ bool ddvidfs_Init() { // enumerate all display modes. if (DDVideo_info.lpDD->EnumDisplayModes(0, NULL, NULL, DDEnumModesCallback) != DD_OK) { - mprintf((0, "DDVID error: Error enumerating display modes.\n")); + mprintf(0, "DDVID error: Error enumerating display modes.\n"); return false; } - mprintf((0, "Video fullscreen system initialized.\n")); + mprintf(0, "Video fullscreen system initialized.\n"); return true; } @@ -172,7 +172,7 @@ bool ddvidfs_SetVideoMode(int w, int h, int color_depth, bool paged) { hres = DDVideo_info.lpDDSFront->GetAttachedSurface(&ddscaps, &DDVideo_info.lpDDSBack); if (hres != DD_OK) { - mprintf((0, "Unable to capture DirectDraw display back surface (%d)", LOWORD(hres))); + mprintf(0, "Unable to capture DirectDraw display back surface (%d)", LOWORD(hres)); return false; } } else { diff --git a/ddebug/lnxdebug.cpp b/ddebug/lnxdebug.cpp index f52653c6..a572a6d6 100644 --- a/ddebug/lnxdebug.cpp +++ b/ddebug/lnxdebug.cpp @@ -63,11 +63,11 @@ bool Debug_Init(bool debugger, bool mono_debug) { Debug_ConsoleOpen(1, 1, 1, 58, 6, "Warnings"); Debug_ConsoleOpen(2, 1, 61, 18, 6, "Stats"); - mprintf((0, "Linux system.\n")); + mprintf(0, "Linux system.\n"); } if (Debug_break) - mprintf((0, "Debug Break enabled.\n")); + mprintf(0, "Debug Break enabled.\n"); #endif // ifndef RELEASE diff --git a/ddebug/mono.h b/ddebug/mono.h index d34accf4..3425cbcb 100644 --- a/ddebug/mono.h +++ b/ddebug/mono.h @@ -69,17 +69,18 @@ void nw_TCPPrintf(int n, char *format, ...); #if (!defined(RELEASE)) && defined(LOGGER) extern bool Debug_print_block; // Prints a formatted string to the debug window -#define mprintf(args) Debug_ConsolePrintf args +#define mprintf(...) Debug_ConsolePrintf(__VA_ARGS__) // Prints a formatted string on window n at row, col. -#define mprintf_at(args) Debug_ConsolePrintfAt args -#define DebugBlockPrint(args) \ +#define mprintf_at(...) Debug_ConsolePrintfAt(__VA_ARGS__) +#define DebugBlockPrint(...) \ do { \ if (Debug_print_block) \ - mprintf_at((1, 5, 51, args)); \ + mprintf_at(1, 5, 51, __VA_ARGS__); \ } while (0) #else // ifdef _DEBUG -#define mprintf(args) // DAJ defined in target headers -#define mprintf_at(args) -#define DebugBlockPrint(args) + // DAJ defined in target headers +#define mprintf(...) +#define mprintf_at(...) +#define DebugBlockPrint(...) #endif // ifdef _DEBUG #endif diff --git a/ddebug/windebug.cpp b/ddebug/windebug.cpp index 5528f535..d0021f29 100644 --- a/ddebug/windebug.cpp +++ b/ddebug/windebug.cpp @@ -237,14 +237,14 @@ bool Debug_Init(bool debugger, bool con_debug) { if (!Debug_NT) { Debug_ConsoleOpen(2, 1, 61, 18, 6, "Stats"); - mprintf((0, "Win95 system.\n")); + mprintf(0, "Win95 system.\n"); } else { - mprintf((0, "WinNT system.\n")); + mprintf(0, "WinNT system.\n"); } } if (Debug_break) { - mprintf((0, "Debug Break enabled.\n")); + mprintf(0, "Debug Break enabled.\n"); } #endif // ifndef RELEASE diff --git a/ddio/ddio.cpp b/ddio/ddio.cpp index 461fd6bf..eaeb16ea 100644 --- a/ddio/ddio.cpp +++ b/ddio/ddio.cpp @@ -103,7 +103,7 @@ bool ddio_Init(ddio_init_info *init_info) { if (first_time) { atexit(ddio_Close); } - mprintf((0, "DDIO system initializing...\n")); + mprintf(0, "DDIO system initializing...\n"); res = ddio_InternalInit(init_info); if (res) { if (first_time) { // initialize once and only once. @@ -124,7 +124,7 @@ void ddio_Close() { ddio_MouseClose(); ddio_KeyClose(); ddio_InternalClose(); - mprintf((0, "DDIO system closed.\n")); + mprintf(0, "DDIO system closed.\n"); DDIO_initialized = false; } } diff --git a/ddio/key.cpp b/ddio/key.cpp index 7dd99011..7f51dfb0 100644 --- a/ddio/key.cpp +++ b/ddio/key.cpp @@ -256,7 +256,7 @@ int ddio_KeyInKey() { if (DDIO_key_queue.head != DDIO_key_queue.tail) { key = (unsigned)DDIO_key_queue.buffer[DDIO_key_queue.head]; - // mprintf((1, "%x ", key)); + // mprintf(1, "%x ", key); DDIO_key_queue.head++; if (DDIO_key_queue.head >= KEY_QUEUE_SIZE) DDIO_key_queue.head = 0; @@ -309,7 +309,7 @@ void ddio_AddKeyToQueue(int key) { if (temp != DDIO_key_queue.head) { DDIO_key_queue.buffer[DDIO_key_queue.tail] = (uint16_t)keycode; DDIO_key_queue.tail = temp; - // mprintf((1, "%d ", keycode)); + // mprintf(1, "%d ", keycode); } } diff --git a/ddio/lnxcdrom.cpp b/ddio/lnxcdrom.cpp index 8f7384a0..36260da2 100644 --- a/ddio/lnxcdrom.cpp +++ b/ddio/lnxcdrom.cpp @@ -450,7 +450,7 @@ static bool checkDevMount(const char *device, const char *mntfname, char *mountp FILE *mountFile = setmntent(mntfname, "r"); if (mountFile == NULL) { - mprintf((0, "setmntent(\"%s\", \"r\"); failed! errno == (%d).", mntfname, errno)); + mprintf(0, "setmntent(\"%s\", \"r\"); failed! errno == (%d).", mntfname, errno); Int3(); return (false); } // if @@ -570,7 +570,7 @@ bool system_cdroms::UnMount(void) { return true; }else { - mprintf((0,"Error %d trying to unmount %s\n",errno,name)); + mprintf(0,"Error %d trying to unmount %s\n",errno,name); //lock it again...something went wrong LockDevice(); return false; @@ -644,7 +644,7 @@ bool system_cdroms::PrepareForVolume(char *volume, char *mountpoint) { return true; } else { // we couldn't mount! - mprintf((0, "CDROM: Unable to mount drive though we must have it mounted\n")); + mprintf(0, "CDROM: Unable to mount drive though we must have it mounted\n"); Int3(); return false; } @@ -654,7 +654,7 @@ bool system_cdroms::PrepareForVolume(char *volume, char *mountpoint) { // lets unmount the drive so the user can switch CDs bool ret = UnMount(); if (!ret) { - mprintf((0, "Unable to unmount drive\n")); + mprintf(0, "Unable to unmount drive\n"); } return false; @@ -671,13 +671,13 @@ void system_cdroms::FindDefaultDevice(void) { // 0 is SDL's default CD-ROM drive id. But use -1 if there are none. if (GetNumCDRoms() <= 0) { m_DeviceToUse = -1; - mprintf((0, "CDROM: No drives found to be made default!")); + mprintf(0, "CDROM: No drives found to be made default!"); return; } // if else // there WAS at least one drive... { m_DeviceToUse = 0; // default device. - mprintf((0, "CDROM: Making device \"%s\" default CD-ROM drive.", CDName(m_DeviceToUse))); + mprintf(0, "CDROM: Making device \"%s\" default CD-ROM drive.", CDName(m_DeviceToUse)); } // else // we found the device we want to use for our CD-ROM. @@ -705,7 +705,7 @@ void system_cdroms::QueryDefaultDevice(void) { const char *device = CDName(m_DeviceToUse); if (IsDeviceMounted(device, mountpoint, sizeof(mountpoint))) { - mprintf((0, "CDROM: Default device already mounted at %s...\n", mountpoint)); + mprintf(0, "CDROM: Default device already mounted at %s...\n", mountpoint); // save the mountpoint for use strcpy(m_MountedDir, mountpoint); @@ -766,7 +766,7 @@ void system_cdroms::QueryDefaultDevice(void) { } // save the mountpoint for use - mprintf((0,"CDROM: Mountpoint created for device %s at %s\n",device,mountpoint)); + mprintf(0,"CDROM: Mountpoint created for device %s at %s\n",device,mountpoint); strcpy(m_MountedDir,mountpoint); m_CreatedMountPoint = true; } // if @@ -801,7 +801,7 @@ void system_cdroms::LockDevice(void) { retval = ioctl(fileid,CDC_LOCK,arg); if(retval<0) { - mprintf((0,"CDROM: ioctl error locking drive (%d)\n",retval)); + mprintf(0,"CDROM: ioctl error locking drive (%d)\n",retval); } close(fileid); } @@ -825,7 +825,7 @@ void system_cdroms::UnLockDevice(void) { retval = ioctl(fileid,CDC_LOCK,arg); if(retval<0) { - mprintf((0,"CDROM: ioctl error unlocking drive (%d)\n",retval)); + mprintf(0,"CDROM: ioctl error unlocking drive (%d)\n",retval); } close(fileid); } diff --git a/ddio/lnxfile.cpp b/ddio/lnxfile.cpp index ccd0ac9f..497fc2b1 100644 --- a/ddio/lnxfile.cpp +++ b/ddio/lnxfile.cpp @@ -118,7 +118,7 @@ int ddio_GetFileLength(FILE *filePtr) { fstat(filedes, &info); size = info.st_size; } else { - mprintf((0, "Tried getting length of NULL fileptr!\n")); + mprintf(0, "Tried getting length of NULL fileptr!\n"); Int3(); } return size; @@ -291,7 +291,7 @@ void ddio_MakePath(char *newPath, const char *absolutePathHeader, const char *su glob_t ffres = {0, NULL, 0}; int globindex = -1; static int globerrfn(const char *path, int err) { - mprintf((0, "Error accessing %s: %s .... \n", path, strerror(err))); + mprintf(0, "Error accessing %s: %s .... \n", path, strerror(err)); return 0; } @@ -396,7 +396,7 @@ bool ddio_FindFileStart(const char *wildcard, char *namebuf) { flags = GLOB_MARK | GLOB_PERIOD | GLOB_TILDE; rc = glob(wildcard, flags, globerrfn, &ffres); if (rc == GLOB_NOSPACE) { - mprintf((0, "Out of space during glob\n")); + mprintf(0, "Out of space during glob\n"); globindex = -1; return false; } @@ -794,7 +794,7 @@ int ddio_CheckLockFile(const char *dir) { FILE *file; snprintf(buffer, bufferLen, "%s/%s", dir, ".lock"); - mprintf((0, "LockFile: Checking [%s]...", buffer)); + mprintf(0, "LockFile: Checking [%s]...", buffer); chmod(buffer, S_IREAD | S_IWRITE); file = fopen(buffer, "rb"); @@ -857,7 +857,7 @@ int ddio_CheckLockFile(const char *dir) { // technically this shouldn't happen, but I get it // when the pid no longer exists...so I'm going to // pretend it doesn't - mprintf((0, "Error sending signal to pid for lock check (%d)\n", f_pid)); + mprintf(0, "Error sending signal to pid for lock check (%d)\n", f_pid); // perror ("Error sending signal to pid for lock check, maybe remove lock file in temp directory"); // ddio_SetWorkingDir(old_directory); // return 0; diff --git a/ddio/lnxio.cpp b/ddio/lnxio.cpp index fb721677..90076485 100644 --- a/ddio/lnxio.cpp +++ b/ddio/lnxio.cpp @@ -74,21 +74,21 @@ oeLnxApplication *Lnx_app_obj = NULL; // ---------------------------------------------------------------------------- bool ddio_InternalInit(ddio_init_info *init_info) { - mprintf((0, "DDIO: ddio_InternalInit() called.")); + mprintf(0, "DDIO: ddio_InternalInit() called."); Lnx_app_obj = (oeLnxApplication *)init_info->obj; DDIO_init = true; return true; } void ddio_InternalClose() { - mprintf((0, "DDIO: ddio_InternalClose() called.")); + mprintf(0, "DDIO: ddio_InternalClose() called."); if (DDIO_init) { DDIO_init = false; Lnx_app_obj = NULL; } // if - mprintf((0, "DDIO: ddio_InternalClose() returning.")); + mprintf(0, "DDIO: ddio_InternalClose() returning."); } void ddio_DebugMessage(unsigned err, char *fmt, ...) { @@ -99,7 +99,7 @@ void ddio_DebugMessage(unsigned err, char *fmt, ...) { std::vsnprintf(buf, sizeof(buf), fmt, arglist); va_end(arglist); - mprintf((0, "%s\n", buf)); + mprintf(0, "%s\n", buf); } bool ddio_GetBinaryPath(char *exec_path, size_t len) { diff --git a/ddio/lnxkey_sdl.cpp b/ddio/lnxkey_sdl.cpp index 419c4830..d1dc43d8 100644 --- a/ddio/lnxkey_sdl.cpp +++ b/ddio/lnxkey_sdl.cpp @@ -367,7 +367,7 @@ int sdlKeyFilter(const SDL_Event *event) { if (__glLog == false) { DGL_EnableLogging(1); __glLog = true; - mprintf((0, "OpenGL: Logging enabled.")); + mprintf(0, "OpenGL: Logging enabled."); } // if return (0); @@ -375,7 +375,7 @@ int sdlKeyFilter(const SDL_Event *event) { if (__glLog == true) { DGL_EnableLogging(0); __glLog = false; - mprintf((0, "OpenGL: Logging disabled.")); + mprintf(0, "OpenGL: Logging disabled."); } // if return (0); #endif diff --git a/ddio/lnxmouse.cpp b/ddio/lnxmouse.cpp index fb2fb822..3c04377d 100644 --- a/ddio/lnxmouse.cpp +++ b/ddio/lnxmouse.cpp @@ -211,7 +211,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 0; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 0: Down\n")); + // mprintf(0, "MOUSE Button 0: Down\n"); } else if (ev->button == 2) { DDIO_mouse_state.btn_mask |= MOUSE_RB; DIM_buttons.down_count[1]++; @@ -220,7 +220,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 1; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 1: Down\n")); + // mprintf(0, "MOUSE Button 1: Down\n"); } else if (ev->button == 3) { DDIO_mouse_state.btn_mask |= MOUSE_CB; @@ -230,7 +230,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 2; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 2: Down\n")); + // mprintf(0, "MOUSE Button 2: Down\n"); } // buttons 4 and 5 are reserved for the mouse wheel...that's how the engine works...adjust in here. @@ -243,7 +243,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 5; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 5: Down\n")); + // mprintf(0, "MOUSE Button 5: Down\n"); } else if (ev->button == 5) { DDIO_mouse_state.btn_mask |= MOUSE_B7; @@ -253,7 +253,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 6; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 6: Down\n")); + // mprintf(0, "MOUSE Button 6: Down\n"); } else if (ev->button == 6) { DDIO_mouse_state.btn_mask |= MOUSE_B8; @@ -263,7 +263,7 @@ int sdlMouseButtonDownFilter(SDL_Event const *event) { mevt.btn = 7; mevt.state = true; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 7: Down\n")); + // mprintf(0, "MOUSE Button 7: Down\n"); } return (0); @@ -283,7 +283,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 0; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 0: Up\n")); + // mprintf(0, "MOUSE Button 0: Up\n"); } else if (ev->button == 2) { DDIO_mouse_state.btn_mask &= (~MOUSE_RB); @@ -293,7 +293,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 1; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 1: Up\n")); + // mprintf(0, "MOUSE Button 1: Up\n"); } else if (ev->button == 3) { DDIO_mouse_state.btn_mask &= (~MOUSE_CB); @@ -303,7 +303,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 2; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 2: Up\n")); + // mprintf(0, "MOUSE Button 2: Up\n"); } @@ -317,7 +317,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 5; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 5: Up\n")); + // mprintf(0, "MOUSE Button 5: Up\n"); } else if (ev->button == 5) { DDIO_mouse_state.btn_mask &= (~MOUSE_B7); @@ -327,7 +327,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 6; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 6: Up\n")); + // mprintf(0, "MOUSE Button 6: Up\n"); } else if (ev->button == 6) { DDIO_mouse_state.btn_mask &= (~MOUSE_B8); @@ -337,7 +337,7 @@ int sdlMouseButtonUpFilter(SDL_Event const *event) { mevt.btn = 7; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Button 7: Up\n")); + // mprintf(0, "MOUSE Button 7: Up\n"); } return (0); @@ -370,7 +370,7 @@ int sdlMouseWheelFilter(SDL_Event const *event) { mevt.btn = 4; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Scrollwheel: Rolled Up\n")); + // mprintf(0, "MOUSE Scrollwheel: Rolled Up\n"); } else if (ev->y < 0) { /* Mouse scroll down */ DDIO_mouse_state.btn_mask |= MOUSE_B6; DIM_buttons.down_count[5]++; @@ -388,7 +388,7 @@ int sdlMouseWheelFilter(SDL_Event const *event) { mevt.btn = 5; mevt.state = false; MB_queue.send(mevt); - // mprintf((0, "MOUSE Scrollwheel: Rolled Down\n")); + // mprintf(0, "MOUSE Scrollwheel: Rolled Down\n"); } return 0; diff --git a/ddio/lnxtimer.cpp b/ddio/lnxtimer.cpp index 7eb8eb54..5f8e23d9 100644 --- a/ddio/lnxtimer.cpp +++ b/ddio/lnxtimer.cpp @@ -145,7 +145,7 @@ uint64_t timer_GetTickCount(void) }else { // timer roll over - mprintf((0,"TIMER: ROLL OVER\n")); + mprintf(0,"TIMER: ROLL OVER\n"); if(Timer_high_mark>0) Timer_accum += (Timer_high_mark - Timer_sys_start_time); Timer_high_mark = ret; diff --git a/ddio/sdljoy.cpp b/ddio/sdljoy.cpp index 5f12e2fb..b027fcee 100644 --- a/ddio/sdljoy.cpp +++ b/ddio/sdljoy.cpp @@ -200,8 +200,8 @@ static bool joy_InitStick(tJoystick joy, char *server_adr) { } Joysticks[joy].caps = caps; - mprintf((0, "JOYSTICK: Initialized stick named [%s].", caps.name)); - mprintf((0, "JOYSTICK: (%d) axes, (%d) hats, and (%d) buttons.", axes, hats, caps.num_btns)); + mprintf(0, "JOYSTICK: Initialized stick named [%s].", caps.name); + mprintf(0, "JOYSTICK: (%d) axes, (%d) hats, and (%d) buttons.", axes, hats, caps.num_btns); } return (Joysticks[joy].handle != NULL); @@ -334,7 +334,7 @@ static int joyGetNumDevs(void) { found = SDL_NumJoysticks(); } - mprintf((0, "Joystick: Found %d joysticks.", found)); + mprintf(0, "Joystick: Found %d joysticks.", found); return found; } diff --git a/ddio/winfile.cpp b/ddio/winfile.cpp index cecc946e..304e379b 100644 --- a/ddio/winfile.cpp +++ b/ddio/winfile.cpp @@ -206,7 +206,7 @@ try_again:; srchandle = CreateFile(srcname, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (desthandle == INVALID_HANDLE_VALUE || srchandle == INVALID_HANDLE_VALUE) { - mprintf((0, "Couldn't copy file time for %s! Error=%d\n", destname, GetLastError())); + mprintf(0, "Couldn't copy file time for %s! Error=%d\n", destname, GetLastError()); if (desthandle != INVALID_HANDLE_VALUE) CloseHandle(desthandle); @@ -586,7 +586,7 @@ const char *ddio_GetCDDrive(const char *vol) { // Get the drive volume name volume[0] = 0; if (!GetVolumeInformation(drivepath, volume, _MAX_PATH, &serial, &component, &volflags, fsname, MAX_FSTYPE_LEN)) { - mprintf((0, "Call to GetVolumeInformation() failed. Last error = %d\n", GetLastError())); + mprintf(0, "Call to GetVolumeInformation() failed. Last error = %d\n", GetLastError()); } if (stricmp(volume, vol) == 0) { diff --git a/ddio/winforcefeedback.cpp b/ddio/winforcefeedback.cpp index e3ecacf8..97b74e04 100644 --- a/ddio/winforcefeedback.cpp +++ b/ddio/winforcefeedback.cpp @@ -298,7 +298,7 @@ int ddio_ffjoy_Init(void) ddio_ff_Init(); if (!DI){ - mprintf((0,"ddio_ffjoy_Init: Dinput not initialized yet\n")); + mprintf(0,"ddio_ffjoy_Init: Dinput not initialized yet\n"); return FALSE; } } @@ -364,7 +364,7 @@ int ddio_ff_Acquire(tDevice dev) }break; default: if (dev > kAllDevices){ - mprintf((0,"ddio_ff_Acquire: Invalid device ID, out of range\n")); + mprintf(0,"ddio_ff_Acquire: Invalid device ID, out of range\n"); return 0; }else{ if (DID2_Joy[dev]){ @@ -374,7 +374,7 @@ int ddio_ff_Acquire(tDevice dev) }break; } }else - mprintf((0,"ddio_ff_Acquire: Direct Input object not initialized...\n")); + mprintf(0,"ddio_ff_Acquire: Direct Input object not initialized...\n"); return cnt; } @@ -419,7 +419,7 @@ int ddio_ff_Unacquire(tDevice dev) }break; default: if (dev > kAllDevices){ - mprintf((0,"ddio_ff_Unacquire: Invalid device ID, out of range\n")); + mprintf(0,"ddio_ff_Unacquire: Invalid device ID, out of range\n"); return 0; }else{ if (DID2_Joy[dev]){ @@ -429,7 +429,7 @@ int ddio_ff_Unacquire(tDevice dev) }break; } }else - mprintf((0,"ddio_ff_Unacquire: Direct Input object not initialized...\n")); + mprintf(0,"ddio_ff_Unacquire: Direct Input object not initialized...\n"); return cnt; } @@ -444,7 +444,7 @@ static int ddio_ff_SetCoopLevel(tDevice dev, int coop_level) if (!(hwin=(HWND)getwindowhandle())) { - mprintf((0,"ddio_ff_SetCoopLevel: couldn't get window handle\n")); + mprintf(0,"ddio_ff_SetCoopLevel: couldn't get window handle\n"); } // Set a single joystick @@ -454,7 +454,7 @@ static int ddio_ff_SetCoopLevel(tDevice dev, int coop_level) // Set the cooperative level to share the device // --------------------------------------------- if (IDirectInputDevice2_SetCooperativeLevel(DID2_Joy[dev], (HWND)getwindowhandle(), coop_level)!= DI_OK){ - mprintf((0,"ddio_ff_SetCoopLevel: Could not set dinput device coop level\n")); + mprintf(0,"ddio_ff_SetCoopLevel: Could not set dinput device coop level\n"); return 0; } } @@ -496,14 +496,14 @@ BOOL CALLBACK FFEnumCallback(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) // Create an instance of the device // -------------------------------- if (IDirectInput_CreateDevice(pdi, pdinst->guidInstance, &pdev, NULL)!= DI_OK){ - mprintf((0,"DIEnumJoysticks_Callback: Could not create dinput device obj\n")); + mprintf(0,"DIEnumJoysticks_Callback: Could not create dinput device obj\n"); return DIENUM_CONTINUE; } // Set the data format to the default // ---------------------------------- if (IDirectInputDevice_SetDataFormat(pdev, &c_dfDIJoystick)!= DI_OK){ - mprintf((0,"DIEnumJoysticks_Callback: Could not set dinput device data format\n")); + mprintf(0,"DIEnumJoysticks_Callback: Could not set dinput device data format\n"); IDirectInputDevice_Unacquire(pdev); IDirectInputDevice_Release (pdev); return DIENUM_CONTINUE; @@ -512,7 +512,7 @@ BOOL CALLBACK FFEnumCallback(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) // Get the DID2 from DID1 // ---------------------- if (IDirectInputDevice_QueryInterface(pdev, IID_IDirectInputDevice2, (void **) &DID2_Joy[numJoy])!= DI_OK){ - mprintf((0,"DIEnumJoysticks_Callback: QueryInterface did not return DI_OK\n")); + mprintf(0,"DIEnumJoysticks_Callback: QueryInterface did not return DI_OK\n"); IDirectInputDevice_Unacquire(pdev); IDirectInputDevice_Release (pdev); return DIENUM_CONTINUE; @@ -521,7 +521,7 @@ BOOL CALLBACK FFEnumCallback(LPCDIDEVICEINSTANCE pdinst, LPVOID pvRef) // Set the cooperative level // ------------------------- if (!ddio_ff_SetCoopLevel((tDevice)numJoy, DDIO_JOY_COOP_FLAGS)){ - mprintf((0,"DIEnumJoysticks_Callback: Could not set dinput coop level\n")); + mprintf(0,"DIEnumJoysticks_Callback: Could not set dinput coop level\n"); return FALSE; } @@ -561,13 +561,13 @@ int ddio_ffjoy_Query(int dev, int* but_flags, int* axis_flags) if (!DI){ ddio_ff_Init(); if (!DI){ - mprintf((0,"ddio_ffjoy_Query: Dinput not initialized yet\n")); + mprintf(0,"ddio_ffjoy_Query: Dinput not initialized yet\n"); return FALSE; } } if (!DID2_Joy[dev]){ - mprintf((0,"ddio_ffjoy_Query: device not found #%d\n",dev)); + mprintf(0,"ddio_ffjoy_Query: device not found #%d\n",dev); return 0; } @@ -582,12 +582,12 @@ int ddio_ffjoy_Query(int dev, int* but_flags, int* axis_flags) DICaps.dwSize = sizeof(DIDEVCAPS); if (IDirectInputDevice2_GetCapabilities(DID2_Joy[dev],&DICaps) != DI_OK){ - mprintf((0,"ddio_ffjoy_Query: Failed getting device caps\n")); + mprintf(0,"ddio_ffjoy_Query: Failed getting device caps\n"); return 0; } if (DICaps.dwFlags & DIDC_FORCEFEEDBACK){ - mprintf((0,"ddio_ff_joy_Query: ffb support\n")); + mprintf(0,"ddio_ff_joy_Query: ffb support\n"); maskFFB |= 1<= DDIO_FF_MAXEFFECTS){ - mprintf((0,"ddio_ffb_effectCreate: Reached hardcoded limit for # of effects.\n")); + mprintf(0,"ddio_ffb_effectCreate: Reached hardcoded limit for # of effects.\n"); return -1; } @@ -933,7 +933,7 @@ int ddio_ffb_effectCreate(tDevice dev, tFFB_Effect* eff) ddEffect[numEffects].general.cbTypeSpecificParams = sizeof(DICONDITION); break; default: - mprintf((0,"ddio_ffb_effectCreate: bad effect subType\n")); + mprintf(0,"ddio_ffb_effectCreate: bad effect subType\n"); return -1; } @@ -948,10 +948,10 @@ int ddio_ffb_effectCreate(tDevice dev, tFFB_Effect* eff) numEffects++; return (numEffects-1); case DIERR_DEVICENOTREG: - mprintf((0,"ddio_ffb_effectCreate: effect not created, DIERR_DEVICENOTREG\n")); + mprintf(0,"ddio_ffb_effectCreate: effect not created, DIERR_DEVICENOTREG\n"); return -1; case DIERR_DEVICEFULL: - mprintf((0,"ddio_ffb_effectCreate: effect not created, DIERR_DEVICEFULL\n")); + mprintf(0,"ddio_ffb_effectCreate: effect not created, DIERR_DEVICEFULL\n"); return -1; default: PrintDirectInputErrorString(hr,"Force Effect Create"); @@ -1144,26 +1144,26 @@ void ddio_ffb_GetEffectData(int16_t eID, int* Direction, uint32_t* Duration, uin static int ddio_ffjoy_AcquireErr(HRESULT res, int dev_num) { if (res == DI_OK){ - mprintf((0,"device #%d acquired\n",dev_num)); + mprintf(0,"device #%d acquired\n",dev_num); return TRUE; } else if (res == S_FALSE){ - mprintf((0,"device #%d already acquired\n",dev_num)); + mprintf(0,"device #%d already acquired\n",dev_num); return TRUE; } else if (res == DIERR_INVALIDPARAM){ - mprintf((0,"device %d DIERR_INVALIDPARAM\n",dev_num)); + mprintf(0,"device %d DIERR_INVALIDPARAM\n",dev_num); return FALSE; } else if (res == DIERR_OTHERAPPHASPRIO){ - mprintf((0,"device %d DIERR_OTHERAPPHASPRIO\n",dev_num)); + mprintf(0,"device %d DIERR_OTHERAPPHASPRIO\n",dev_num); return TRUE; } else - mprintf((0,"Unknown Error acquiring device %d\n",dev_num)); + mprintf(0,"Unknown Error acquiring device %d\n",dev_num); return FALSE; } @@ -1176,26 +1176,26 @@ static int ddio_ffjoy_AcquireErr(HRESULT res, int dev_num) static int ddio_ffjoy_UnacquireErr(HRESULT res, int dev_num) { if (res == DI_OK){ - mprintf((0,"device #%d unacquired\n",dev_num)); + mprintf(0,"device #%d unacquired\n",dev_num); return TRUE; } else if (res == S_FALSE){ - mprintf((0,"device #%d already unacquired\n",dev_num)); + mprintf(0,"device #%d already unacquired\n",dev_num); return TRUE; } else if (res == DIERR_INVALIDPARAM){ - mprintf((0,"device %d DIERR_INVALIDPARAM\n",dev_num)); + mprintf(0,"device %d DIERR_INVALIDPARAM\n",dev_num); return FALSE; } else if (res == DIERR_OTHERAPPHASPRIO){ - mprintf((0,"device %d DIERR_OTHERAPPHASPRIO\n",dev_num)); + mprintf(0,"device %d DIERR_OTHERAPPHASPRIO\n",dev_num); return TRUE; } else - mprintf((0,"Unknown Error unacquiring device %d\n",dev_num)); + mprintf(0,"Unknown Error unacquiring device %d\n",dev_num); return FALSE; } @@ -1232,7 +1232,7 @@ void ddio_LoadImmersionDLL(void) if(ImmersionHandle==NULL){ //not found - mprintf((0,"Force: Unable to find Immersion DLL\n")); + mprintf(0,"Force: Unable to find Immersion DLL\n"); return; } @@ -1244,12 +1244,12 @@ void ddio_LoadImmersionDLL(void) if( !d_IFLoadProjectFile || !d_IFReleaseProject || !d_IFCreateEffects){ - mprintf((0,"Force: Unable to bind Immersion functions\n")); + mprintf(0,"Force: Unable to bind Immersion functions\n"); ddio_FreeImmersionDLL(); return; } - mprintf((0,"Immersion IFORCE2 DLL loaded successfully\n")); + mprintf(0,"Immersion IFORCE2 DLL loaded successfully\n"); } void ddio_FreeImmersionDLL(void) @@ -1274,7 +1274,7 @@ FORCEPROJECT ddio_ForceLoadProject(char *filename,tDevice dev) } if( dev < 0 || dev >kMaxJoy ){ - mprintf((0,"illegal device id passed to ddio_ForceLoadProject() - %d\n",(int)dev)); + mprintf(0,"illegal device id passed to ddio_ForceLoadProject() - %d\n",(int)dev); return NULL; } @@ -1381,7 +1381,7 @@ void PrintDirectInputErrorString( HRESULT hr,const char *format, ... ) if(hr==S_FALSE){ strcat(buffer,"*S_FALSE\n"); - mprintf((0,buffer)); + mprintf(0,buffer); return; } @@ -1467,7 +1467,7 @@ void PrintDirectInputErrorString( HRESULT hr,const char *format, ... ) strcat(buffer,"*The function called is not supported at this time. This value is equal to the E_NOTIMPL standard COM return value. \n"); if(hr==E_PENDING) strcat(buffer,"*Data is not yet available.\n"); - mprintf((0,buffer)); + mprintf(0,buffer); } #else diff --git a/ddio/winio.cpp b/ddio/winio.cpp index b6babf62..5edc69f9 100644 --- a/ddio/winio.cpp +++ b/ddio/winio.cpp @@ -134,7 +134,7 @@ bool ddio_InternalInit(ddio_init_info *init_info) { ASSERT(!DDIO_init); // Initialize DirectInput subsystem - mprintf((0, "DI system initializing.\n")); + mprintf(0, "DI system initializing.\n"); // Try to open DirectX 5.00 dires = DirectInputCreate((HINSTANCE)obj->m_hInstance, DIRECTINPUT_VERSION, &lpdi, NULL); @@ -175,7 +175,7 @@ void ddio_InternalClose() { DInputData.lpdi = NULL; DDIO_init = 0; - mprintf((0, "DI system closed.\n")); + mprintf(0, "DI system closed.\n"); } #ifdef _DEBUG @@ -187,9 +187,9 @@ void ddio_DebugMessage(unsigned err, char *fmt, ...) { std::vsnprintf(buf, 128, fmt, arglist); va_end(arglist); - mprintf((0, "DDIO: %s\n", buf)); + mprintf(0, "DDIO: %s\n", buf); if (err) { - mprintf((1, "DIERR %x.\n", err)); + mprintf(1, "DIERR %x.\n", err); } } #endif diff --git a/ddio/winjoy.cpp b/ddio/winjoy.cpp index 8aa2916e..e25352f0 100644 --- a/ddio/winjoy.cpp +++ b/ddio/winjoy.cpp @@ -168,7 +168,7 @@ bool joy_Init(bool emulation) { // initializes forcefeedback system? if (ddio_ff_Init()) { - mprintf((0, "DDForce: Force Feedback Joystick Found\n")); + mprintf(0, "DDForce: Force Feedback Joystick Found\n"); } // initialize data structures. @@ -453,7 +453,7 @@ void joymm_get_pos(tJoystick handle, tJoyPos *pos) { if (joy_chpro_hack) { if (ji.dwButtons > 0 && ji.dwButtons <= 32) { pos->buttons = 1 << (ji.dwButtons - 1); - mprintf((0, "btns=%x\n", pos->buttons)); + mprintf(0, "btns=%x\n", pos->buttons); } } else { pos->buttons = (unsigned)ji.dwButtons; @@ -462,8 +462,8 @@ void joymm_get_pos(tJoystick handle, tJoyPos *pos) { pos->btn = (unsigned)ji.dwButtonNumber; #ifdef _DEBUG - mprintf_at((4, handle + 1, 0, "%d:X:%04d Y:%04d Z:%04d %d:R:%04d U:%04d V:%04d", handle, pos->x, pos->y, pos->z, - pos->r, pos->u, pos->v, pos->buttons)); + mprintf_at(4, handle + 1, 0, "%d:X:%04d Y:%04d Z:%04d %d:R:%04d U:%04d V:%04d", handle, pos->x, pos->y, pos->z, + pos->r, pos->u, pos->v, pos->buttons); #endif } @@ -562,10 +562,10 @@ retry_joy_input: } #ifdef _DEBUG - mprintf_at((4, (handle * 2) + 1, 0, "J%d:X:%04d Y:%04d Z:%04d Rz:%04d S0:%04d S1:%04d", handle, pos->x, pos->y, - pos->z, pos->r, pos->u, pos->v)); - mprintf_at((4, (handle * 2) + 2, 0, " POV0:%04d POV1:%04d POV2:%04d POV3:%04d", handle, pos->pov[0], pos->pov[1], - pos->pov[2], pos->pov[3])); + mprintf_at(4, (handle * 2) + 1, 0, "J%d:X:%04d Y:%04d Z:%04d Rz:%04d S0:%04d S1:%04d", handle, pos->x, pos->y, + pos->z, pos->r, pos->u, pos->v); + mprintf_at(4, (handle * 2) + 2, 0, " POV0:%04d POV1:%04d POV2:%04d POV3:%04d", handle, pos->pov[0], pos->pov[1], + pos->pov[2], pos->pov[3]); #endif } @@ -607,7 +607,7 @@ tJoystick joydi_init_stick(int ffjoyid) { dicaps.dwSize = sizeof(DIDEVCAPS); if (lpdidev2->GetCapabilities(&dicaps) != DI_OK) { - mprintf((0, "ddio_ffjoy_Query: Failed getting device caps\n")); + mprintf(0, "ddio_ffjoy_Query: Failed getting device caps\n"); return -1; } diff --git a/ddio/winkey.cpp b/ddio/winkey.cpp index 27423e9c..77ffa3dd 100644 --- a/ddio/winkey.cpp +++ b/ddio/winkey.cpp @@ -298,7 +298,7 @@ retry_key_init: WKD.nextframe = false; uintptr_t thrid = _beginthread(dikey_Thread, 0, nullptr); if (thrid == -1) { - mprintf((0, "DDIO: DI_Keyboard thread failed to initialize.\n")); + mprintf(0, "DDIO: DI_Keyboard thread failed to initialize.\n"); WKD.thread_active = false; WKD.lpdikey = NULL; WKD.thread = 0xffffffff; @@ -317,7 +317,7 @@ retry_key_init: if (SetThreadPriority((HANDLE)thrid, THREAD_PRIORITY_TIME_CRITICAL) == FALSE) { SetThreadPriority((HANDLE)thrid, THREAD_PRIORITY_HIGHEST); } - mprintf((0, "DDIO: DI_Keyboard initialized.\n")); + mprintf(0, "DDIO: DI_Keyboard initialized.\n"); } } else { // failed to acquire device? can't do. @@ -355,7 +355,7 @@ void ddio_InternalKeyClose() { WKD.thread = 0xffffffff; WKD.evtnotify = NULL; WKD.lpdikey = NULL; - mprintf((0, "DDIO: DI_Keyboard shutdown.\n")); + mprintf(0, "DDIO: DI_Keyboard shutdown.\n"); } if (WKD.winhook) { ddio_Win_KeyClose(); @@ -383,7 +383,7 @@ float ddio_InternalKeyDownTime(uint8_t key) { DWORD curtickcount = GetTickCount(); DWORD ticks = curtickcount - WKeys[key].down_ticks; if (ticks == 0) { - // mprintf((0, "ticks=%d\n", ticks)); + // mprintf(0, "ticks=%d\n", ticks); } WKeys[key].down_ticks = curtickcount; down_time = (ticks / 1000.0f); @@ -642,12 +642,12 @@ void __cdecl dikey_Thread(void *dp) { if (key == KEY_LCTRL) { WKeys[key].mutex_flag = true; } - mprintf((0, "dkey=%x\n", key)); + mprintf(0, "dkey=%x\n", key); } else { if (WKeys[key].status) { WKeys[key].up_ticks = diobjdata[i].dwTimeStamp; WKeys[key].status = false; - mprintf((0, "ukey=%x\n", key)); + mprintf(0, "ukey=%x\n", key); } } @@ -694,7 +694,7 @@ bool ddio_Win_KeyInit() { return false; } - mprintf((0, "Keyboard initialized.\n")); + mprintf(0, "Keyboard initialized.\n"); return true; } @@ -706,7 +706,7 @@ void ddio_Win_KeyClose() { WKD.winhook = NULL; } - mprintf((0, "Keyboard released.\n")); + mprintf(0, "Keyboard released.\n"); } // ---------------------------------------------------------------------------- diff --git a/ddio/wintimer.cpp b/ddio/wintimer.cpp index 45eb6386..28985924 100644 --- a/ddio/wintimer.cpp +++ b/ddio/wintimer.cpp @@ -68,12 +68,12 @@ bool timer_Init(int preemptive, bool force_lores) { if (force_lores) { Timer_use_highres_timer = false; - mprintf((0, "Timer: Forcing to Lo-Res Timer\n")); + mprintf(0, "Timer: Forcing to Lo-Res Timer\n"); } else { if (timerhi_Init()) - mprintf((0, "Timer: Hi-Resolution Timer available\n")); + mprintf(0, "Timer: Hi-Resolution Timer available\n"); else - mprintf((0, "Timer: Hi-Resolution Timer NOT available\n")); + mprintf(0, "Timer: Hi-Resolution Timer NOT available\n"); } if (!Timer_firstinit) { @@ -103,12 +103,12 @@ bool timer_Init(int preemptive, bool force_lores) { //@@ Timer_event_id = timeSetEvent(TIMER_CLOCK_RATE, Timer_resolution, timer_Proc, 0, TIME_PERIODIC); //@@ if (Timer_event_id == 0) Error("Unable to instantiate the timer procedure.\n"); //@@ - //@@ mprintf((0, "Preemptive timer system initialized.\n")); - mprintf((0, "No preemptive timer, default to non-preemptive!")); + //@@ mprintf(0, "Preemptive timer system initialized.\n"); + mprintf(0, "No preemptive timer, default to non-preemptive!"); Int3(); Timer_preemptive = 0; } else { - mprintf((0, "Timer system initialized.\n")); + mprintf(0, "Timer system initialized.\n"); Timer_preemptive = 0; } @@ -132,7 +132,7 @@ bool timer_Init(int preemptive, bool force_lores) { void timer_Close() { ASSERT(Timer_initialized); - // mprintf((0, "Timer system closed.\n")); + // mprintf(0, "Timer system closed.\n"); if (Timer_use_highres_timer) { timerhi_Close(); diff --git a/grtext/grfont.cpp b/grtext/grfont.cpp index 4acb8872..e2f768ef 100644 --- a/grtext/grfont.cpp +++ b/grtext/grfont.cpp @@ -296,7 +296,7 @@ int grfont_Load(const char *fname) { if (!ff) { return false; } else if (ff == (FONTFILE)0xffffffff) { - mprintf((0, "Illegal font file: %s.\n", fname)); + mprintf(0, "Illegal font file: %s.\n", fname); return false; } @@ -318,10 +318,10 @@ int grfont_Load(const char *fname) { } fnt.brightness = ((fnt.baseline >> 8) / 10.0f); - - // mprintf((0, "%s font.\n", fname)); - // mprintf((0, " ::::::", fnt.height, fnt.min_ascii, fnt.max_ascii, - // fnt.baseline)); +/* + mprintf(0, "%s font.\n", fname); + mprintf(0, " ::::::", fnt.height, fnt.min_ascii, fnt.max_ascii, fnt.baseline); +*/ num_char = fnt.max_ascii - fnt.min_ascii + 1; if (fnt.max_ascii < 'a') { @@ -333,7 +333,7 @@ int grfont_Load(const char *fname) { fnt.char_widths = (uint8_t *)mem_malloc(sizeof(uint8_t) * num_char); for (i = 0; i < num_char; i++) fnt.char_widths[i] = (uint8_t)READ_FONT_SHORT(ff); - // mprintf((0, "::proportional")); + // mprintf(0, "::proportional"); } else { fnt.char_widths = NULL; } @@ -368,7 +368,7 @@ int grfont_Load(const char *fname) { if (fnt.flags & FT_COLOR) { int off = 0; - // mprintf((0, "::color")); + // mprintf(0, "::color"); for (i = 0; i < num_char; i++) { fnt.char_data[i] = fnt.raw_data + off; if (fnt.flags & FT_PROPORTIONAL) @@ -378,7 +378,7 @@ int grfont_Load(const char *fname) { } } else { // Monochrome uint8_t *ptr = fnt.raw_data; - // mprintf((0, "::mono")); + // mprintf(0, "::mono"); for (i = 0; i < num_char; i++) { fnt.char_data[i] = ptr; if (fnt.flags & FT_PROPORTIONAL) @@ -391,7 +391,7 @@ int grfont_Load(const char *fname) { // Then read in CLOSE_FONT(ff); - // mprintf((0, "\n")); + // mprintf(0, "\n"); strcpy(Fonts[handle].filename, fname); Fonts[handle].references = 1; @@ -553,7 +553,7 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { if (!ffin) { return false; } else if (ffin == (FONTFILE)0xffffffff) { - mprintf((0, "Illegal font file %s\n", pathname)); + mprintf(0, "Illegal font file %s\n", pathname); return false; } diff --git a/legacy/D3Launch/3D_detect.cpp b/legacy/D3Launch/3D_detect.cpp index 6101eeb3..62da2350 100644 --- a/legacy/D3Launch/3D_detect.cpp +++ b/legacy/D3Launch/3D_detect.cpp @@ -124,7 +124,7 @@ HRESULT WINAPI gr_d3d_enum( LPGUID lpGUID, { int use_it = 0; -// mprintf(( "Found 3d device %s: %s\n", lpDeviceName, lpDeviceDescription )); +// mprintf( "Found 3d device %s: %s\n", lpDeviceName, lpDeviceDescription ); if ( lpHWDesc && lpHWDesc->dwFlags != 0 ) { use_it = 1; @@ -166,7 +166,7 @@ BOOL WINAPI gr_d2d_enum( LPGUID lpGUID, d3d_device *d2d = (d3d_device *)&D2D_devices[Num_d2d_devices++]; -// mprintf(( "Found 2d device %s: %s\n", lpDeviceName, lpDeviceDescription )); +// mprintf( "Found 2d device %s: %s\n", lpDeviceName, lpDeviceDescription ); if ( lpGUID ) { memmove( &d2d->guid_2d, lpGUID, sizeof(GUID) ); @@ -263,7 +263,7 @@ D3DError: lpDD1->Release(); lpDD1 = NULL; } - //mprintf(( "Direct3D Polling failed.\n" )); + //mprintf( "Direct3D Polling failed.\n" ); return; } @@ -274,7 +274,7 @@ void check_glide() module *GlideDLLHandle; if ( !(GlideDLLHandle=LoadGlideDLL()) ) { - //mprintf(( "Glide DLL not found!\n" )); + //mprintf( "Glide DLL not found!\n" ); return; } diff --git a/legacy/D3Launch/OS_Config.cpp b/legacy/D3Launch/OS_Config.cpp index 75184526..1ee12fb5 100644 --- a/legacy/D3Launch/OS_Config.cpp +++ b/legacy/D3Launch/OS_Config.cpp @@ -88,12 +88,12 @@ void os_config_remove( char *section, char *name ) // remove the value if ( !name ) { if ( !section ) { - ////mprintf(( "Can't delete root key\n" )); + ////mprintf( "Can't delete root key\n" ); goto Cleanup; } lResult = RegDeleteKey( HKEY_LOCAL_MACHINE, keyname ); if ( lResult != ERROR_SUCCESS ) { - ////mprintf(( "Error removing registry key '%s'\n", name )); + ////mprintf( "Error removing registry key '%s'\n", name ); goto Cleanup; } } else { @@ -108,13 +108,13 @@ void os_config_remove( char *section, char *name ) &dwDisposition ); // Location to store status of key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } lResult = RegDeleteValue( hKey, name ); if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error removing registry value '%s'\n", name )); + //mprintf( "Error removing registry value '%s'\n", name ); goto Cleanup; } } @@ -153,12 +153,12 @@ void os_config_write_string( char *section, char *name, char *value ) &dwDisposition ); // Location to store status of key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -170,7 +170,7 @@ void os_config_write_string( char *section, char *name, char *value ) strlen(value) ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error writing registry key '%s'\n", name )); + //mprintf( "Error writing registry key '%s'\n", name ); goto Cleanup; } @@ -206,12 +206,12 @@ void os_config_write_string2( char *section, char *name, char *value ) &dwDisposition ); // Location to store status of key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -223,7 +223,7 @@ void os_config_write_string2( char *section, char *name, char *value ) strlen(value) ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error writing registry key '%s'\n", name )); + //mprintf( "Error writing registry key '%s'\n", name ); goto Cleanup; } @@ -259,12 +259,12 @@ void os_config_write_uint( char *section, char *name, uint32_t value ) &dwDisposition ); // Location to store status of key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -276,7 +276,7 @@ void os_config_write_uint( char *section, char *name, uint32_t value ) 4 ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error writing registry key '%s'\n", name )); + //mprintf( "Error writing registry key '%s'\n", name ); goto Cleanup; } @@ -318,12 +318,12 @@ char * os_config_read_string( char *section, char *name, char *default_value ) &hKey ); // Location to store key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -336,7 +336,7 @@ char * os_config_read_string( char *section, char *name, char *default_value ) &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error reading registry key '%s'\n", name )); + //mprintf( "Error reading registry key '%s'\n", name ); goto Cleanup; } @@ -365,12 +365,12 @@ char * os_config_read_string_ex( char *keyname, char *name, char *default_value &hKey ); // Location to store key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -383,7 +383,7 @@ char * os_config_read_string_ex( char *keyname, char *name, char *default_value &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error reading registry key '%s'\n", name )); + //mprintf( "Error reading registry key '%s'\n", name ); goto Cleanup; } @@ -417,12 +417,12 @@ char * os_config_read_string2( char *section, char *name, char *default_value ) &hKey ); // Location to store key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -435,7 +435,7 @@ char * os_config_read_string2( char *section, char *name, char *default_value ) &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error reading registry key '%s'\n", name )); + //mprintf( "Error reading registry key '%s'\n", name ); goto Cleanup; } @@ -473,12 +473,12 @@ uint32_t os_config_read_uint( char *section, char *name, uint32_t default_value &hKey ); // Location to store key if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error opening registry key '%s'\n", keyname )); + //mprintf( "Error opening registry key '%s'\n", keyname ); goto Cleanup; } if ( !name ) { - //mprintf(( "No variable name passed\n" )); + //mprintf( "No variable name passed\n" ); goto Cleanup; } @@ -491,7 +491,7 @@ uint32_t os_config_read_uint( char *section, char *name, uint32_t default_value &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { - //mprintf(( "Error reading registry key '%s'\n", name )); + //mprintf( "Error reading registry key '%s'\n", name ); goto Cleanup; } diff --git a/legacy/D3Launch/UpdateDlg.cpp b/legacy/D3Launch/UpdateDlg.cpp index 1f989390..426d339f 100644 --- a/legacy/D3Launch/UpdateDlg.cpp +++ b/legacy/D3Launch/UpdateDlg.cpp @@ -1245,7 +1245,7 @@ void CUpdateDlg::CloseHTTP() DeferMessages(); if (WSACleanup()) { - //mprintf(( "Error closing wsock!" )); + //mprintf( "Error closing wsock!" ); } StatusBar(IDS_UPDATEDLG_WAITING); diff --git a/legacy/FontEditor/FontCreate.cpp b/legacy/FontEditor/FontCreate.cpp index 3f070971..beba3d2e 100644 --- a/legacy/FontEditor/FontCreate.cpp +++ b/legacy/FontEditor/FontCreate.cpp @@ -168,7 +168,7 @@ int read_font_char(int cur_char, int& bmx, int& bmy) int w,h,x,y; bool box_edge = false; - mprintf((0," %d-(%d,%d)",cur_char,bmx,bmy)); + mprintf(0," %d-(%d,%d)",cur_char,bmx,bmy); while (PIX(bmx+1,bmy+1) == m_BoxColor) bmx++; //deal with double-thick vertical lines @@ -244,7 +244,7 @@ int read_font_char(int cur_char, int& bmx, int& bmy) else if (! (m_FgColor & 0xf000)) // 4444 check for alpha m_FgColor = c; else if (m_FgColor != c) { // OLD_COMMENT-c here is 1555 !! remember this. - m_FontType = COLOR_FONT; // mprintf((0, "%d,%d\n", bmx+1+x, bmy+1+y)); + m_FontType = COLOR_FONT; // mprintf(0, "%d,%d\n", bmx+1+x, bmy+1+y); } // if (c != 0) @@ -302,7 +302,7 @@ bool extract_font(int bm_handle, tFontFileInfo *ft) // assume upper left pixel is background color, and first-found other // color is box color m_BgColor = PIX(0,0); - mprintf((0, "m_BgColor=%04x\n", m_BgColor)); + mprintf(0, "m_BgColor=%04x\n", m_BgColor); for (bmy = 0;bmy < m_FontBmH; bmy++) { @@ -311,11 +311,11 @@ bool extract_font(int bm_handle, tFontFileInfo *ft) } m_BoxColor = PIX(bmx,bmy); - mprintf((0, "m_BoxColor=%04x\n", m_BoxColor)); + mprintf(0, "m_BoxColor=%04x\n", m_BoxColor); // Get all data from current line. - mprintf((0, "Parsing font...")); - mprintf((0," read_characters: ")); + mprintf(0, "Parsing font..."); + mprintf(0," read_characters: "); for (cur_char=0;bmy < m_FontBmH && cur_charmax_turn_rate; m_ai_fov = acos(ai_info->fov)*(360.0/PI); -// mprintf((0, "FOV = %f\n.", ai_info->fov)); +// mprintf(0, "FOV = %f\n.", ai_info->fov); m_orient_to_vel = (ai_info->flags & AIF_ORIENT_TO_VEL) != 0; m_xz_dist = (ai_info->flags & AIF_XZ_DIST) != 0; @@ -502,7 +502,7 @@ void CAISettingsDlg::OnOK() m_ai_info->flags |= AIF_TEAM_HOSTILE; else { - mprintf((0, "ERROR: No team\n")); + mprintf(0, "ERROR: No team\n"); Int3(); } diff --git a/legacy/editor/AmbientSoundPattern.cpp b/legacy/editor/AmbientSoundPattern.cpp index 27942ed8..c658cae3 100644 --- a/legacy/editor/AmbientSoundPattern.cpp +++ b/legacy/editor/AmbientSoundPattern.cpp @@ -550,7 +550,7 @@ void CAmbientSoundPattern::OnASPUndoLock() //Delete local page if (!mng_DeletePage (AMBIENT_FILE_NAME,PAGETYPE_GAMEFILE,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } diff --git a/legacy/editor/BriefEdit.cpp b/legacy/editor/BriefEdit.cpp index e7b9384d..fce4da2f 100644 --- a/legacy/editor/BriefEdit.cpp +++ b/legacy/editor/BriefEdit.cpp @@ -1752,7 +1752,7 @@ void CBriefEdit::OnBriefScreenAdd() combo->SetCurSel(sel); OnSelchangeBriefScreenList(); UpdateLayoutBitmap(); - mprintf((0,"Added a screen\n")); + mprintf(0,"Added a screen\n"); } } @@ -1975,13 +1975,13 @@ void CBriefEdit::ParseLayoutScreenFile(char *filename) if(num_layouts<=0){ cfclose(file); - mprintf((0,"Zero or less Layout Screens in Layout File\n")); + mprintf(0,"Zero or less Layout Screens in Layout File\n"); return; } layouts = (tLayoutScreen *)mem_malloc(sizeof(tLayoutScreen)*num_layouts); if(!layouts){ - mprintf((0,"Out of memory loading layout screens...trying to load %d screens\n",num_layouts)); + mprintf(0,"Out of memory loading layout screens...trying to load %d screens\n",num_layouts); num_layouts = 0; cfclose(file); return; diff --git a/legacy/editor/D3Splash.cpp b/legacy/editor/D3Splash.cpp index 8b12984e..2e13d52e 100644 --- a/legacy/editor/D3Splash.cpp +++ b/legacy/editor/D3Splash.cpp @@ -90,7 +90,7 @@ void CD3Splash::PutText(char *buf) lstrcpy(&m_TextLines[m_CurLine-1][0], buf); -// mprintf((1, "%d:%s",m_CurLine-1, m_TextLines[m_CurLine-1])); +// mprintf(1, "%d:%s",m_CurLine-1, m_TextLines[m_CurLine-1]); SetRect(&rect, SPLASHTEXT_LEFT, SPLASHTEXT_TOP, SPLASHTEXT_RIGHT, SPLASHTEXT_BOTTOM); InvalidateRect(&rect, FALSE); diff --git a/legacy/editor/EPath.cpp b/legacy/editor/EPath.cpp index b7dc8fd9..6343f51e 100644 --- a/legacy/editor/EPath.cpp +++ b/legacy/editor/EPath.cpp @@ -106,7 +106,7 @@ int AllocGamePath () GamePaths[i].flags=0; GamePaths[i].pathnodes=(node *) mem_malloc (MAX_NODES_PER_PATH * sizeof(node)); - mprintf((0, "Path %d got some\n", i)); + mprintf(0, "Path %d got some\n", i); Num_game_paths++; return i; @@ -567,7 +567,7 @@ void DrawNumber (int num,vector pos,float size) int num_numbers = log10(num) + 1; if (num_numbers > 10) { - mprintf((0, "Cannot represent a number with over 10 digits\n")); + mprintf(0, "Cannot represent a number with over 10 digits\n"); Int3(); return; } diff --git a/legacy/editor/Erooms.cpp b/legacy/editor/Erooms.cpp index e726ab2a..895d49f5 100644 --- a/legacy/editor/Erooms.cpp +++ b/legacy/editor/Erooms.cpp @@ -823,7 +823,7 @@ void SaveRoom (int n,char *filename) outfile=(CFILE *)cfopen (filename,"wb"); if (!outfile) { - mprintf ((0,"Couldn't save room %s!\n",filename)); + mprintf(0,"Couldn't save room %s!\n",filename); Int3(); return; } @@ -951,7 +951,7 @@ void SaveRoom (int n,char *filename) cfclose (outfile); - mprintf ((0,"Room file %s saved.\n",filename)); + mprintf(0,"Room file %s saved.\n",filename); } @@ -1196,7 +1196,7 @@ int CheckFaceConcavity(int num_verts,int16_t *face_verts,vector *normal,vector * dot /= sqrt(i0*i0 + j0*j0) * sqrt(i1*i1 + j1*j1); if (dot > CONCAVITY_TOLERANCE) { //we have a concavity! - //mprintf((0,"Concavity check dot = %f\n",dot)); + //mprintf(0,"Concavity check dot = %f\n",dot); return vn; //..so return this vertex number } } @@ -1217,7 +1217,7 @@ bool ResetRoomFaceNormals(room *rp) bad_normals++; if (bad_normals > 0) { - mprintf((1,"Warning: Room %d has %d bad or low-precision normals\n",ROOMNUM(rp),bad_normals)); + mprintf(1,"Warning: Room %d has %d bad or low-precision normals\n",ROOMNUM(rp),bad_normals); return 0; } else @@ -1295,7 +1295,7 @@ void FixConcaveFaces (room *rp,int *facelist,int facecount) int num_new_faces=concave_count-3; ASSERT (num_new_faces>0); - mprintf ((0,"Creating %d new faces from face %d!\n",num_new_faces,facelist[i])); + mprintf(0,"Creating %d new faces from face %d!\n",num_new_faces,facelist[i]); // copy the concave vert indices for later use for (t=0;tused && (rp->num_portals > 0) && !(rp->flags & RF_EXTERNAL)) { @@ -3298,9 +3298,9 @@ int ComputeAllRoomShells() } } - mprintf((0,"Done\n")); + mprintf(0,"Done\n"); - mprintf((0,"Error buf size = %d\n",strlen(error_buf))); + mprintf(0,"Error buf size = %d\n",strlen(error_buf)); DumpTextToClipboard(error_buf); diff --git a/legacy/editor/FilePageDialog.cpp b/legacy/editor/FilePageDialog.cpp index 1fc13f34..99dae839 100644 --- a/legacy/editor/FilePageDialog.cpp +++ b/legacy/editor/FilePageDialog.cpp @@ -126,7 +126,7 @@ void CFilePageDialog::OnAddFile() strcpy (Gamefiles[gamefile_handle].dir_name,dlg.m_SelectedDestDir); // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of '%s' locally...\n",cur_name)); + mprintf(0,"Making a copy of '%s' locally...\n",cur_name); char destname[100]; ddio_MakePath(destname,LocalD3Dir,"data",dlg.m_SelectedDestDir,Gamefiles[gamefile_handle].name,NULL); @@ -357,7 +357,7 @@ void CFilePageDialog::OnDeleteFile() mng_FreeTrackLock (tl); if (!mng_DeletePage (Gamefiles[n].name,PAGETYPE_GAMEFILE,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } diff --git a/legacy/editor/GrFontDialog.cpp b/legacy/editor/GrFontDialog.cpp index 1ac7e662..b63f4a2f 100644 --- a/legacy/editor/GrFontDialog.cpp +++ b/legacy/editor/GrFontDialog.cpp @@ -209,14 +209,14 @@ void CGrFontDialog::OnNew() if (m_FontPicBm > -1) bm_FreeBitmap(m_FontPicBm); m_FontPicBm = -1; - mprintf((0, "Loading font template: %s...", filename)); + mprintf(0, "Loading font template: %s...", filename); bm_handle = bm_AllocLoadFileBitmap(filename, 0); if (bm_handle<0) { - mprintf((0, "shit!\n")); + mprintf(0, "shit!\n"); OutrageMessageBox ("Couldn't open the font template file."); return; } - mprintf((0, "finished!\n")); + mprintf(0, "finished!\n"); m_FontPicBm = bm_handle; @@ -452,8 +452,8 @@ BOOL CGrFontDialog::extract_font(gr_font_file_record *ft) m_BoxColor = PIX(bmx,bmy); // Get all data from current line. - mprintf((0, "Parsing font...")); - mprintf((0," read_characters: ")); + mprintf(0, "Parsing font..."); + mprintf(0," read_characters: "); for (cur_char=0;bmy < m_FontBmH && cur_charkern_data= NULL; // write to file - mprintf((0, "Saving font data...")); + mprintf(0, "Saving font data..."); // sprintf(filename, "%s\\%s", LocalManageGraphicsDir, m_FontFileName); ffile = OPEN_FONT(m_FontFileName); if (!ffile) { @@ -727,7 +727,7 @@ BOOL CGrFontDialog::save_font_file(gr_font_file_record *ft) // Close font. CLOSE_FONT(ffile); - mprintf((0, "Done.\n")); + mprintf(0, "Done.\n"); ft->raw_data = tmp_data; ft->char_widths = tmp_widths; diff --git a/legacy/editor/GrListBox.cpp b/legacy/editor/GrListBox.cpp index 8135f53e..eaef5c1b 100644 --- a/legacy/editor/GrListBox.cpp +++ b/legacy/editor/GrListBox.cpp @@ -195,7 +195,7 @@ void CGrListBox::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) // tex_start accordingly. SCROLLINFO si; - // mprintf((0, "scroll new_pos = %d. original_pos = %d\n", new_pos, cur_pos)); + // mprintf(0, "scroll new_pos = %d. original_pos = %d\n", new_pos, cur_pos); if (new_pos < cur_pos) RowUp(cur_pos-new_pos); if (new_pos > cur_pos) RowDown(new_pos-cur_pos); @@ -231,11 +231,11 @@ bool CGrListBox::RowUp(int rows, bool draw) olditem = m_ListItem; m_ListItem = ListPrevItem(m_ListItem); - //mprintf((0, "m_ListItem = %d\n", m_ListItem)); + //mprintf(0, "m_ListItem = %d\n", m_ListItem); if (m_ListItem > olditem) { m_ListItem = olditem; done = 1; - // mprintf((0, "m_ListItem = %d\n", m_ListItem)); + // mprintf(0, "m_ListItem = %d\n", m_ListItem); } else if (old<=m_ListItem) { m_ListItem=old; diff --git a/legacy/editor/HObject.cpp b/legacy/editor/HObject.cpp index 83502b2e..a31e1c81 100644 --- a/legacy/editor/HObject.cpp +++ b/legacy/editor/HObject.cpp @@ -492,7 +492,7 @@ void HObjectMove(int objnum, float dx, float dy, float dz) object *ref_obj; //the object in whose frame of reference we're moving if (objnum == -1) { - mprintf((0, "HObjectMove:No current object.\n")); + mprintf(0, "HObjectMove:No current object.\n"); return; } @@ -635,7 +635,7 @@ bool MoveObject(object * obj, vector *newpos) fate = fvi_FindIntersection(&fq, &hit_info); - mprintf((0,"fate = %d\n", fate)); + mprintf(0,"fate = %d\n", fate); //Check for object can't move, meaning it's stuck in the wall if (fate == HIT_WALL) diff --git a/legacy/editor/HRoom.cpp b/legacy/editor/HRoom.cpp index 6be40055..09eaf105 100644 --- a/legacy/editor/HRoom.cpp +++ b/legacy/editor/HRoom.cpp @@ -563,8 +563,8 @@ void ComputePlacedRoomMatrix() vm_VectorToMatrix(&srcmat,&t,NULL,NULL); vm_VectorAngleToMatrix(&Placed_room_orient,&Placed_room_orient.fvec,Placed_room_angle); - mprintf((0,"srcmat: %f %f %f\n",vm_GetMagnitude(&srcmat.fvec),vm_GetMagnitude(&srcmat.rvec),vm_GetMagnitude(&srcmat.uvec))); - mprintf((0,"orient: %f %f %f\n",vm_GetMagnitude(&Placed_room_orient.fvec),vm_GetMagnitude(&Placed_room_orient.rvec),vm_GetMagnitude(&Placed_room_orient.uvec))); + mprintf(0,"srcmat: %f %f %f\n",vm_GetMagnitude(&srcmat.fvec),vm_GetMagnitude(&srcmat.rvec),vm_GetMagnitude(&srcmat.uvec)); + mprintf(0,"orient: %f %f %f\n",vm_GetMagnitude(&Placed_room_orient.fvec),vm_GetMagnitude(&Placed_room_orient.rvec),vm_GetMagnitude(&Placed_room_orient.uvec)); //Make sure the matrices are ok vm_Orthogonalize(&srcmat); @@ -573,7 +573,7 @@ void ComputePlacedRoomMatrix() //Compute matrix to rotate src -> dest vm_MatrixMulTMatrix(&Placed_room_rotmat,&srcmat,&Placed_room_orient); - mprintf((0,"rotmat: %f %f %f\n",vm_GetMagnitude(&Placed_room_rotmat.fvec),vm_GetMagnitude(&Placed_room_rotmat.rvec),vm_GetMagnitude(&Placed_room_rotmat.uvec))); + mprintf(0,"rotmat: %f %f %f\n",vm_GetMagnitude(&Placed_room_rotmat.fvec),vm_GetMagnitude(&Placed_room_rotmat.rvec),vm_GetMagnitude(&Placed_room_rotmat.uvec)); //Make sure the matrix is ok vm_Orthogonalize(&Placed_room_rotmat); @@ -2331,7 +2331,7 @@ recheck_face:; } } if (f2 == rp->num_faces) { //didn't find a match - //mprintf((0,"Couldn't find shared edge for %d:%d edge %d\n",r,f,v)); + //mprintf(0,"Couldn't find shared edge for %d:%d edge %d\n",r,f,v); possible_tjoints++; //Look for vert on this edge @@ -2357,7 +2357,7 @@ recheck_face:; float d0 = vm_VectorDistance(&rp->verts[tt0],&rp->verts[vv0]); float d1 = vm_VectorDistance(&rp->verts[tt0],&rp->verts[vv1]); if ((d0 < edge_len) && (d1 < edge_len)) { - mprintf((0,"Adding %d to edge %d of %d:%d (from face %d)\n",tt0,v,r,f,f2)); + mprintf(0,"Adding %d to edge %d of %d:%d (from face %d)\n",tt0,v,r,f,f2); AddVertToFace(rp,f,tt0,v); tjoints_fixed++; goto recheck_face; @@ -2384,8 +2384,8 @@ recheck_face:; } } - mprintf((0,"%d possible t-joints\n",possible_tjoints)); - mprintf((0,"points_are_same_count = %d\n",points_are_same_count)); + mprintf(0,"%d possible t-joints\n",possible_tjoints); + mprintf(0,"points_are_same_count = %d\n",points_are_same_count); OutrageMessageBox( "Level fix results:\n\n" " %d points added to portals\n" diff --git a/legacy/editor/KeypadDialog.cpp b/legacy/editor/KeypadDialog.cpp index 7adbaa35..bbdcc118 100644 --- a/legacy/editor/KeypadDialog.cpp +++ b/legacy/editor/KeypadDialog.cpp @@ -328,7 +328,7 @@ void CKeypadDialog::InitScrollBars(int vis_w, int vis_h) si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; si.nMin = 0; -// mprintf((0, "%d,%d -> %d,%d\n", m_fullwidth, m_fullheight, vis_w, vis_h)); +// mprintf(0, "%d,%d -> %d,%d\n", m_fullwidth, m_fullheight, vis_w, vis_h); if (m_fullwidth > vis_w) hscroll = true; @@ -346,7 +346,7 @@ void CKeypadDialog::InitScrollBars(int vis_w, int vis_h) else { ShowScrollBar(SB_HORZ, FALSE); ScrollWindowEx(m_hpos, 0, NULL, NULL, NULL, NULL, SW_SCROLLCHILDREN | SW_INVALIDATE | SW_ERASE); -// mprintf((0, "hoff=%d\n", m_hpos)); +// mprintf(0, "hoff=%d\n", m_hpos); } if (vscroll) { @@ -361,7 +361,7 @@ void CKeypadDialog::InitScrollBars(int vis_w, int vis_h) else { ShowScrollBar(SB_VERT, FALSE); ScrollWindowEx(0, m_vpos, NULL, NULL, NULL, NULL, SW_SCROLLCHILDREN | SW_INVALIDATE | SW_ERASE); -// mprintf((0, "voff=%d\n", m_vpos)); +// mprintf(0, "voff=%d\n", m_vpos); } m_hpos = 0; diff --git a/legacy/editor/LightingDialog.cpp b/legacy/editor/LightingDialog.cpp index 0a3fffdc..f0c17484 100644 --- a/legacy/editor/LightingDialog.cpp +++ b/legacy/editor/LightingDialog.cpp @@ -1716,7 +1716,7 @@ void ResaveBitmap (char *name) bm_data (bm_handle,0); ddio_MakePath(search,LocalD3Dir,"data","graphics",GameBitmaps[bm_handle].name,NULL); - mprintf ((0,"Resaving bitmap %s.\n",search)); + mprintf(0,"Resaving bitmap %s.\n",search); bm_SaveFileBitmap (search,bm_handle); } @@ -1732,7 +1732,7 @@ void ResaveBitmap (char *name) // Make sure its paged in bm_data (bm_handle,0); - mprintf ((0,"Resaving bitmap %s.\n",search)); + mprintf(0,"Resaving bitmap %s.\n",search); bm_SaveFileBitmap (search,bm_handle); } @@ -1751,7 +1751,7 @@ void ResaveVClip (char *name) char search[256]; ddio_MakePath(search,LocalD3Dir,"data","graphics",GameVClips[bm_handle].name,NULL); - mprintf ((0,"Resaving vclip %s.\n",search)); + mprintf(0,"Resaving vclip %s.\n",search); SaveVClip (search,bm_handle); } @@ -1764,7 +1764,7 @@ void ResaveVClip (char *name) bm_handle=AllocLoadVClip (search,NOT_TEXTURE,0); if (bm_handle>=0) { - mprintf ((0,"Resaving vclip %s.\n",search)); + mprintf(0,"Resaving vclip %s.\n",search); SaveVClip (search,bm_handle); } diff --git a/legacy/editor/MainFrm.cpp b/legacy/editor/MainFrm.cpp index 9aea098b..89dad323 100644 --- a/legacy/editor/MainFrm.cpp +++ b/legacy/editor/MainFrm.cpp @@ -1570,11 +1570,11 @@ void CMainFrame::OnActivateApp(BOOL bActive, HTASK hTask) if (bActive) { theApp.resume(); - mprintf_at((2,0,0, "App Active ")); + mprintf_at(2,0,0, "App Active "); } else { theApp.pause(); - mprintf_at((2,0,0, "App Inactive")); + mprintf_at(2,0,0, "App Inactive"); } ((oeWin32Application *)Descent)->run_handler(this->m_hWnd, WM_ACTIVATEAPP, (unsigned)bActive, 0); @@ -1632,7 +1632,7 @@ void SetErrorMessage(const char *fmt,...) std::vsnprintf(Editor_error_message,sizeof(Editor_error_message),fmt,arglist); va_end(arglist); - mprintf ((0,"Editor error: %s\n",Editor_error_message)); + mprintf(0,"Editor error: %s\n",Editor_error_message); } //Get the error message from the last function that returned failure @@ -2067,7 +2067,7 @@ void CMainFrame::OnImportBitmap() return; } - mprintf ((0,"Making a copy of this bitmap/anim locally...\n")); + mprintf(0,"Making a copy of this bitmap/anim locally...\n"); if (!anim) { @@ -2116,7 +2116,7 @@ void CMainFrame::OnSubeditorsHogmaker() void CMainFrame::OnNumpad0() { - mprintf((0, "NUMPAD0\n")); + mprintf(0, "NUMPAD0\n"); if (!D3EditState.keypad_visible) return; if (m_FloatingKeypadDialog) m_FloatingKeypadDialog->RunKeypadFunction(VK_NUMPAD0); else if (m_KeypadTabDialog) m_KeypadTabDialog->RunKeypadFunction(VK_NUMPAD0); @@ -2555,7 +2555,7 @@ void ResetObjectsIntoMine() if (roomnum == -1) OutrageMessageBox("Can't find room for object %d (type = %s)",objnum,Object_type_names[objp->type]); else { - mprintf((0,"Moving object %d to room %d\n",objnum,roomnum)); + mprintf(0,"Moving object %d to room %d\n",objnum,roomnum); ObjSetPos(&Objects[objnum],&objp->pos,roomnum,NULL,true); count++; } @@ -2713,7 +2713,7 @@ void FindBadDestroyedTextures() for (int i=0;i m_TexListPos) TextureListDown(abs(new_pos-m_TexListPos)); @@ -1147,7 +1147,7 @@ void CMegacellDialog::OnCopyMegacell() for (i=0;i -1); if (!HObjectPlace(D3EditState.current_obj_type, objid)) { - mprintf((0, "Attempt to place object outside mine failed!\n")); + mprintf(0, "Attempt to place object outside mine failed!\n"); } } diff --git a/legacy/editor/ObjectListDialog.cpp b/legacy/editor/ObjectListDialog.cpp index 92cafee6..cbd4ed28 100644 --- a/legacy/editor/ObjectListDialog.cpp +++ b/legacy/editor/ObjectListDialog.cpp @@ -349,7 +349,7 @@ int CObjectListDialog::GetObjHandleFromItem(HTREEITEM hItem) if (leaf->hItem == hItem) return leaf->handle; -// mprintf((0, "ObjectListDialog: Unable to find handle in object tree!!\n")); +// mprintf(0, "ObjectListDialog: Unable to find handle in object tree!!\n"); return -1; } diff --git a/legacy/editor/PhysicsDlg.cpp b/legacy/editor/PhysicsDlg.cpp index adc28747..abfa8f50 100644 --- a/legacy/editor/PhysicsDlg.cpp +++ b/legacy/editor/PhysicsDlg.cpp @@ -293,7 +293,7 @@ BOOL CPhysicsDlg::OnInitDialog() bbox->SetCheck (true); break; default: - mprintf((0, "ERROR: Invalid gravity flags cannot have PF_GRAVITY and PF_REVERSE_GRAVITY\n")); + mprintf(0, "ERROR: Invalid gravity flags cannot have PF_GRAVITY and PF_REVERSE_GRAVITY\n"); // Int3(); break; } diff --git a/legacy/editor/PictListBox.cpp b/legacy/editor/PictListBox.cpp index ce212cdc..28ab9402 100644 --- a/legacy/editor/PictListBox.cpp +++ b/legacy/editor/PictListBox.cpp @@ -261,7 +261,7 @@ void editorPictListBox::OnVScroll(UINT nSBCode, int nPos, CScrollBar* pScrollBar // tex_start accordingly. SCROLLINFO si; - // mprintf((0, "scroll new_pos = %d. original_pos = %d\n", new_pos, m_ListPos)); + // mprintf(0, "scroll new_pos = %d. original_pos = %d\n", new_pos, m_ListPos); if (new_pos < m_ListPos) ListUp(m_ListPos-new_pos); if (new_pos > m_ListPos) ListDown(new_pos-m_ListPos); @@ -300,11 +300,11 @@ void editorPictListBox::ListUp(int rows) olditem = m_ItemStart; m_ItemStart = PrevListItem(m_ItemStart); - //mprintf((0, "m_ItemStart = %d\n", m_ItemStart)); + //mprintf(0, "m_ItemStart = %d\n", m_ItemStart); if (m_ItemStart > olditem) { m_ItemStart = olditem; done = 1; - // mprintf((0, "m_ItemStart = %d\n", m_ItemStart)); + // mprintf(0, "m_ItemStart = %d\n", m_ItemStart); } else if (old<=m_ItemStart) { m_ItemStart=old; diff --git a/legacy/editor/Read3ds.cpp b/legacy/editor/Read3ds.cpp index 49a6e558..d9b88c8e 100644 --- a/legacy/editor/Read3ds.cpp +++ b/legacy/editor/Read3ds.cpp @@ -203,7 +203,7 @@ int Read3DSMaxFile(char *filename) fp=(CFILE *)cfopen (filename,"rb"); if (!fp) { - mprintf ((0,"Couldn't open 3dsmax file %s!\n",filename)); + mprintf(0,"Couldn't open 3dsmax file %s!\n",filename); return -1; } @@ -225,7 +225,7 @@ int Read3DSMaxFile(char *filename) Parse3DSMaxChunk (fp, len-6); else { - mprintf ((0,"This file is not a 3ds max file!\n")); + mprintf(0,"This file is not a 3ds max file!\n"); cfclose (fp); return -1; } @@ -262,7 +262,7 @@ int Read3DSMaxFile(char *filename) reading_face *mfp=&rp->faces[i]; //vm_GetNormal(&Reading_room.faces[i].normal,&rp->verts[mfp->face_verts[0]],&rp->verts[mfp->face_verts[1]],&rp->verts[mfp->face_verts[2]]); if (! ComputeNormal(&Reading_room.faces[i].normal,Reading_room.faces[i].num_verts,mfp->face_verts,rp->verts)) { - mprintf((1,"Warning: Low precision normal for face %d\n",i)); + mprintf(1,"Warning: Low precision normal for face %d\n",i); bad_normals++; } } @@ -277,7 +277,7 @@ int Read3DSMaxFile(char *filename) int t; reading_face destface; - mprintf ((0,"Combining faces, please wait...\n")); + mprintf(0,"Combining faces, please wait...\n"); TryAgain: @@ -315,14 +315,14 @@ int Read3DSMaxFile(char *filename) skip_combine:; - mprintf ((0,"Total faces=%d\n",Reading_room.num_faces)); + mprintf(0,"Total faces=%d\n",Reading_room.num_faces); if (Reading_room.num_faces > MAX_FACES_PER_ROOM) { OutrageMessageBox("The imported room has %d faces. The limit is %d. Aborting import.",Reading_room.num_faces,MAX_FACES_PER_ROOM); return -1; } - mprintf ((0,"Trying to allocate a room for %d verts, %d faces!\n",Reading_room.num_verts,Reading_room.num_faces)); + mprintf(0,"Trying to allocate a room for %d verts, %d faces!\n",Reading_room.num_verts,Reading_room.num_faces); // int n=AllocRoom (Reading_room.num_verts,Reading_room.num_faces); room *rp = CreateNewRoom(Reading_room.num_verts,Reading_room.num_faces,1); @@ -432,7 +432,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) if (size<0) { - mprintf((0,"%d:chunk error\n",level)); + mprintf(0,"%d:chunk error\n",level); exit (1); } @@ -488,7 +488,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) int ret=FindTextureBitmapName(texture_name); if (ret==-1) { - mprintf ((0,"Couldn't find bitmap %s!\n",texture_name)); + mprintf(0,"Couldn't find bitmap %s!\n",texture_name); ret=GetNextTexture(0); } @@ -520,7 +520,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) if (!done) { - mprintf ((0,"Couldn't find material named %s!\n",material_name)); + mprintf(0,"Couldn't find material named %s!\n",material_name); texnum=GetNextTexture(0); } @@ -553,7 +553,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) } case ID_TRI_MESH: - mprintf ((0,"Found 3dsmax TRI_MESH chunk!\n")); + mprintf(0,"Found 3dsmax TRI_MESH chunk!\n"); Parse3DSMaxChunk(fp,len-6); break; @@ -567,7 +567,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) if (num_verts > MAX_VERTS_PER_ROOM) return; - mprintf ((0,"Reading in %d verts from room!\n",num_verts)); + mprintf(0,"Reading in %d verts from room!\n",num_verts); // Make room for these verts Reading_room.num_verts=num_verts; @@ -593,7 +593,7 @@ void Parse3DSMaxChunk (CFILE *fp, int size) if (num_faces > MAX_READING_ROOM_FACES) return; - mprintf ((0,"Reading in %d faces!\n",num_faces)); + mprintf(0,"Reading in %d faces!\n",num_faces); Reading_room.num_faces=num_faces; ASSERT (Reading_room.faces!=NULL); @@ -822,7 +822,7 @@ int CombineFaces( reading_face *dest,reading_face * a, reading_face * b ) } if ( (va==b->face_verts[(startb+2)%b->num_verts])) - mprintf((0, "WARNING!!! Faces were combined that caused the loss of a vertex!\n")); + mprintf(0, "WARNING!!! Faces were combined that caused the loss of a vertex!\n"); for (i=1; inum_verts; i++ ) { diff --git a/legacy/editor/RoomUVs.cpp b/legacy/editor/RoomUVs.cpp index 9a953b1d..13641ef8 100644 --- a/legacy/editor/RoomUVs.cpp +++ b/legacy/editor/RoomUVs.cpp @@ -117,7 +117,7 @@ void AssignUVsToFace(room *rp, int facenum, roomUVL *uva, roomUVL *uvb, int va, // Assign u,v scale to a unit length right vector. fmag = zhypot(uvhi.v - uvlo.v,uvhi.u - uvlo.u); if (fmag < 0.001) { - //mprintf((0,"Warning: fmag = %7.3f, using approximate u,v values\n",f2fl(fmag))); + //mprintf(0,"Warning: fmag = %7.3f, using approximate u,v values\n",f2fl(fmag)); ruvmag.u = 256.0; ruvmag.v = 256.0; fuvmag.u = 256.0; diff --git a/legacy/editor/ScriptEditorDlg.cpp b/legacy/editor/ScriptEditorDlg.cpp index f5e5f9d8..4e4ba3b6 100644 --- a/legacy/editor/ScriptEditorDlg.cpp +++ b/legacy/editor/ScriptEditorDlg.cpp @@ -179,7 +179,7 @@ void CScriptEditorDlg::InitFindReplace(BOOL bFind) // Initialize the dialog if (!m_pdlgFindReplace->Create(bFind, 0, 0, FR_DOWN, this)) { - mprintf((0,"Error allocating find/replace dialog!")); + mprintf(0,"Error allocating find/replace dialog!"); m_pdlgFindReplace = NULL; return; } @@ -461,13 +461,13 @@ void CScriptEditorDlg::OnUseExternal() return; } - mprintf((0, "External Editor started\n")); + mprintf(0, "External Editor started\n"); WaitForSingleObject(pi.hProcess,INFINITE); TerminateProcess(pi.hProcess,0); Sleep(100); CloseHandle(pi.hThread); CloseHandle(pi.hProcess); - mprintf((0, "External Editor finished\n")); + mprintf(0, "External Editor finished\n"); ImportScript(DEFAULT_SCRIPT_LOCATION); UpdateData(false); @@ -535,7 +535,7 @@ void CScriptEditorDlg::ExportScript(char *filename) CFILE *file; file=cfopen(filename,"wt"); - mprintf((0,"Exporting Script to file %s\n",filename)); + mprintf(0,"Exporting Script to file %s\n",filename); cf_WriteString(file, m_sScript.GetBuffer(1)); cfclose(file); } @@ -558,7 +558,7 @@ void CScriptEditorDlg::ImportScript(char *filename) } file=cfopen(filename,"rt"); - mprintf((0,"Importing Script from file %s\n",filename)); + mprintf(0,"Importing Script from file %s\n",filename); do { size=cf_ReadString(buffer,MAX_SCRIPT_LINE_SIZE-2,file); diff --git a/legacy/editor/ScriptLevelInterface.cpp b/legacy/editor/ScriptLevelInterface.cpp index 9d55a15c..931a5b2a 100644 --- a/legacy/editor/ScriptLevelInterface.cpp +++ b/legacy/editor/ScriptLevelInterface.cpp @@ -1070,7 +1070,7 @@ bool DeleteGamefile(char *tempbuffer) if (mng_CheckIfPageOwned (&pl,TableUser)!=1){ mng_FreeTrackLock (tl); if (!mng_DeletePage (tempbuffer,PAGETYPE_GAMEFILE,1)){ - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); }else{ removed = true; @@ -1120,7 +1120,7 @@ bool AddNewGameFile(char *fullpath,char *directory) strcpy (Gamefiles[gamefile_handle].dir_name,directory); // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this file locally...\n")); + mprintf(0,"Making a copy of this file locally...\n"); char destname[100]; ddio_MakePath(destname,LocalD3Dir,"data",directory,Gamefiles[gamefile_handle].name,NULL); @@ -1317,7 +1317,7 @@ bool UndoCheckOutGamefile(char *tempbuffer) //Delete local page if (!mng_DeletePage (Gamefiles[n].name,PAGETYPE_GAMEFILE,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } @@ -2395,7 +2395,7 @@ bool IsScriptOutofSync(char *name) strcat(filename,".dll"); ddio_MakePath(path,LocalScriptDir,filename,NULL); - mprintf((0," Checking %s...",filename)); + mprintf(0," Checking %s...",filename); if(mod_LoadModule(&mod,path)) { @@ -2406,10 +2406,10 @@ bool IsScriptOutofSync(char *name) { //dll does not initialize...out of synce out_of_sync = true; - mprintf((0,"OUT OF SYNC!\n")); + mprintf(0,"OUT OF SYNC!\n"); }else { - mprintf((0,"Not Out of Sync\n")); + mprintf(0,"Not Out of Sync\n"); shutdowndll = (ShutdownDLL_fp)mod_GetSymbol(&mod,"ShutdownDLL",0); if(shutdowndll) { @@ -2419,12 +2419,12 @@ bool IsScriptOutofSync(char *name) }else { //unable to load - mprintf((0,"UNABLE TO GET INITIALIZEDLL\n")); + mprintf(0,"UNABLE TO GET INITIALIZEDLL\n"); } mod_FreeModule(&mod); }else{ - mprintf((0,"MODULE NOT FOUND\n")); + mprintf(0,"MODULE NOT FOUND\n"); } return out_of_sync; @@ -2450,14 +2450,14 @@ int AreScriptsOutofDate(void) ddio_GetWorkingDir(old_dir,_MAX_PATH); // First check for out-of-sync scripts (attempt load aigame and generic) - mprintf((0,"Checking for out of sync scripts...\n")); + mprintf(0,"Checking for out of sync scripts...\n"); if(IsScriptOutofSync("aigame.dll")||IsScriptOutofSync("generic.dll")) { OutrageMessageBox(MBOX_OK,"WARNING! You have out of sync scripts...you MUST recompile your scripts!!!!!"); } - mprintf((0,"Checking for out of date scripts...")); + mprintf(0,"Checking for out of date scripts..."); ddio_SetWorkingDir(LocalScriptDir); for (int i=0;iscript.set_name(sel.m_ScriptName); obj->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; - mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, obj->script.is_custom)); + mprintf(0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, obj->script.is_custom); } inline void SETUP_SCRIPTSELECT_TRIGGER(CScriptSelect& sel, trigger *trig) @@ -124,7 +124,7 @@ inline void RETURN_SCRIPTSELECT_TRIGGER(trigger *trig, CScriptSelect& sel) trig->script.set_name(sel.m_ScriptName); trig->script.is_custom = (sel.m_CustomType==CUSTOM_SCRIPT_MASK) ? 1 : 0; - mprintf((0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, trig->script.is_custom)); + mprintf(0, "Script [%s:custom=%d] assigned.\n", sel.m_ScriptName, trig->script.is_custom); } diff --git a/legacy/editor/ScriptStudio.cpp b/legacy/editor/ScriptStudio.cpp index 667a5f54..a548e806 100644 --- a/legacy/editor/ScriptStudio.cpp +++ b/legacy/editor/ScriptStudio.cpp @@ -496,7 +496,7 @@ void CScriptStudio::InitFindReplace(BOOL bFind) // Initialize the dialog if (!m_pdlgFindReplace->Create(bFind, 0, 0, FR_DOWN, this)) { - mprintf((0,"Error allocating find/replace dialog!")); + mprintf(0,"Error allocating find/replace dialog!"); m_pdlgFindReplace = NULL; return; } @@ -688,7 +688,7 @@ void CScriptStudio::ExportScript(char *filename) UpdateEditText(); file=cfopen(filename,"wt"); - mprintf((0,"Exporting Script to file %s\n",filename)); + mprintf(0,"Exporting Script to file %s\n",filename); cf_WriteString(file, m_EditText.GetBuffer(1)); cfclose(file); } @@ -711,7 +711,7 @@ void CScriptStudio::ImportScript(char *filename) } file=cfopen(filename,"rt"); - mprintf((0,"Importing Script from file %s\n",filename)); + mprintf(0,"Importing Script from file %s\n",filename); do { size=cf_ReadString(buffer,MAX_SCRIPT_LINE_SIZE-2,file); diff --git a/legacy/editor/ScriptSyncDialog.cpp b/legacy/editor/ScriptSyncDialog.cpp index 77d211f0..a00995ab 100644 --- a/legacy/editor/ScriptSyncDialog.cpp +++ b/legacy/editor/ScriptSyncDialog.cpp @@ -490,14 +490,14 @@ void CScriptSyncDialog::DoStuff(void) char buffer[2048]; const char *next_line; - mprintf((0,"===========================================\n")); + mprintf(0,"===========================================\n"); next_line = textaux_CopyTextLine(string,buffer); while(next_line) { - mprintf((0,"%s\n",buffer)); + mprintf(0,"%s\n",buffer); next_line = textaux_CopyTextLine(next_line,buffer); } - mprintf((0,"===========================================\n")); + mprintf(0,"===========================================\n"); mem_free(string); } } diff --git a/legacy/editor/StatusDlg.cpp b/legacy/editor/StatusDlg.cpp index f55cf575..f367337c 100644 --- a/legacy/editor/StatusDlg.cpp +++ b/legacy/editor/StatusDlg.cpp @@ -60,7 +60,7 @@ void CStatusDlg::Init(int min,int max,int delta) progress->SetPos(min); progress->SetStep(delta); - mprintf((0,"Progress Control Create: Min= %d Max= %d Step= %d\n",min,max,delta)); + mprintf(0,"Progress Control Create: Min= %d Max= %d Step= %d\n",min,max,delta); } int CStatusDlg::Step() diff --git a/legacy/editor/TableFileFilterMng.cpp b/legacy/editor/TableFileFilterMng.cpp index bc42734b..25a55c5d 100644 --- a/legacy/editor/TableFileFilterMng.cpp +++ b/legacy/editor/TableFileFilterMng.cpp @@ -430,7 +430,7 @@ bool PageDataList::AddToList(char *page_name, uint8_t page_type, int page_flags) // Allocate memory for the new node new_node=new PageDataNode; if(new_node==NULL) { - mprintf((0,"ERROR: Could not allocate new PageDataNode!\n")); + mprintf(0,"ERROR: Could not allocate new PageDataNode!\n"); return FALSE; } @@ -541,7 +541,7 @@ bool PageDataList::LoadList(char *list_filename) infile=cfopen (list_filename,"rb"); if (!infile) { - mprintf ((0,"Couldn't open the input list file!\n")); + mprintf(0,"Couldn't open the input list file!\n"); return FALSE; } @@ -560,7 +560,7 @@ bool PageDataList::LoadList(char *list_filename) // Allocate memory for the new node new_node=new PageDataNode; if(new_node==NULL) { - mprintf((0,"ERROR: Could not allocate new PageDataNode!\n")); + mprintf(0,"ERROR: Could not allocate new PageDataNode!\n"); return FALSE; } @@ -620,7 +620,7 @@ bool PageDataList::SaveList(char *list_filename) outfile=cfopen (list_filename,"wb"); if (!outfile) { - mprintf ((0,"Couldn't open the output list file!\n")); + mprintf(0,"Couldn't open the output list file!\n"); return FALSE; } @@ -1215,7 +1215,7 @@ bool PageDataList::DetermineRequiredPages(int process_type) } else { - mprintf ((0,"Couldn't find polymodel %s!\n",Gamefiles[i].name)); + mprintf(0,"Couldn't find polymodel %s!\n",Gamefiles[i].name); Int3(); } } @@ -1501,14 +1501,14 @@ bool PageDataList::CreateNewTableFile(char *new_table_filename, char *src_table_ infile=cfopen (src_table_filename,"rb"); if (!infile) { - mprintf ((0,"Couldn't open input table file!\n")); + mprintf(0,"Couldn't open input table file!\n"); return FALSE; } outfile=cfopen (new_table_filename,"wb"); if (!outfile) { - mprintf ((0,"Couldn't open output table file!\n")); + mprintf(0,"Couldn't open output table file!\n"); cfclose (infile); return FALSE; } @@ -2012,7 +2012,7 @@ bool PageDataList::ProcessPageFromFile(char *page_name, uint8_t page_type, int p } else { - mprintf ((0,"Couldn't find polymodel %s!\n",page_name)); + mprintf(0,"Couldn't find polymodel %s!\n",page_name); Int3(); } } @@ -2177,7 +2177,7 @@ void OpenFilterLogFiles(void) remaining_log_file=cfopen (fullpath,"wt"); if (remaining_log_file==NULL) { - mprintf ((0,"Couldn't open \"Remaining Pages\" log file!\n")); + mprintf(0,"Couldn't open \"Remaining Pages\" log file!\n"); return; } @@ -2185,7 +2185,7 @@ void OpenFilterLogFiles(void) removed_log_file=cfopen (fullpath,"wt"); if (removed_log_file==NULL) { - mprintf ((0,"Couldn't open \"Removed Pages\" log file!\n")); + mprintf(0,"Couldn't open \"Removed Pages\" log file!\n"); return; } } diff --git a/legacy/editor/TableManage.cpp b/legacy/editor/TableManage.cpp index 4d34ddea..36442733 100644 --- a/legacy/editor/TableManage.cpp +++ b/legacy/editor/TableManage.cpp @@ -172,7 +172,7 @@ bool GenericPageList::LoadTable (char *table_filename) if (!infile) { - //mprintf ((0,"Couldn't open table file to reorder!\n")); + //mprintf(0,"Couldn't open table file to reorder!\n"); //Int3(); return FALSE; } @@ -242,14 +242,14 @@ bool GenericPageList::SaveTable (char *table_filename) infile=cfopen (m_TableFilename,"rb"); if (!infile) { - mprintf ((0,"Couldn't open table file to replace generic!\n")); + mprintf(0,"Couldn't open table file to replace generic!\n"); return FALSE; } outfile=cfopen (TEMP_TABLE_FILENAME,"wb"); if (!outfile) { - mprintf ((0,"Couldn't open temp table file to replace generic!\n")); + mprintf(0,"Couldn't open temp table file to replace generic!\n"); cfclose (infile); return FALSE; } diff --git a/legacy/editor/TerrainDialog.cpp b/legacy/editor/TerrainDialog.cpp index ec8457fa..a9288171 100644 --- a/legacy/editor/TerrainDialog.cpp +++ b/legacy/editor/TerrainDialog.cpp @@ -592,7 +592,7 @@ void CTerrainDialog::OnTerrpadImport() void CTerrainDialog::OnTerrpadRenormalize() { - mprintf ((0,"Building terrain normals...this might take a couple of seconds.\n")); + mprintf(0,"Building terrain normals...this might take a couple of seconds.\n"); Terrain_checksum=-1; BuildMinMaxTerrain(); @@ -1999,7 +1999,7 @@ void CTerrainDialog::OnTerrainOcclusion() if ((MessageBox("Are you sure you wish to calculate terrain occlusion?","Question",MB_YESNO))==IDNO) return; - mprintf ((0,"Now doing occlusion tests...\n")); + mprintf(0,"Now doing occlusion tests...\n"); int count=0; int occlude_count=0; @@ -2052,7 +2052,7 @@ void CTerrainDialog::OnTerrainOcclusion() int end_x=dest_x*OCCLUSION_SIZE; int dest_occlusion_index=dest_z*OCCLUSION_SIZE+dest_x; - mprintf_at((2,5,0,"Count=%7d",count++)); + mprintf_at(2,5,0,"Count=%7d",count++); if (dest_occlusion_index==src_occlusion_index) { @@ -2225,7 +2225,7 @@ void CTerrainDialog::OnTerrainOcclusion() Terrain_occlusion_checksum=Terrain_checksum+1; - mprintf ((0,"%d cells were occluded.\n",occlude_count)); + mprintf(0,"%d cells were occluded.\n",occlude_count); OutrageMessageBox ("Occlusion checking complete. Remember to save!"); } diff --git a/legacy/editor/TextureDialog.cpp b/legacy/editor/TextureDialog.cpp index 58949670..9ff06ac0 100644 --- a/legacy/editor/TextureDialog.cpp +++ b/legacy/editor/TextureDialog.cpp @@ -620,7 +620,7 @@ int CGrTextureListBox::ListNextItem(int curtex) while ((Show_used && !CurrentlyUsedTextures[next_texture]) || !(GameTextures[next_texture].flags & D3EditState.texture_display_flags) ) { next_texture = GetNextTexture(next_texture); - // mprintf((0, "next_tex = %d\n", next_texture)); + // mprintf(0, "next_tex = %d\n", next_texture); if (next_texture == curtex) { break; } @@ -642,7 +642,7 @@ int CGrTextureListBox::ListPrevItem(int curtex) while ((Show_used && !CurrentlyUsedTextures[prev_texture]) || !(GameTextures[prev_texture].flags & D3EditState.texture_display_flags) ) { prev_texture = GetPreviousTexture(prev_texture); - // mprintf((0, "prev_tex = %d\n", prev_texture)); + // mprintf(0, "prev_tex = %d\n", prev_texture); if (prev_texture == curtex) { break; } @@ -962,7 +962,7 @@ void CTextureDialog::OnFindTexture() { int i,t; - mprintf ((0,"Searching...please wait...\n")); + mprintf(0,"Searching...please wait...\n"); int found=0,found_room,found_face; for (i=0;i<=Highest_room_index && !found;i++) @@ -986,18 +986,18 @@ void CTextureDialog::OnFindTexture() } } - mprintf ((0,"Done searching!\n")); + mprintf(0,"Done searching!\n"); if (found==0) { - mprintf ((0,"Couldn't find another face with that texture!\n")); + mprintf(0,"Couldn't find another face with that texture!\n"); } else { Curroomp=&Rooms[found_room]; Curface=found_face; - mprintf ((0,"Found that texture in room %d face %d.\n",found_room,found_face)); - mprintf ((0,"Press C to center on that face\n")); + mprintf(0,"Found that texture in room %d face %d.\n",found_room,found_face); + mprintf(0,"Press C to center on that face\n"); } } diff --git a/legacy/editor/TextureGrWnd.cpp b/legacy/editor/TextureGrWnd.cpp index c1416732..df23ff6a 100644 --- a/legacy/editor/TextureGrWnd.cpp +++ b/legacy/editor/TextureGrWnd.cpp @@ -650,7 +650,7 @@ void CTextureGrWnd::Render() Successive_count++; if (Successive_count<2) { - mprintf ((0,"Not doing opengl!\n")); + mprintf(0,"Not doing opengl!\n"); DoOpenGL=0; first_time=1; } @@ -853,7 +853,7 @@ void CTextureGrWnd::OnPaint() void CTextureGrWnd::OnDestroy() { -// mprintf((0, "CTextureGrWnd::OnDestroy:: m_grScreen\n")); +// mprintf(0, "CTextureGrWnd::OnDestroy:: m_grScreen\n"); CGrWnd::OnDestroy(); theApp.textured_view = NULL; } @@ -1026,7 +1026,7 @@ void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) if (TSearch_found_type==TSEARCH_FOUND_OBJECT) { // Found an object - mprintf ((0,"Found an object! objnum=%d\n",TSearch_seg)); + mprintf(0,"Found an object! objnum=%d\n",TSearch_seg); SelectObject(TSearch_seg); // start object moving if mouse down in an object. ObjMoveManager.Start(this, m_grViewport->width(), m_grViewport->height(), &m_ViewPos, &m_ViewMatrix, point.x, point.y); @@ -1118,7 +1118,7 @@ void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) { int roomnum,facenum; - // mprintf((0,"ButtonDown %d,%d\n",point.x,point.y)); + // mprintf(0,"ButtonDown %d,%d\n",point.x,point.y); TSearch_found_type=-1; TSearch_seg=-1; TSearch_on=1; @@ -1221,7 +1221,7 @@ void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) { vec=Rooms[roomnum].verts[Rooms[roomnum].faces[facenum].face_verts[i]]; float dist = vec.x*norm.x+vec.y*norm.y+vec.z*norm.z+plane_dist; - mprintf ((0,"Vertex %d distance from plane=%f\n",i,dist)); + mprintf(0,"Vertex %d distance from plane=%f\n",i,dist); } } else if (KEY_STATE(KEY_V)) @@ -1231,11 +1231,11 @@ void CTextureGrWnd::OnLButtonDown(UINT nFlags, CPoint point) int roomb=(Curroomp - Rooms); int answer=BOA_IsVisible(rooma,roomb); - mprintf ((0,"Answer 1 is %d\n",answer)); + mprintf(0,"Answer 1 is %d\n",answer); answer=BOA_IsVisible(roomb,rooma); - mprintf ((0,"Answer 2 is %d\n",answer)); + mprintf(0,"Answer 2 is %d\n",answer); } else { //Just change curface @@ -1368,7 +1368,7 @@ void CTextureGrWnd::OnRButtonDown(UINT nFlags, CPoint point) newobjnum = TSearch_seg; do_popup = true; - mprintf ((0,"Found an object! objnum=%d\n",newobjnum)); + mprintf(0,"Found an object! objnum=%d\n",newobjnum); SelectObject(newobjnum); Render(); @@ -1395,7 +1395,7 @@ void CTextureGrWnd::OnRButtonDown(UINT nFlags, CPoint point) roomnum=TSearch_seg; facenum=TSearch_face; m_StartFlip = FALSE; // unsignal flip. - mprintf((0,"found point: %d %d %d\n",roomnum,facenum)); + mprintf(0,"found point: %d %d %d\n",roomnum,facenum); do_popup = true; @@ -1422,7 +1422,7 @@ void CTextureGrWnd::OnRButtonDown(UINT nFlags, CPoint point) if(popup.CreatePopupMenu()) ret=SetupPopup(&popup,title); else { - mprintf((0,"Warning: Could not create popup menu!\n")); + mprintf(0,"Warning: Could not create popup menu!\n"); ret=false; } @@ -1448,7 +1448,7 @@ void CTextureGrWnd::OnRButtonDown(UINT nFlags, CPoint point) if (ret) if(!popup.TrackPopupMenu(TPM_LEFTALIGN,point.x,point.y+20,this,NULL)) - mprintf((0,"TrackPopupMenu error!\n")); + mprintf(0,"TrackPopupMenu error!\n"); } TexGrStopOpenGL(); @@ -1470,72 +1470,72 @@ bool CTextureGrWnd::SetupPopup(CMenu *popup,char *title) if(!popup->AppendMenu(MF_STRING+MF_DISABLED,POPUP_OBJNAME,title?title:"(no name)")) { ret=false; - mprintf((0,"Warning: Could not add Title to popup\n")); + mprintf(0,"Warning: Could not add Title to popup\n"); } if(!popup->AppendMenu(MF_SEPARATOR)) { ret=false; - mprintf((0,"Warning: Could not add seperator to popup\n")); + mprintf(0,"Warning: Could not add seperator to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_COPY,"Copy")) { ret=false; - mprintf((0,"Warning: Could not add Copy to popup\n")); + mprintf(0,"Warning: Could not add Copy to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_CUT,"Cut")) { ret=false; - mprintf((0,"Warning: Could not add Cut to popup\n")); + mprintf(0,"Warning: Could not add Cut to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_PASTE,"Paste")) { ret=false; - mprintf((0,"Warning: Could not add Paste to popup\n")); + mprintf(0,"Warning: Could not add Paste to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_DELETE,"Delete")) { ret=false; - mprintf((0,"Warning: Could not add Delete to popup\n")); + mprintf(0,"Warning: Could not add Delete to popup\n"); } if(!popup->AppendMenu(MF_SEPARATOR)) { ret=false; - mprintf((0,"Warning: Could not add seperator to popup\n")); + mprintf(0,"Warning: Could not add seperator to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_EDITNAME,"Edit Name")) { ret=false; - mprintf((0,"Warning: Could not add Edit Name to popup\n")); + mprintf(0,"Warning: Could not add Edit Name to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_SOUND,"Sound")) { ret=false; - mprintf((0,"Warning: Could not add Sound to popup\n")); + mprintf(0,"Warning: Could not add Sound to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_EDITSCRIPT,"Edit Dallas Scripts")) { ret=false; - mprintf((0,"Warning: Could not add Edit Script to popup\n")); + mprintf(0,"Warning: Could not add Edit Script to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_NEWSCRIPT,"New Dallas Script")) { ret=false; - mprintf((0,"Warning: Could not add New Script to popup\n")); + mprintf(0,"Warning: Could not add New Script to popup\n"); } if(!popup->AppendMenu(MF_STRING,POPUP_CUSTOMDEFAULTSCRIPT,"Set a custom default script")) { ret=false; - mprintf((0,"Warning: Could not add Set a custom default script to popup\n")); + mprintf(0,"Warning: Could not add Set a custom default script to popup\n"); } //@@if(!popup->AppendMenu(MF_STRING,POPUP_PROPERTIES,"Properties")) //@@{ //@@ ret=false; - //@@ mprintf((0,"Warning: Could not add Properties to popup\n")); + //@@ mprintf(0,"Warning: Could not add Properties to popup\n"); //@@} //@@if(!popup->AppendMenu(MF_STRING,POPUP_COPYID,"Copy UID")) //@@{ //@@ ret=false; - //@@ mprintf((0,"Warning: Could not add Copy UID to popup\n")); + //@@ mprintf(0,"Warning: Could not add Copy UID to popup\n"); //@@} return ret; } @@ -1605,7 +1605,7 @@ BOOL CTextureGrWnd::OnCommand(WPARAM wParam, LPARAM lParam) { case POPUP_EDITSCRIPT: { - mprintf((0,"Edit script for object %d\n",Cur_object_index)); + mprintf(0,"Edit script for object %d\n",Cur_object_index); //Nate: Add code here to edit/view an object's scripts // Make sure Dallas is open @@ -1629,7 +1629,7 @@ BOOL CTextureGrWnd::OnCommand(WPARAM wParam, LPARAM lParam) case POPUP_NEWSCRIPT: { - mprintf((0,"Add new script for object %d\n",Cur_object_index)); + mprintf(0,"Add new script for object %d\n",Cur_object_index); //Nate: Add code here to create a new script for an object // Make sure Dallas is open @@ -1742,7 +1742,7 @@ BOOL CTextureGrWnd::OnCommand(WPARAM wParam, LPARAM lParam) //@@ { //@@ CObjectPropertiesDialog prop_dlg; //@@ object *curobj=&Objects[Cur_object_index]; - //@@ mprintf((0,"Properties selected\n")); + //@@ mprintf(0,"Properties selected\n"); //@@ if(prop_dlg.DoModal()==IDOK) UpdateProperties(&prop_dlg); //@@ break; //@@ } diff --git a/legacy/editor/TriggerDialog.cpp b/legacy/editor/TriggerDialog.cpp index dd751395..30cd832b 100644 --- a/legacy/editor/TriggerDialog.cpp +++ b/legacy/editor/TriggerDialog.cpp @@ -838,7 +838,7 @@ try_again:; void CTriggerDialog::OnTrigEditScript() { - mprintf((0,"Edit script for trigger %d\n",Current_trigger)); + mprintf(0,"Edit script for trigger %d\n",Current_trigger); // Make sure Dallas is open diff --git a/legacy/editor/ViewerPropDlg.cpp b/legacy/editor/ViewerPropDlg.cpp index 8bf0c3c6..cd216984 100644 --- a/legacy/editor/ViewerPropDlg.cpp +++ b/legacy/editor/ViewerPropDlg.cpp @@ -235,7 +235,7 @@ void CViewerPropDlg::OnOrientCommitButton() m_BankEdit.GetWindowText(buf,sizeof(buf)); b = atof(buf) * 65536 / 360; - mprintf((0,"Agngles %x %x %x\n",p,h,b)); + mprintf(0,"Agngles %x %x %x\n",p,h,b); vm_AnglesToMatrix(&Viewer_object->orient,p,h,b); diff --git a/legacy/editor/WorldObjectsDoorDialog.cpp b/legacy/editor/WorldObjectsDoorDialog.cpp index 429653e5..d0993cac 100644 --- a/legacy/editor/WorldObjectsDoorDialog.cpp +++ b/legacy/editor/WorldObjectsDoorDialog.cpp @@ -316,7 +316,7 @@ void CWorldObjectsDoorDialog::OnAddDoor() Doors[door_handle].model_handle=img_handle; // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this model locally...\n")); + mprintf(0,"Making a copy of this model locally...\n"); char destname[100]; sprintf (destname,"%s\\%s",LocalModelsDir,Poly_models[Doors[door_handle].model_handle].name); @@ -653,7 +653,7 @@ void CWorldObjectsDoorDialog::OnDeleteDoor() mng_FreeTrackLock (tl); if (!mng_DeletePage (Doors[n].name,PAGETYPE_DOOR,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -1007,7 +1007,7 @@ void CWorldObjectsDoorDialog::OnSelendokDoorPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted door list, but probably nothing.")); + mprintf(0,"Possible corrupted door list, but probably nothing."); UpdateDialog(); } diff --git a/legacy/editor/WorldObjectsGenericDialog.cpp b/legacy/editor/WorldObjectsGenericDialog.cpp index ddd20aac..7f3bfc5f 100644 --- a/legacy/editor/WorldObjectsGenericDialog.cpp +++ b/legacy/editor/WorldObjectsGenericDialog.cpp @@ -752,7 +752,7 @@ void CWorldObjectsGenericDialog::OnGenericAddNew() Object_info[object_handle].lighting_info.lighting_render_type=LRT_GOURAUD; // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this model locally...\n")); + mprintf(0,"Making a copy of this model locally...\n"); char destname[100]; sprintf (destname,"%s\\%s",LocalModelsDir,Poly_models[Object_info[object_handle].render_handle].name); @@ -922,7 +922,7 @@ void CWorldObjectsGenericDialog::OnGenericDelete() mng_FreeTrackLock (tl); if (!mng_DeletePage (Object_info[m_current].name,PAGETYPE_GENERIC,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -1308,7 +1308,7 @@ void CWorldObjectsGenericDialog::OnSelendokGenericNamePulldown() i = FindObjectIDName(name); if (i==-1) { - mprintf ((0,"Possible corrupted object list, but probably nothing.")); + mprintf(0,"Possible corrupted object list, but probably nothing."); } else { ASSERT(Object_info[i].type == m_type); @@ -1495,7 +1495,7 @@ void CWorldObjectsGenericDialog::OnGenericUndoLock() //Delete local page if (!mng_DeletePage (Object_info[m_current].name,PAGETYPE_GENERIC,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } diff --git a/legacy/editor/WorldObjectsPlayerDialog.cpp b/legacy/editor/WorldObjectsPlayerDialog.cpp index 9adff4a8..b7b9a191 100644 --- a/legacy/editor/WorldObjectsPlayerDialog.cpp +++ b/legacy/editor/WorldObjectsPlayerDialog.cpp @@ -250,7 +250,7 @@ void CWorldObjectsPlayerDialog::OnAddPship() Ships[ship_handle].model_handle=img_handle; // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this model locally...\n")); + mprintf(0,"Making a copy of this model locally...\n"); char destname[100]; sprintf (destname,"%s\\%s",LocalModelsDir,Poly_models[Ships[ship_handle].model_handle].name); @@ -400,7 +400,7 @@ void CWorldObjectsPlayerDialog::OnPshipDelete() mng_FreeTrackLock (tl); if (!mng_DeletePage (Ships[n].name,PAGETYPE_SHIP,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -713,7 +713,7 @@ void CWorldObjectsPlayerDialog::OnSelendokPshipPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted ship list, but probably nothing.")); + mprintf(0,"Possible corrupted ship list, but probably nothing."); UpdateDialog(); } diff --git a/legacy/editor/WorldObjectsPowerupDialog.cpp b/legacy/editor/WorldObjectsPowerupDialog.cpp index 5765ab9d..e833f29e 100644 --- a/legacy/editor/WorldObjectsPowerupDialog.cpp +++ b/legacy/editor/WorldObjectsPowerupDialog.cpp @@ -173,7 +173,7 @@ void CWorldObjectsPowerupDialog::OnAddNewPowerup() Powerups[powerup_handle].image_handle=img_handle; // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this model/animation locally...\n")); + mprintf(0,"Making a copy of this model/animation locally...\n"); if (model) { @@ -314,7 +314,7 @@ void CWorldObjectsPowerupDialog::OnDeletePowerup() mng_FreeTrackLock (tl); if (!mng_DeletePowPage (Powerups[n].name,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -804,7 +804,7 @@ void CWorldObjectsPowerupDialog::OnSelendokPowerPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted texture list, but probably nothing.")); + mprintf(0,"Possible corrupted texture list, but probably nothing."); UpdateDialog(); } diff --git a/legacy/editor/WorldObjectsRobotDialog.cpp b/legacy/editor/WorldObjectsRobotDialog.cpp index 61b16b8b..c80c6b32 100644 --- a/legacy/editor/WorldObjectsRobotDialog.cpp +++ b/legacy/editor/WorldObjectsRobotDialog.cpp @@ -172,7 +172,7 @@ void CWorldObjectsRobotDialog::OnAddNewRobot() Robots[robot_handle].size=size/2; // Finally, save a local copy of the model/anim and alloc a tracklock - mprintf ((0,"Making a copy of this model locally...\n")); + mprintf(0,"Making a copy of this model locally...\n"); char destname[100]; sprintf (destname,"%s\\%s",LocalModelsDir,Poly_models[Robots[robot_handle].render_handle].name); @@ -298,7 +298,7 @@ void CWorldObjectsRobotDialog::OnDeleteRobot() mng_FreeTrackLock (tl); if (!mng_DeleteRobotPage (Robots[n].name,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -550,7 +550,7 @@ void CWorldObjectsRobotDialog::OnSelendokRobotPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted robot list, but probably nothing.")); + mprintf(0,"Possible corrupted robot list, but probably nothing."); UpdateDialog(); } diff --git a/legacy/editor/WorldSoundsDialog.cpp b/legacy/editor/WorldSoundsDialog.cpp index 98f72cbc..3ef9524a 100644 --- a/legacy/editor/WorldSoundsDialog.cpp +++ b/legacy/editor/WorldSoundsDialog.cpp @@ -257,7 +257,7 @@ void CWorldSoundsDialog::OnAddSound() Sounds[sound_handle].sample_index=raw_handle; // Finally, save a local copy of the .wav and alloc a tracklock - mprintf ((0,"Making a copy of this sound locally...\n")); + mprintf(0,"Making a copy of this sound locally...\n"); char destname[100]; sprintf (destname,"%s\\%s",LocalSoundsDir,SoundFiles[Sounds[sound_handle].sample_index].name); @@ -384,7 +384,7 @@ void CWorldSoundsDialog::OnDeleteSound() mng_FreeTrackLock (tl); if (!mng_DeletePage (Sounds[n].name,PAGETYPE_SOUND,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -632,7 +632,7 @@ void CWorldSoundsDialog::OnSelendokSoundPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted sound list, but probably nothing.")); + mprintf(0,"Possible corrupted sound list, but probably nothing."); UpdateDialog(); } diff --git a/legacy/editor/WorldTexturesDialog.cpp b/legacy/editor/WorldTexturesDialog.cpp index 81592ceb..52c5be6b 100644 --- a/legacy/editor/WorldTexturesDialog.cpp +++ b/legacy/editor/WorldTexturesDialog.cpp @@ -466,7 +466,7 @@ void CWorldTexturesDialog::OnWtexdlgAddnew() GameTextures[tex_handle].bm_handle=bm_handle; - mprintf ((0,"Making a copy of this bitmap/anim locally...\n")); + mprintf(0,"Making a copy of this bitmap/anim locally...\n"); if (!anim) { @@ -1007,7 +1007,7 @@ void CWorldTexturesDialog::OnSelendokTexList() if (i==-1) { - mprintf ((0,"Possible corrupted texture list, but probably nothing.")); + mprintf(0,"Possible corrupted texture list, but probably nothing."); UpdateDialog(); } @@ -1323,7 +1323,7 @@ void CWorldTexturesDialog::OnDelete() mng_FreeTrackLock (tl); if (!mng_DeletePage (GameTextures[n].name,PAGETYPE_TEXTURE,1)) { - mprintf ((0,ErrorString)); + mprintf(0,ErrorString); Int3(); } } @@ -1347,7 +1347,7 @@ void CWorldTexturesDialog::OnDelete() MessageBox ("Texture deleted."); D3EditState.texdlg_texture=GetNextTexture (n); if (D3EditState.texdlg_texture==n) - mprintf ((0,"Wrapped!\n")); + mprintf(0,"Wrapped!\n"); UpdateDialog (); } @@ -1440,7 +1440,7 @@ void CWorldTexturesDialog::OnLoadBitmap() GameTextures[n].flags &=~TF_ANIMATED; - mprintf ((0,"Making a copy of this bitmap locally...\n")); + mprintf(0,"Making a copy of this bitmap locally...\n"); if (anim) { @@ -1692,7 +1692,7 @@ void CWorldTexturesDialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrol // ok, new_pos will be an index into the listbox, NOT the texture list. // so we will get the number of texture rows we went up or down and change // tex_start accordingly. - mprintf((0, "scroll new_pos = %d. original_pos = %d\n", new_pos, m_TexListPos)); + mprintf(0, "scroll new_pos = %d. original_pos = %d\n", new_pos, m_TexListPos); if (new_pos < m_TexListPos) TextureListUp(abs(m_TexListPos-new_pos)); if (new_pos > m_TexListPos) TextureListDown(abs(new_pos-m_TexListPos)); @@ -1730,11 +1730,11 @@ int CWorldTexturesDialog::LoadITLFile (char *filename,int type) infile=(CFILE *)cfopen (filename,"rt"); if (!infile) { - mprintf ((0,"Couldn't load ITL file %s!\n",filename)); + mprintf(0,"Couldn't load ITL file %s!\n",filename); return -1; } - mprintf ((0,"Loading ITL file %s\n",name)); + mprintf(0,"Loading ITL file %s\n",name); while (!done) { @@ -1783,7 +1783,7 @@ int CWorldTexturesDialog::LoadITLFile (char *filename,int type) int bm=LoadTextureImage (bmname,0,type,0); if (bm<=0) { - mprintf ((0,"Error loading frame %d of ITL file %s!\n",total,filename)); + mprintf(0,"Error loading frame %d of ITL file %s!\n",total,filename); goto Here; } @@ -1830,7 +1830,7 @@ int CWorldTexturesDialog::LoadITLFile (char *filename,int type) cfclose (infile); - mprintf ((0,"Making a copy of these textures locally...\n")); + mprintf(0,"Making a copy of these textures locally...\n"); for (i=0;inodes[j].edges[k].max_rad < 5.0f) { - mprintf((0, "EBNode Verify: Removed a skinny edge.\n")); + mprintf(0, "EBNode Verify: Removed a skinny edge.\n"); EBNode_RemoveEdge(j, i, nlist->nodes[j].edges[k].end_index, nlist->nodes[j].edges[k].end_room); k--; } @@ -243,7 +243,7 @@ bool EBNode_VerifyGraph() { if(Rooms[i].portals[j].bnode_index >= 0 && Rooms[i].portals[j].bnode_index >= Rooms[i].bn_info.num_nodes) { - mprintf((0, "EBNode: Bashed an invalid node\n")); + mprintf(0, "EBNode: Bashed an invalid node\n"); Rooms[i].portals[j].bnode_index = -1; } else if(Rooms[i].portals[j].bnode_index < 0) @@ -274,7 +274,7 @@ bool EBNode_VerifyGraph() vector pos; pos = rp->portals[j].path_pnt + rp->faces[rp->portals[j].portal_face].normal * 0.75f; rp->portals[j].bnode_index = EBNode_AddNode(i, &pos, false, false); - mprintf((0, "EBNode Verify: Added a portal node\n")); + mprintf(0, "EBNode Verify: Added a portal node\n"); } } } @@ -320,7 +320,7 @@ bool EBNode_VerifyGraph() { if(Rooms[i].portals[j].bnode_index >= 0) { - mprintf((0, "EBNode Verify: Removed a node.\n")); + mprintf(0, "EBNode Verify: Removed a node.\n"); EBNode_RemoveNode(i, Rooms[i].portals[j].bnode_index); } continue; @@ -332,7 +332,7 @@ bool EBNode_VerifyGraph() { if(Rooms[i].portals[j].bnode_index >= 0) { - mprintf((0, "EBNode Verify: Removed a node.\n")); + mprintf(0, "EBNode Verify: Removed a node.\n"); EBNode_RemoveNode(i, Rooms[i].portals[j].bnode_index); } continue; @@ -343,7 +343,7 @@ bool EBNode_VerifyGraph() { if(Rooms[i].portals[j].bnode_index >= 0) { - mprintf((0, "EBNode Verify: Removed a node.\n")); + mprintf(0, "EBNode Verify: Removed a node.\n"); EBNode_RemoveNode(i, Rooms[i].portals[j].bnode_index); } continue; @@ -376,7 +376,7 @@ bool EBNode_VerifyGraph() if(xxx >= BOA_num_connect[TERRAIN_REGION(roomnum)]) { - mprintf((0, "EBNode Verify: External room isn't in terrain region list\n")); + mprintf(0, "EBNode Verify: External room isn't in terrain region list\n"); f_verified = false; continue; } @@ -384,7 +384,7 @@ bool EBNode_VerifyGraph() rp->portals[j].bnode_index = EBNode_AddNode(roomnum, &pos, false, false); ASSERT(rp->portals[j].bnode_index >= 0); EBNode_AutoEdgeNode(rp->portals[j].bnode_index, roomnum); - mprintf((0, "EBNode Verify: Added a node and autoedged it.\n")); + mprintf(0, "EBNode Verify: Added a node and autoedged it.\n"); if(ci >= 0) { @@ -398,7 +398,7 @@ bool EBNode_VerifyGraph() rp->portals[j].bnode_index = EBNode_AddNode(i, &pos, false, false); ASSERT(rp->portals[j].bnode_index >= 0); EBNode_AutoEdgeNode(rp->portals[j].bnode_index, i); - mprintf((0, "EBNode Verify: Added a node and autoedged it.\n")); + mprintf(0, "EBNode Verify: Added a node and autoedged it.\n"); int cr = rp->portals[j].croom; int ci = Rooms[cr].portals[rp->portals[j].cportal].bnode_index; @@ -449,7 +449,7 @@ bool EBNode_VerifyGraph() { if(nlist->nodes[j].edges[k].max_rad < 5.0f) { - mprintf((0, "EBNode Verify: Removed a skinny edge.\n")); + mprintf(0, "EBNode Verify: Removed a skinny edge.\n"); EBNode_RemoveEdge(j, i, nlist->nodes[j].edges[k].end_index, nlist->nodes[j].edges[k].end_room); k--; } @@ -459,7 +459,7 @@ bool EBNode_VerifyGraph() { if(nlist->nodes[j].edges[k].end_room <= Highest_room_index && !Rooms[nlist->nodes[j].edges[k].end_room].used) { - mprintf((0, "EBNode Verify: Removed a edge to a non-existant room. Room %d, node %d, edge %d\n", i, j, k)); + mprintf(0, "EBNode Verify: Removed a edge to a non-existant room. Room %d, node %d, edge %d\n", i, j, k); EBNode_RemoveEdge(j, i, nlist->nodes[j].edges[k].end_index, nlist->nodes[j].edges[k].end_room); k--; } @@ -487,7 +487,7 @@ bool EBNode_VerifyGraph() { if(nlist->nodes[j].edges[k].max_rad < 5.0f) { - mprintf((0, "Skinny Edge - from r%d n%d to r%d n%d\n", i, j, nlist->nodes[j].edges[k].end_room, nlist->nodes[j].edges[k].end_index)); + mprintf(0, "Skinny Edge - from r%d n%d to r%d n%d\n", i, j, nlist->nodes[j].edges[k].end_room, nlist->nodes[j].edges[k].end_index); f_verified = false; } } @@ -512,7 +512,7 @@ bool EBNode_VerifyGraph() { if(!BNode_FindPath(i, j, k, 0.0f)) { - mprintf((0, "BNODE ERROR: No path from %d to %d in room %d\n", j + 1, k + 1, i)); + mprintf(0, "BNODE ERROR: No path from %d to %d in room %d\n", j + 1, k + 1, i); f_verified = false; } } @@ -522,9 +522,9 @@ bool EBNode_VerifyGraph() BNode_verified = f_verified; if(f_verified) - mprintf((0, "EBNode: VERIFY OK!\n")); + mprintf(0, "EBNode: VERIFY OK!\n"); else - mprintf((0, "EBNode: VERIFY FAILED!\n")); + mprintf(0, "EBNode: VERIFY FAILED!\n"); return f_verified; } @@ -1225,7 +1225,7 @@ void EBNode_MakeDefaultTerrainNodes(int region) ASSERT(region >= 0 || region < BOA_num_terrain_regions); - mprintf((0, "TR %d has %d nodes\n", region, BOA_num_connect[region])); + mprintf(0, "TR %d has %d nodes\n", region, BOA_num_connect[region]); // Adds the nodes from portals for(i = 0; i < BOA_num_connect[region]; i++) diff --git a/legacy/editor/editor.cpp b/legacy/editor/editor.cpp index a8e52472..3085101b 100644 --- a/legacy/editor/editor.cpp +++ b/legacy/editor/editor.cpp @@ -704,14 +704,14 @@ BOOL CEditorApp::OnIdle(LONG lCount) // note that if a slew key was pressed, the main view is out of keyboard focus, set // keyboard focus to the main_view. if (main_view && main_view != CWnd::GetFocus()) { - mprintf((0,"Restoring focus to main view.\n")); + mprintf(0,"Restoring focus to main view.\n"); main_view->SetFocus(); } } else if (KEY_STATE(KEY_LCTRL) || KEY_STATE(KEY_RCTRL)) { // this is done to support CTRL-KEYPAD functions if input focus is not in main view if (main_view && main_view != CWnd::GetFocus()) { - mprintf((0,"Restoring focus to main view.\n")); + mprintf(0,"Restoring focus to main view.\n"); main_view->SetFocus(); } } @@ -720,7 +720,7 @@ BOOL CEditorApp::OnIdle(LONG lCount) if (main_view && main_view != CWnd::GetFocus()) { CRuntimeClass *wndtype = CWnd::GetFocus()->GetRuntimeClass(); if (strcmp(wndtype->m_lpszClassName, "CEdit")) { - mprintf((0,"Restoring focus to main view.\n")); + mprintf(0,"Restoring focus to main view.\n"); main_view->SetFocus(); } } @@ -827,7 +827,7 @@ void SaveEditorSettings() res = Editor_database.lookup_record("editor"); if (!res) { - mprintf((0,"Can't get editor registry path\n")); + mprintf(0,"Can't get editor registry path\n"); Int3(); return; } @@ -889,7 +889,7 @@ void LoadEditorSettings() res = Editor_database.lookup_record("editor"); if (!res) { - mprintf((0,"Can't get editor registry path\n")); + mprintf(0,"Can't get editor registry path\n"); Int3(); return; } @@ -1022,7 +1022,7 @@ CDocument* CEditorApp::OpenDocumentFile(LPCTSTR lpszFileName) // this, and then if so to close the current document if (AfxMessageBox("This will discard all changes made to the level.\nDo you want to continue?", MB_YESNO) == IDYES) { - mprintf((0, "Restoring %s...\n", lpszFileName)); + mprintf(0, "Restoring %s...\n", lpszFileName); main_doc->OnOpenDocument(lpszFileName); } } diff --git a/legacy/editor/editorDoc.cpp b/legacy/editor/editorDoc.cpp index 98f367ac..814cb92c 100644 --- a/legacy/editor/editorDoc.cpp +++ b/legacy/editor/editorDoc.cpp @@ -201,7 +201,7 @@ BOOL CEditorDoc::OnNewDocument() // (SDI documents will reuse this document) // Reinitialize Editor State. - mprintf((0, "Creating new level...\n")); + mprintf(0, "Creating new level...\n"); // D3EditState.texdlg_texture = 0; // Create new mine @@ -238,7 +238,7 @@ BOOL CEditorDoc::OnOpenDocument(LPCTSTR lpszPathName) // TODO: Add your specialized creation code here // does the level always load correctly? - mprintf((0, "Opening level %s...\n", lpszPathName)); + mprintf(0, "Opening level %s...\n", lpszPathName); theApp.pause(); CKeypadDialog::Deactivate(); @@ -271,7 +271,7 @@ BOOL CEditorDoc::OnSaveDocument(LPCTSTR lpszPathName) if (strchr(filename,'.') == 0) strcat(filename, ".d3l"); // check for extension - mprintf((0, "Saving level %s...\n", lpszPathName)); + mprintf(0, "Saving level %s...\n", lpszPathName); retval = (BOOL)EditorSaveLevel((char *)lpszPathName); if (retval) @@ -339,7 +339,7 @@ void CEditorDoc::OnCloseDocument() { // TODO: Add your specialized code here and/or call the base class COleServerDoc::OnCloseDocument(); - mprintf((0,"Closing current level...\n")); + mprintf(0,"Closing current level...\n"); theApp.main_doc = NULL; } diff --git a/legacy/editor/editorView.cpp b/legacy/editor/editorView.cpp index 7e129938..2993d82d 100644 --- a/legacy/editor/editorView.cpp +++ b/legacy/editor/editorView.cpp @@ -559,7 +559,7 @@ void CEditorView::OnInitialUpdate() wnd->Invalidate(FALSE); - mprintf((0, "CEditorView::OnInitialUpdate.\n")); + mprintf(0, "CEditorView::OnInitialUpdate.\n"); } @@ -660,7 +660,7 @@ void CEditorView::OnButtonOutline() GetCursorPos(&pnt); if(!popup.TrackPopupMenu(TPM_LEFTALIGN,pnt.x-20,pnt.y-10,this,NULL)) - mprintf((0,"TrackPopupMenu error!\n")); + mprintf(0,"TrackPopupMenu error!\n"); // Outline_mode ^= OM_ON; // EditorStatus("Outline mode turned %s",OUTLINE_ON(0)?"ON":"OFF"); diff --git a/legacy/editor/editor_lighting.cpp b/legacy/editor/editor_lighting.cpp index d24a277d..d56f65c3 100644 --- a/legacy/editor/editor_lighting.cpp +++ b/legacy/editor/editor_lighting.cpp @@ -354,7 +354,7 @@ void CheckCombinePortals (int terrain) ClearCombinePortals (terrain); int combine_count=0; - mprintf ((0,"Combining portals...")); + mprintf(0,"Combining portals..."); for (int i=0;i<=Highest_room_index;i++) { @@ -448,7 +448,7 @@ void CheckCombinePortals (int terrain) } } - mprintf ((0,"%d portals combined.\n",combine_count)); + mprintf(0,"%d portals combined.\n",combine_count); } @@ -456,7 +456,7 @@ void CheckCombinePortals (int terrain) void SqueezeLightmaps (int external,int target_roomnum) { int i,t,k; - mprintf ((0,"Squeezing %s lightmaps, please wait...\n",external?"external":"internal")); + mprintf(0,"Squeezing %s lightmaps, please wait...\n",external?"external":"internal"); Lmi_spoken_for=(uint8_t *)mem_malloc (MAX_LIGHTMAP_INFOS); Lightmap_mask=(uint8_t *)mem_malloc (128*128); @@ -809,7 +809,7 @@ void SqueezeLightmaps (int external,int target_roomnum) mem_free (Lightmap_mask); mem_free (Lmi_spoken_for); - mprintf ((0,"Done squeezing lightmaps.\n")); + mprintf(0,"Done squeezing lightmaps.\n"); } @@ -981,7 +981,7 @@ void DoRadiosityForRooms () SaveLevel(filename); } - mprintf ((0,"Setting up...\n")); + mprintf(0,"Setting up...\n"); Lightmaps_for_rad=0; @@ -1095,7 +1095,7 @@ void DoRadiosityForRooms () else { Light_surfaces[surface_index].verts=NULL; - mprintf ((0,"Room=%d Face %d has no verts!\n",i,t)); + mprintf(0,"Room=%d Face %d has no verts!\n",i,t); } if (Light_surfaces[surface_index].xresolution*Light_surfaces[surface_index].yresolution) @@ -1106,7 +1106,7 @@ void DoRadiosityForRooms () else { Light_surfaces[surface_index].elements=NULL; - mprintf ((0,"Room=%d Face %d is slivered!\n",i,t)); + mprintf(0,"Room=%d Face %d is slivered!\n",i,t); } Light_surfaces[surface_index].flags=0; @@ -1207,13 +1207,13 @@ void DoRadiosityForRooms () // Setup Objects ComputeSurfacesForObjects (surface_index,0); - mprintf ((0,"This radiosity run is using %d lightmaps.\n",Lightmaps_for_rad)); - mprintf ((0,"Solving radiosity equation (press tilde key to stop)...\n")); + mprintf(0,"This radiosity run is using %d lightmaps.\n",Lightmaps_for_rad); + mprintf(0,"Solving radiosity equation (press tilde key to stop)...\n"); if (D3EditState.hemicube_radiosity) DoRadiosityRun (SM_HEMICUBE,Light_surfaces,facecount); else DoRadiosityRun (SM_RAYCAST,Light_surfaces,facecount); - mprintf ((0,"Done solving radiosity - cleaning up...\n")); + mprintf(0,"Done solving radiosity - cleaning up...\n"); surface_index=0; @@ -1297,7 +1297,7 @@ void DoRadiosityForCurrentRoom (room *rp) return; } - mprintf ((0,"Setting up...\n")); + mprintf(0,"Setting up...\n"); ASSERT (rp!=NULL); ASSERT (rp->used); @@ -1366,7 +1366,7 @@ void DoRadiosityForCurrentRoom (room *rp) else { Light_surfaces[surface_index].verts=NULL; - mprintf ((0,"Room=%d Face %d has no verts!\n",rp-Rooms,t)); + mprintf(0,"Room=%d Face %d has no verts!\n",rp-Rooms,t); } if (Light_surfaces[surface_index].xresolution*Light_surfaces[surface_index].yresolution) @@ -1377,7 +1377,7 @@ void DoRadiosityForCurrentRoom (room *rp) else { Light_surfaces[surface_index].elements=NULL; - mprintf ((0,"Room=%d Face %d is slivered!\n",rp-Rooms,t)); + mprintf(0,"Room=%d Face %d is slivered!\n",rp-Rooms,t); } if (rp->faces[t].portal_num!=-1 && @@ -1416,12 +1416,12 @@ void DoRadiosityForCurrentRoom (room *rp) // Setup Objects ComputeSurfacesForObjectsForSingleRoom (surface_index,rp-Rooms); - mprintf ((0,"Solving radiosity equation (press tilde key to stop)...\n")); + mprintf(0,"Solving radiosity equation (press tilde key to stop)...\n"); if (D3EditState.hemicube_radiosity) DoRadiosityRun (SM_HEMICUBE,Light_surfaces,facecount); else DoRadiosityRun (SM_RAYCAST,Light_surfaces,facecount); - mprintf ((0,"Done solving radiosity - cleaning up...\n")); + mprintf(0,"Done solving radiosity - cleaning up...\n"); surface_index=0; @@ -1805,13 +1805,13 @@ int ClipRadToPlane (int plane,rad_point *src,rad_point *dest,int nv) else ppoint=i-1; - //mprintf ((0,"checking point %d ",i)); + //mprintf(0,"checking point %d ",i); if (src[i].code & plane) // off this plane? { if (!(src[ppoint].code & plane)) // prev point on? { - //mprintf ((0,"pVertex %d off %d plane.\n",i,plane)); + //mprintf(0,"pVertex %d off %d plane.\n",i,plane); ClipRadEdge (plane,&src[ppoint],&src[i]); memcpy (&dest[num],&GlobalTempRadPoint,sizeof(rad_point)); @@ -1823,7 +1823,7 @@ int ClipRadToPlane (int plane,rad_point *src,rad_point *dest,int nv) if (!(src[npoint].code & plane)) // next point on? { - //mprintf ((0,"nVertex %d off %d plane.\n",i,plane)); + //mprintf(0,"nVertex %d off %d plane.\n",i,plane); ClipRadEdge (plane,&src[npoint],&src[i]); memcpy (&dest[num],&GlobalTempRadPoint,sizeof(rad_point)); @@ -1836,7 +1836,7 @@ int ClipRadToPlane (int plane,rad_point *src,rad_point *dest,int nv) else // This point is on { - //mprintf ((0,"is on\n")); + //mprintf(0,"is on\n"); memcpy (&dest[num],&src[i],sizeof(rad_point)); num++; @@ -1941,8 +1941,8 @@ void DoTerrainDynamicTable () maxrays=AREA_X*AREA_Z*8*Terrain_sky.num_satellites; - mprintf ((0,"Calculating dynamic light table for %d points...\n",maxrays)); - mprintf ((0,"Press tilde key to abort!\n")); + mprintf(0,"Calculating dynamic light table for %d points...\n",maxrays); + mprintf(0,"Press tilde key to abort!\n"); memset (Terrain_dynamic_table,0,(TERRAIN_DEPTH*TERRAIN_WIDTH)); @@ -1988,7 +1988,7 @@ void DoTerrainDynamicTable () for (j=0;jpos.y) continue; @@ -2010,7 +2010,7 @@ void ComputeTerrainSpeedTable () { int i,t,j,raynum=0; - mprintf ((0,"Precomputing terrain speed table...(%d rays)\n",AREA_X*AREA_Z)); + mprintf(0,"Precomputing terrain speed table...(%d rays)\n",AREA_X*AREA_Z); for (i=0;iname)); + mprintf(0,"%d %s faces couldn't be combined!\n",not_combined,pm->name); // Free memory for (i=0;in_models;i++) diff --git a/legacy/editor/gameeditor.cpp b/legacy/editor/gameeditor.cpp index 10362da4..93a4a82b 100644 --- a/legacy/editor/gameeditor.cpp +++ b/legacy/editor/gameeditor.cpp @@ -577,7 +577,7 @@ void RunGameFromEditor() renderer_type old_rend=PreferredRenderer; // Run the damn game - mprintf((0, "Entering the game...\n")); + mprintf(0, "Entering the game...\n"); Editor_active = false; PROGRAM(editor) = 0; @@ -592,7 +592,7 @@ void RunGameFromEditor() Editor_active = true; SetFunctionMode(EDITOR_MODE); // ASSERT WE ARE IN EDITOR MODE! - mprintf((0, "Returning to editor...\n")); + mprintf(0, "Returning to editor...\n"); } //Vars for getting the viewer position back from the game to the editor @@ -784,9 +784,9 @@ void EditorToGame() FindPlayerStarts(); //Save the level to restore when go back to editor - mprintf((0,"Make temp copy of level...")); + mprintf(0,"Make temp copy of level..."); SaveLevel("GameSave.D3L"); - mprintf((0,"done\n")); + mprintf(0,"done\n"); Temp_level_saved = 1; //say that we have a level saved //Save the viewer position for the game to use @@ -954,7 +954,7 @@ void InitEditGameSystems() //Load up the pilot selected by default if(cfexist(Default_pilot)) { - mprintf((0,"Loading up Default Pilot: %s\n",Default_pilot)); + mprintf(0,"Loading up Default Pilot: %s\n",Default_pilot); Current_pilot.set_filename(Default_pilot); PltReadFile(&Current_pilot,true,true); }else{ diff --git a/legacy/editor/jaytest.cpp b/legacy/editor/jaytest.cpp index 0093864f..10a5edde 100644 --- a/legacy/editor/jaytest.cpp +++ b/legacy/editor/jaytest.cpp @@ -85,7 +85,7 @@ void RenderTexFrame (grViewport *my_viewport) newtime=time(NULL); if (newtime!=oldtime) { - mprintf_at((1,2,0,"%d FPS ",framecount)); + mprintf_at(1,2,0,"%d FPS ",framecount); oldtime=newtime; framecount=0; } diff --git a/legacy/editor/rad_cast.cpp b/legacy/editor/rad_cast.cpp index 74bfc651..d4603927 100644 --- a/legacy/editor/rad_cast.cpp +++ b/legacy/editor/rad_cast.cpp @@ -432,7 +432,7 @@ int ShootRayFromPoint (vector *src,vector *dest,rad_surface *src_surf,rad_surfac dist=vm_VectorDistance(&hit_info.hit_pnt,&temp_dest); if (dist>.1) { - //mprintf ((0,"Didn't hit!\n")); + //mprintf(0,"Didn't hit!\n"); return 0; } @@ -516,7 +516,7 @@ float GetFormFactorForElementAndSatellite (rad_surface *dest_surf,rad_element *d form_factor/=dest_element->num_verts; if (form_factor>1) - mprintf ((0,"form factor >1!\n")); + mprintf(0,"form factor >1!\n"); return form_factor; @@ -690,7 +690,7 @@ float GetFormFactorForElement (rad_surface *dest_surf,rad_element *dest_element, ff=(vm_DotProduct (&src_norm_ray,&src_normal) * vm_DotProduct(&dest_normal,&dest_norm_ray))/((3.14 * ray_length * ray_length)+ray_area); if (ff>1) - mprintf ((0,"ff >1!\n")); + mprintf(0,"ff >1!\n"); if (ff>0) temp_factor+=ff; @@ -727,7 +727,7 @@ float GetFormFactorForElement (rad_surface *dest_surf,rad_element *dest_element, form_factor+=temp_factor; if (form_factor>1) - mprintf ((0,"form factor >1! val=%f\n",form_factor)); + mprintf(0,"form factor >1! val=%f\n",form_factor); } @@ -810,7 +810,7 @@ float GetFormFactorForElementSuperDetail (rad_surface *dest_surf,rad_element *de ff=(vm_DotProduct (&src_norm_ray,&src_normal) * vm_DotProduct(&dest_normal,&dest_norm_ray))/((3.14 * ray_length * ray_length)+ray_area); if (ff>1) - mprintf ((0,"ff >1!\n")); + mprintf(0,"ff >1!\n"); if (ff>0) temp_factor+=ff; @@ -843,7 +843,7 @@ float GetFormFactorForElementSuperDetail (rad_surface *dest_surf,rad_element *de form_factor+=temp_factor; if (form_factor>1) - mprintf ((0,"form factor >1! val=%f\n",form_factor)); + mprintf(0,"form factor >1! val=%f\n",form_factor); return form_factor; } @@ -1123,8 +1123,8 @@ void CalculateFormFactorsRaycast () if ((raycount%1000)==0) { - mprintf_at((2,4,0,"Ray=%d ",raycount)); - mprintf_at((2,5,0,"Ignore=%d ",Rays_ignored)); + mprintf_at(2,4,0,"Ray=%d ",raycount); + mprintf_at(2,5,0,"Ignore=%d ",Rays_ignored); } raycount++; @@ -1203,8 +1203,8 @@ void CalculateFormFactorsRaycast () if (rad_MaxSurface->surface_type==ST_ROOM && Calculate_specular_lighting) CheckToUpdateSpecularFace (dest_surf,&Current_max_specular_color,NULL); - //mprintf_at((2,4,0,"Ray=%d ",raycount)); - //mprintf_at((2,5,0,"Ignore=%d ",Rays_ignored)); + //mprintf_at(2,4,0,"Ray=%d ",raycount); + //mprintf_at(2,5,0,"Ignore=%d ",Rays_ignored); } } diff --git a/legacy/editor/rad_hemicube.cpp b/legacy/editor/rad_hemicube.cpp index bfcd40f0..d39fdc71 100644 --- a/legacy/editor/rad_hemicube.cpp +++ b/legacy/editor/rad_hemicube.cpp @@ -401,8 +401,8 @@ void EndHemicubeDrawing (int face) EndEditorFrame(); - mprintf_at ((2,4,0,"CTF=%d ",Cracks_this_frame)); - mprintf_at ((2,5,0,"CTS=%d ",Cracks_this_side)); + mprintf_at(2,4,0,"CTF=%d ",Cracks_this_frame); + mprintf_at(2,5,0,"CTS=%d ",Cracks_this_side); if (Show_rad_progress) diff --git a/legacy/editor/rad_init.cpp b/legacy/editor/rad_init.cpp index 64f5780f..e60a2e48 100644 --- a/legacy/editor/rad_init.cpp +++ b/legacy/editor/rad_init.cpp @@ -75,7 +75,7 @@ int DoRadiosityRun (int method,rad_surface *light_surfaces,int count) { float start_time; - mprintf ((0,"Calculating radiosity on %d faces.\n",count)); + mprintf(0,"Calculating radiosity on %d faces.\n",count); rad_Surfaces=light_surfaces; rad_NumSurfaces=count; @@ -97,7 +97,7 @@ int DoRadiosityRun (int method,rad_surface *light_surfaces,int count) CloseRadiosityRun(); // Print time taken - mprintf((0,"\nLighting took %.4f seconds.\n",timer_GetTime()-start_time)); + mprintf(0,"\nLighting took %.4f seconds.\n",timer_GetTime()-start_time); return 1; } @@ -225,7 +225,7 @@ void CountElements () rad_NumElements+=(surf->xresolution*surf->yresolution); } - mprintf ((0,"Number of elements=%d\n",rad_NumElements)); + mprintf(0,"Number of elements=%d\n",rad_NumElements); } @@ -319,11 +319,11 @@ void UpdateUnsentValues () else rad_Convergence = 0.0; - mprintf_at ((2,3,0,"Left=%f ",rad_Convergence)); + mprintf_at(2,3,0,"Left=%f ",rad_Convergence); if (timer_GetTime()-last_report_time>10.0) { - mprintf ((0,"Percentage left=%f\n",rad_Convergence)); + mprintf(0,"Percentage left=%f\n",rad_Convergence); last_report_time=timer_GetTime(); } @@ -366,7 +366,7 @@ void CalculateRadiosity () rad_DoneCalculating=1; break; } - mprintf_at ((2,2,0,"Lightcount=%d ",rad_StepCount)); + mprintf_at(2,2,0,"Lightcount=%d ",rad_StepCount); DoRadiosityIteration(); diff --git a/legacy/editor/roomkeypaddialog.cpp b/legacy/editor/roomkeypaddialog.cpp index cabf99d8..2a6e7268 100644 --- a/legacy/editor/roomkeypaddialog.cpp +++ b/legacy/editor/roomkeypaddialog.cpp @@ -540,7 +540,7 @@ void CRoomKeypadDialog::OnSelendokRoomPulldown() if (i==-1) { - mprintf ((0,"Possible corrupted room list, but probably nothing.")); + mprintf(0,"Possible corrupted room list, but probably nothing."); UpdateDialog(); } @@ -1725,9 +1725,9 @@ void CRoomKeypadDialog::OnBadCenterpoints() char message[10000]; message[0] = '\0'; - mprintf((0, "Computing bad centers\n")); + mprintf(0, "Computing bad centers\n"); BOA_ComputePathPoints(message, 10000); - mprintf((0, "Done computing bad centers... List in clipboard.\n")); + mprintf(0, "Done computing bad centers... List in clipboard.\n"); DumpTextToClipboard(message); } diff --git a/legacy/mtclient/chat_api.cpp b/legacy/mtclient/chat_api.cpp index 95ea3bd0..b3e62eef 100644 --- a/legacy/mtclient/chat_api.cpp +++ b/legacy/mtclient/chat_api.cpp @@ -54,9 +54,9 @@ typedef int (*PollUI_fp) (void); extern PollUI_fp DLLPollUI; #ifndef RELEASE -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #else -#define DLLmprintf(args) +#define DLLmprintf(...) #endif typedef void( *Debug_ConsolePrintf_fp ) (int n, const char *format, ... ); @@ -222,8 +222,8 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) if(rcode!=1) { - DLLmprintf((0,"Unable to gethostbyname(\"%s\").\n",chat_server)); - DLLmprintf((0,"WSAGetLastError() returned %d.\n",WSAGetLastError() )); + DLLmprintf(0,"Unable to gethostbyname(\"%s\").\n",chat_server); + DLLmprintf(0,"WSAGetLastError() returned %d.\n",WSAGetLastError() ); DLLnw_Asyncgethostbyname(NULL,NW_AGHBN_CANCEL,NULL); return 0; } @@ -241,7 +241,7 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) if(WSAEWOULDBLOCK == ret || 0 == ret) #endif { - DLLmprintf((0,"Beginning socket connect\n")); + DLLmprintf(0,"Beginning socket connect\n"); Socket_connecting = 1; return 0; } @@ -249,10 +249,10 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) else { //This should never happen, connect should always return WSAEWOULDBLOCK - DLLmprintf((0,"connect returned too soon!\n")); + DLLmprintf(0,"connect returned too soon!\n"); Socket_connecting = 1; Socket_connected = 1; - DLLmprintf((0,"Socket connected, sending user and nickname request\n")); + DLLmprintf(0,"Socket connected, sending user and nickname request\n"); sprintf(signon_str,"/USER %s %s %s :%s","user","user","user",Chat_tracker_id); SendChatString(signon_str,1); sprintf(signon_str,"/NICK %s",Nick_name); @@ -287,7 +287,7 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) if(select(Chatsock+1,NULL,&write_fds,NULL,&timeout)) { Socket_connected = 1; - DLLmprintf((0,"Socket connected, sending user and nickname request\n")); + DLLmprintf(0,"Socket connected, sending user and nickname request\n"); sprintf(signon_str,"/USER %s %s %s :%s","user","user","user",Chat_tracker_id); SendChatString(signon_str,1); sprintf(signon_str,"/NICK %s",Nick_name); @@ -300,7 +300,7 @@ int ConnectToChatServer(char *serveraddr,char *nickname,char *trackerid) //error -- that means it's not going to connect if(select(Chatsock+1,NULL,NULL,&error_fds,&timeout)) { - DLLmprintf((0,"Select returned an error!\n")); + DLLmprintf(0,"Select returned an error!\n"); return -1; } return 0; @@ -534,14 +534,14 @@ const char *ChatGetString(void) if(WSAEWOULDBLOCK != lerror && 0 != lerror) #endif { - DLLmprintf((0,"recv caused an error: %d\n",lerror)); + DLLmprintf(0,"recv caused an error: %d\n",lerror); } return NULL; } if(bytesread) { ch[1] = NULL; - //DLLmprintf((0,ch)); + //DLLmprintf(0,ch); if((ch[0] == 0x0a)||(ch[0]==0x0d)) { if(Input_chat_buffer[0]=='\0') @@ -551,7 +551,7 @@ const char *ChatGetString(void) } strcpy(return_string,Input_chat_buffer); Input_chat_buffer[0] = NULL; - //DLLmprintf((0,"->|%s\n",return_string)); + //DLLmprintf(0,"->|%s\n",return_string); p = ParseIRCMessage(return_string,MSG_REMOTE); return p; @@ -561,7 +561,7 @@ const char *ChatGetString(void) else { //Select said we had read data, but 0 bytes read means disconnected - DLLmprintf((0,"Disconnected! Doh!")); + DLLmprintf(0,"Disconnected! Doh!"); AddChatCommandToQueue(CC_DISCONNECTED,NULL,0); return NULL; } @@ -1094,7 +1094,7 @@ char * ParseIRCMessage(char *Line, int iMode) { if (!Chat_server_connected) { - DLLmprintf((0,"Connected to chat server!\n")); + DLLmprintf(0,"Connected to chat server!\n"); Chat_server_connected=1; //We want to make sure we know our nick. This is somewhat of a hack strcpy(Nick_name,GetWordNum(0,szRemLine+1)); diff --git a/legacy/mtclient/mt_net.cpp b/legacy/mtclient/mt_net.cpp index 376496b0..50329a87 100644 --- a/legacy/mtclient/mt_net.cpp +++ b/legacy/mtclient/mt_net.cpp @@ -131,7 +131,7 @@ SOCKADDR_IN ptrackaddr; SOCKADDR_IN ctrackaddr; SOCKADDR_IN sockaddr; -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #define NW_AGHBN_CANCEL 1 @@ -181,13 +181,13 @@ void InitMTSockets(void) int error=WSAStartup(ver,&ws_data); if (error!=0) { - DLLmprintf ((0,"There was an error initializing networking! Error=%d\n",error)); + DLLmprintf(0,"There was an error initializing networking! Error=%d\n",error); return; } else #endif { - DLLmprintf ((0,"Network initted successfully!\n")); + DLLmprintf(0,"Network initted successfully!\n"); } { @@ -199,7 +199,7 @@ void InitMTSockets(void) gtrackaddr.sin_family = AF_INET; //This would be a good place to resolve the IP based on a domain name - DLLmprintf((0,"Looking up hostname: %s.\n",GAMETRACKERNAME)); + DLLmprintf(0,"Looking up hostname: %s.\n",GAMETRACKERNAME); DLLnw_Asyncgethostbyname(&ip,NW_AGHBN_LOOKUP,GAMETRACKERNAME); @@ -218,8 +218,8 @@ void InitMTSockets(void) if(rcode!=1) { - DLLmprintf((0,"Unable to gethostbyname(\"%s\").\n",GAMETRACKERNAME)); - DLLmprintf((0,"WSAGetLastError() returned %d.\n",WSAGetLastError() )); + DLLmprintf(0,"Unable to gethostbyname(\"%s\").\n",GAMETRACKERNAME); + DLLmprintf(0,"WSAGetLastError() returned %d.\n",WSAGetLastError() ); DLLnw_Asyncgethostbyname(NULL,NW_AGHBN_CANCEL,NULL); return ; } @@ -235,7 +235,7 @@ void InitMTSockets(void) sockaddr.sin_family = AF_INET; sockaddr.sin_addr.s_addr = INADDR_ANY; sockaddr.sin_port = 0;//htons(REGPORT); - DLLmprintf((0,"Looking up hostname: %s.\n",PILOTTRACKERNAME)); + DLLmprintf(0,"Looking up hostname: %s.\n",PILOTTRACKERNAME); DLLnw_Asyncgethostbyname(&ip,NW_AGHBN_LOOKUP,PILOTTRACKERNAME); do { @@ -252,8 +252,8 @@ void InitMTSockets(void) if(rcode!=1) { - DLLmprintf((0,"Unable to gethostbyname(\"%s\").\n",PILOTTRACKERNAME)); - DLLmprintf((0,"WSAGetLastError() returned %d.\n",WSAGetLastError() )); + DLLmprintf(0,"Unable to gethostbyname(\"%s\").\n",PILOTTRACKERNAME); + DLLmprintf(0,"WSAGetLastError() returned %d.\n",WSAGetLastError() ); DLLnw_Asyncgethostbyname(NULL,NW_AGHBN_CANCEL,NULL); return; } @@ -270,10 +270,10 @@ void InitMTSockets(void) void CloseMTSockets(void) { #ifdef WIN32 - if (WSACleanup()) - { - DLLmprintf((0, "Error closing wsock!\n") ); - } + if (WSACleanup()) + { + DLLmprintf(0, "Error closing wsock!\n"); + } #endif } diff --git a/legacy/mtclient/mtclient.cpp b/legacy/mtclient/mtclient.cpp index c4627616..64461769 100644 --- a/legacy/mtclient/mtclient.cpp +++ b/legacy/mtclient/mtclient.cpp @@ -589,7 +589,7 @@ void UpdateGamelist(void *lb) if(gameid!=-1) { - DLLmprintf((0,"Removing %s\n",DLLNetwork_games[gameid].name)); + DLLmprintf(0,"Removing %s\n",DLLNetwork_games[gameid].name); } */ @@ -647,9 +647,9 @@ void UpdateGamelist(void *lb) NextGameItemNo++; PXOGamelist[j].handle = DLLNetwork_games[k].handle; PXOGamelist[j].used = true; - DLLmprintf((0,"Adding %s\n",DLLNetwork_games[k].name)); + DLLmprintf(0,"Adding %s\n",DLLNetwork_games[k].name); - //DLLmprintf ((0,"Found game: %s\n",DLLNetwork_games[k].name)); + //DLLmprintf(0,"Found game: %s\n",DLLNetwork_games[k].name); FormatServerLine(fmtline,k,j); if(DLLNetwork_games[k].dedicated_server) @@ -680,7 +680,7 @@ void UpdateGamelist(void *lb) if(gameid!=-1) { int k = gameid; - //DLLmprintf((0,"Updating %s\n",DLLNetwork_games[gameid].name)); + //DLLmprintf(0,"Updating %s\n",DLLNetwork_games[gameid].name); char fmtline[200]; FormatServerLine(fmtline,k,j); DLLSetUITextItemText(PXOGamelist[j].ti,fmtline,DLLNetwork_games[k].dedicated_server?UICOL_HOTSPOT_LO:GR_LIGHTGRAY); @@ -718,12 +718,12 @@ void DLLFUNCCALL DLLMultiInit (int *api_func) #endif #include "mdllinit.h" DLLPXOPort = (uint16_t)API.vp[32]; - DLLmprintf((0,"Inside DLLMultiInit...\n")); + DLLmprintf(0,"Inside DLLMultiInit...\n"); *DLLUse_DirectPlay = false; Auto_start=false; - DLLmprintf((0,"About to create string table...\n")); + DLLmprintf(0,"About to create string table...\n"); DLLCreateStringTable("mtclient.str",&StringTable,&StringTableSize); - DLLmprintf((0,"%d strings loaded from string table\n",StringTableSize)); + DLLmprintf(0,"%d strings loaded from string table\n",StringTableSize); if(!StringTableSize){ All_ok = false; return; @@ -736,7 +736,7 @@ void DLLFUNCCALL DLLMultiInit (int *api_func) // Called when the DLL is shutdown void DLLFUNCCALL DLLMultiClose () { - DLLmprintf((0,"Closing down PXO DLL\n")); + DLLmprintf(0,"Closing down PXO DLL\n"); DLLDestroyStringTable(StringTable,StringTableSize); DLLnw_UnRegisterCallback(PXO_NETID_USER_TRACKER); DLLnw_UnRegisterCallback(PXO_NETID_GAME_TRACKER); @@ -845,7 +845,7 @@ void DLLFUNCCALL DLLMultiCall (int eventnum) } else { - DLLmprintf((0,"Login failed!\n")); + DLLmprintf(0,"Login failed!\n"); *DLLMultiGameStarting = 0; return; } @@ -991,7 +991,7 @@ int LoginMasterTracker(void) switch(res) { case 3: - DLLmprintf((0,"Got event 3!\n")); + DLLmprintf(0,"Got event 3!\n"); break; case 4: #ifdef WIN32 @@ -1036,7 +1036,7 @@ int LoginMasterTracker(void) if(valret == 1) { //User was validated - DLLmprintf ((0,"Mastertracker user validated!\n")); + DLLmprintf(0,"Mastertracker user validated!\n"); //Run this to make sure we properly ACK the server. for(int j=0;j<10;j++) PollPTrackNet(); strcpy(DLLTracker_id,sztrackerid); @@ -1049,7 +1049,7 @@ int LoginMasterTracker(void) else if(valret == -1) { //User invalid! - DLLmprintf ((0,"Mastertracker user not validated!\n")); + DLLmprintf(0,"Mastertracker user not validated!\n"); DLLDoMessageBox(TXT_PXO_MASTERTRACKER,TXT_PXO_BADLOGIN,MSGBOX_OK,UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL); //Run this to make sure we properly ACK the server. for(int j=0;j<10;j++) PollPTrackNet(); @@ -1058,7 +1058,7 @@ int LoginMasterTracker(void) else { //timeout waiting for tracker! - DLLmprintf ((0,"Mastertracker timeout!\n")); + DLLmprintf(0,"Mastertracker timeout!\n"); DLLDoMessageBox(TXT_PXO_MASTERTRACKER,TXT_PXO_TIMEOUTMT,MSGBOX_OK,UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL); //Run this to make sure we properly ACK the server. for(int j=0;j<10;j++) PollPTrackNet(); @@ -1128,13 +1128,13 @@ struct int MainMultiplayerMenu () { - DLLmprintf((0,"%d",DESCENT3_BLOCK_SIZE)); + DLLmprintf(0,"%d",DESCENT3_BLOCK_SIZE); if(!ShowMessageOfTheDay()) { return 0; } - DLLmprintf((0,"Inside MainMultiplayerMenu()\n")); + DLLmprintf(0,"Inside MainMultiplayerMenu()\n"); if(Bypass_chat && !ChatStarted) { int rcode1 = SearchMasterTrackerGameMenu(); @@ -1257,7 +1257,7 @@ int MainMultiplayerMenu () sprintf(chat_whois_info,"%s %s",sztrackerid,pilot_name); chat_conn_time = DLLtimer_GetTime(); //DLLNewUIWindowSetFocusOnEditGadget(send_edit,main_wnd); - DLLmprintf((0,"About to connect...\n")); + DLLmprintf(0,"About to connect...\n"); do { #ifdef DEMO @@ -1308,7 +1308,7 @@ int MainMultiplayerMenu () DLLNewUIWindowClose(main_wnd); goto shutdownpxo; } - DLLmprintf((0,"Connected to chat server!\n")); + DLLmprintf(0,"Connected to chat server!\n"); if(!JoinNewLobby("#autoselect")) { ret = 0; @@ -1360,7 +1360,7 @@ int MainMultiplayerMenu () exit_menu = 1; break; default: - DLLmprintf((0,"Warning: Received an unknown chat command!\n")); + DLLmprintf(0,"Warning: Received an unknown chat command!\n"); break; } @@ -1451,7 +1451,7 @@ int MainMultiplayerMenu () if(tokp) { //Remove all previous items - DLLmprintf((0,"Refreshing channel list\n")); + DLLmprintf(0,"Refreshing channel list\n"); //get the text of the currently selected channel. //char * oldsel = DLLOldListGetItem(chan_list,DLLOldListGetSelectedIndex(chan_list)); // @@ -1584,9 +1584,9 @@ int MainMultiplayerMenu () case 3: //Join Mastertracker game { - DLLmprintf ((0,"Sending Mastertracker game list request.\n")); + DLLmprintf(0,"Sending Mastertracker game list request.\n"); RequestGameList(); - DLLmprintf ((0,"Calling SearchMasterTrackerGameMenu().\n")); + DLLmprintf(0,"Calling SearchMasterTrackerGameMenu().\n"); DLLNewUIWindowClose(main_wnd); *DLLGame_is_master_tracker_game = 1; int gamestart = SearchMasterTrackerGameMenu(); @@ -1631,7 +1631,7 @@ int MainMultiplayerMenu () case 6: //Send a private message //Create new dialog box, prompt for user and message, then send message - DLLmprintf((0,"Sending private Message\n")); + DLLmprintf(0,"Sending private Message\n"); //Get the currently selected pilot name strcpy(selpilot,DLLOldListGetItem(user_list,DLLOldListGetSelectedIndex(user_list))); SendWhisper(selpilot); @@ -1650,20 +1650,20 @@ int MainMultiplayerMenu () break; case 9: //Find a pilot - DLLmprintf((0,"Finding a pilot\n")); + DLLmprintf(0,"Finding a pilot\n"); FindPilot(); break; case 10: //Get pilot stats - DLLmprintf((0,"Getting pilot statistics\n")); + DLLmprintf(0,"Getting pilot statistics\n"); strcpy(selpilot,DLLOldListGetItem(user_list,DLLOldListGetSelectedIndex(user_list))); GetPilotStats(selpilot); break; case 11: { - DLLmprintf ((0,"Sending Mastertracker game list request.\n")); + DLLmprintf(0,"Sending Mastertracker game list request.\n"); RequestGameList(); - DLLmprintf ((0,"Calling SearchMasterTrackerGameMenu().\n")); + DLLmprintf(0,"Calling SearchMasterTrackerGameMenu().\n"); DLLNewUIWindowClose(main_wnd); *DLLGame_is_master_tracker_game = 1; int gamestart = SearchMasterTrackerGameMenu(); @@ -1686,10 +1686,10 @@ int MainMultiplayerMenu () break; case 14: //Channel list box - DLLmprintf((0,"Joining new public channel\n")); + DLLmprintf(0,"Joining new public channel\n"); { int selitem = 0; - DLLmprintf((0,"Joining new public channel\n")); + DLLmprintf(0,"Joining new public channel\n"); selitem = DLLOldListGetSelectedIndex(chan_list); if(!JoinNewLobby(chan_info[selitem].origname)) { @@ -1747,10 +1747,10 @@ shutdownpxo: user_ti[i] = NULL; } *DLLNewUIWindow_alpha = oldalpha; - DLLmprintf((0,"Disconnecting from PXO.\n")); + DLLmprintf(0,"Disconnecting from PXO.\n"); DisconnectFromChatServer(); ChatStarted = 0; - DLLmprintf((0,"Disconnected.\n")); + DLLmprintf(0,"Disconnected.\n"); DLLToggleUICallback(1); //Delete all those items we created @@ -2046,7 +2046,7 @@ int SearchMasterTrackerGameMenu () last_req_time=DLLtimer_GetTime(); RequestGameList(); *DLLNum_network_games_known=0; - DLLmprintf ((0,"Waiting for Mastertracker response.\n")); + DLLmprintf(0,"Waiting for Mastertracker response.\n"); // Menu loop @@ -2062,7 +2062,7 @@ int SearchMasterTrackerGameMenu () res = DLLPollUI(); if(games) { - //DLLmprintf ((0,"GetGameList() returned a gamedata.\n")); + //DLLmprintf(0,"GetGameList() returned a gamedata.\n"); for(i=0;i<(MAX_GAME_LISTS_PER_PACKET*4);i++) { // char *gn = games->game_name[i]; @@ -2074,7 +2074,7 @@ int SearchMasterTrackerGameMenu () { if(games->game_server[i] && games->game_port[i]) { - DLLmprintf((0,"Bad bad bad!!!!\n")); + DLLmprintf(0,"Bad bad bad!!!!\n"); DLLSearchForGamesPXO(games->game_server[i],games->game_port[i]); } @@ -2136,7 +2136,7 @@ int SearchMasterTrackerGameMenu () break; gameno = gameid; - DLLmprintf((0,"Selected item is %s\n",DLLNetwork_games[gameno].name)); + DLLmprintf(0,"Selected item is %s\n",DLLNetwork_games[gameno].name); network_address s_address; s_address.connection_type = NP_TCP; @@ -2156,7 +2156,7 @@ int SearchMasterTrackerGameMenu () { if ((DLLTryToJoinServer (&s_address))) { - DLLmprintf ((0,"Menu: Game joined!\n")); + DLLmprintf(0,"Menu: Game joined!\n"); DLLNewUIWindowClose(main_wnd); exit_menu=1; ret=1; @@ -2240,7 +2240,7 @@ int SearchMasterTrackerGameMenu () gameno = gameid; if(gameid==-1) break; - DLLmprintf((0,"Selected item is %s\n",DLLNetwork_games[gameno].name)); + DLLmprintf(0,"Selected item is %s\n",DLLNetwork_games[gameno].name); DLLShowNetgameInfo(&DLLNetwork_games[gameno]); } } @@ -2248,42 +2248,42 @@ int SearchMasterTrackerGameMenu () case SORT_GAMENAME: { - DLLmprintf((0,"Sorting by game name.\n")); + DLLmprintf(0,"Sorting by game name.\n"); invert_sort_gamename = !invert_sort_gamename; ResortGameList(game_list,res,invert_sort_gamename); } break; case SORT_GAMETYPE: { - DLLmprintf((0,"Sorting by game type.\n")); + DLLmprintf(0,"Sorting by game type.\n"); invert_sort_gametype = !invert_sort_gametype; ResortGameList(game_list,res,invert_sort_gametype); } break; case SORT_MISSION: { - DLLmprintf((0,"Sorting by mission.\n")); + DLLmprintf(0,"Sorting by mission.\n"); invert_sort_mission = !invert_sort_mission; ResortGameList(game_list,res,invert_sort_mission); } break; case SORT_LEVEL: { - DLLmprintf((0,"Sorting by level.\n")); + DLLmprintf(0,"Sorting by level.\n"); invert_sort_levels = !invert_sort_levels; ResortGameList(game_list,res,invert_sort_levels); } break; case SORT_PLAYERS: { - DLLmprintf((0,"Sorting by players.\n")); + DLLmprintf(0,"Sorting by players.\n"); invert_sort_players = !invert_sort_players; ResortGameList(game_list,res,invert_sort_players); } break; case SORT_PING: { - DLLmprintf((0,"Sorting by ping.\n")); + DLLmprintf(0,"Sorting by ping.\n"); invert_sort_ping = !invert_sort_ping; ResortGameList(game_list,res,invert_sort_ping); } @@ -2430,14 +2430,14 @@ void DoMTFrame(void) { //Copy data from the DLLMTPilotinfo[MTReadingPilot] struct here DLLMNetPlayers[MTWritingPilot].flags &= ~NPF_MT_WRITING_PILOT; - DLLmprintf ((0,"Pilot data wrote to the Mastertracker for Player[%d] %s (tid=%s).\n",MTWritingPilot,DLLMTPilotinfo[MTWritingPilot].pilot_name,DLLMTPilotinfo[MTWritingPilot].tracker_id)); + DLLmprintf(0,"Pilot data wrote to the Mastertracker for Player[%d] %s (tid=%s).\n",MTWritingPilot,DLLMTPilotinfo[MTWritingPilot].pilot_name,DLLMTPilotinfo[MTWritingPilot].tracker_id); MTWritingPilot = -1; } else { DLLMNetPlayers[MTWritingPilot].flags &= ~NPF_MT_WRITING_PILOT; - DLLmprintf ((0,"Pilot write to the mastertracker failed. Error code %d.\n",rcode)); + DLLmprintf(0,"Pilot write to the mastertracker failed. Error code %d.\n",rcode); MTWritingPilot = -1; } } @@ -2458,7 +2458,7 @@ void DoMTFrame(void) DLLMTPilotinfo[i].deaths = DLLMPlayers[i].deaths; DLLMTPilotinfo[i].suicides = DLLMPlayers[i].suicides; DLLMTPilotinfo[i].rank = (DLLMPlayers[i].rank*65536.0); - DLLmprintf ((0,"Sending pilot %d rank of %f\n",i,DLLMTPilotinfo[i].rank/65536.0)); + DLLmprintf(0,"Sending pilot %d rank of %f\n",i,DLLMTPilotinfo[i].rank/65536.0); DLLMTPilotinfo[i].lateral_thrust = DLLMPlayers[i].lateral_thrust; DLLMTPilotinfo[i].rotational_thrust = DLLMPlayers[i].rotational_thrust; @@ -2466,7 +2466,7 @@ void DoMTFrame(void) DLLMTPilotinfo[i].sliding_pct = 0;//FIXME DLLMPlayers[i].time_in_game = DLLtimer_GetTime();//when we write this data multiple times we need this - DLLmprintf ((0,"Sending User info to the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id)); + DLLmprintf(0,"Sending User info to the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id); SendD3PilotData(&DLLMTPilotinfo[i]); MTWritingPilot = i; @@ -2478,7 +2478,7 @@ void DoMTFrame(void) //If we never read this pilot's stats, we really don't care what they were. DLLMNetPlayers[i].flags &= ~NPF_MT_READING_PILOT; DLLMNetPlayers[i].flags &= ~NPF_MT_WRITING_PILOT; - DLLmprintf ((0,"Didn't write Mastertracker stats for %s because we never received any from the tracker!\n",DLLMPlayers[i].callsign)); + DLLmprintf(0,"Didn't write Mastertracker stats for %s because we never received any from the tracker!\n",DLLMPlayers[i].callsign); } } } @@ -2500,20 +2500,20 @@ void DoMTFrame(void) DLLMPlayers[MTReadingPilot].deaths = DLLMTPilotinfo[MTReadingPilot].deaths; DLLMPlayers[MTReadingPilot].suicides = DLLMTPilotinfo[MTReadingPilot].suicides; DLLMPlayers[MTReadingPilot].rank = DLLMTPilotinfo[MTReadingPilot].rank/65536.0; - DLLmprintf ((0,"Read pilot %s rank of %f\n",DLLMPlayers[MTReadingPilot].callsign,DLLMPlayers[MTReadingPilot].rank)); + DLLmprintf(0,"Read pilot %s rank of %f\n",DLLMPlayers[MTReadingPilot].callsign,DLLMPlayers[MTReadingPilot].rank); DLLMPlayers[MTReadingPilot].lateral_thrust = DLLMTPilotinfo[MTReadingPilot].lateral_thrust; DLLMPlayers[MTReadingPilot].rotational_thrust = DLLMTPilotinfo[MTReadingPilot].rotational_thrust; //DLLMPlayers[MTReadingPilot].time_in_game = DLLMTPilotinfo[MTReadingPilot].online_time; // Something = DLLMTPilotinfo[i].sliding_pct;//FIXME DLLMNetPlayers[MTReadingPilot].flags |= NPF_MT_HAS_PILOT_DATA; - DLLmprintf ((0,"Pilot data received from the Mastertracker for Player[%d] %s (tid=%s).\n",MTReadingPilot,DLLMTPilotinfo[MTReadingPilot].pilot_name,DLLMTPilotinfo[MTReadingPilot].tracker_id)); + DLLmprintf(0,"Pilot data received from the Mastertracker for Player[%d] %s (tid=%s).\n",MTReadingPilot,DLLMTPilotinfo[MTReadingPilot].pilot_name,DLLMTPilotinfo[MTReadingPilot].tracker_id); MTReadingPilot = -1; } else { //DLLMNetPlayers[MTReadingPilot].flags &= ~NPF_MT_READING_PILOT; - DLLmprintf ((0,"Pilot read from mastertracker failed. Error code %d.\n",rcode)); + DLLmprintf(0,"Pilot read from mastertracker failed. Error code %d.\n",rcode); MTReadingPilot = -1; } } @@ -2526,7 +2526,7 @@ void DoMTFrame(void) if(DLLMNetPlayers[i].flags & NPF_MT_READING_PILOT) { MTReadingPilot = i; - DLLmprintf ((0,"Requesting User info from the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id)); + DLLmprintf(0,"Requesting User info from the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id); GetD3PilotData(&DLLMTPilotinfo[i],DLLMPlayers[i].callsign,DLLMPlayers[i].tracker_id); CheckPXOForAnomalies(); break; @@ -2566,8 +2566,8 @@ void DoMTGameOver(void) DLLMTPilotinfo[i].rotational_thrust = DLLMPlayers[i].rotational_thrust; DLLMTPilotinfo[i].online_time += DLLtimer_GetTime()-DLLMPlayers[i].time_in_game; DLLMTPilotinfo[i].sliding_pct = 0;//FIXME - DLLmprintf ((0,"Sending User info to the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id)); - DLLmprintf ((0,"Sending pilot %d rank of %f\n",i,DLLMTPilotinfo[i].rank/65536.0)); + DLLmprintf(0,"Sending User info to the Mastertracker for Player[%d] %s (tid=%s).\n",i,DLLMTPilotinfo[i].pilot_name,DLLMTPilotinfo[i].tracker_id); + DLLmprintf(0,"Sending pilot %d rank of %f\n",i,DLLMTPilotinfo[i].rank/65536.0); SendD3PilotData(&DLLMTPilotinfo[i]); while(SendD3PilotData(NULL)==0) { @@ -2604,7 +2604,7 @@ int MTVersionCheck(void) DLLddio_MakePath(fulldllpath,DLLLocalD3Dir,"mtav.dll",NULL); if(!DLLmod_LoadModule(&MTAVDLLHandle,fulldllpath)) { - DLLmprintf ((0,"Unable to load Mastertracker Auto version update DLL (mtav.dll)\n")); + DLLmprintf(0,"Unable to load Mastertracker Auto version update DLL (mtav.dll)\n"); //Try restoring a backup of the DLL DLLddio_MakePath(szolddll,DLLLocalD3Dir,"mtav.dll",NULL); DLLddio_MakePath(szbakdll,DLLLocalD3Dir,"mtav.bak",NULL); @@ -2614,7 +2614,7 @@ int MTVersionCheck(void) DLLAVInit = (DLLAVInit_fp *)DLLmod_GetSymbol(&MTAVDLLHandle,"DLLAVInit",4); if(!DLLAVInit) { - DLLmprintf ((0,"Unable to Find DLLAVInit() function in mtav.dll\n")); + DLLmprintf(0,"Unable to Find DLLAVInit() function in mtav.dll\n"); DLLmod_FreeModule(&MTAVDLLHandle); //Try restoring a backup of the DLL DLLddio_MakePath(szolddll,DLLLocalD3Dir,"mtav.dll",NULL); @@ -2625,7 +2625,7 @@ int MTVersionCheck(void) DLLAVGetVersion = (DLLAVGetVersion_fp *)DLLmod_GetSymbol(&MTAVDLLHandle,"DLLAVGetVersion",4); if(!DLLAVGetVersion) { - DLLmprintf ((0,"Unable to Find DLLAVGetVersion() function in mtav.dll\n")); + DLLmprintf(0,"Unable to Find DLLAVGetVersion() function in mtav.dll\n"); DLLmod_FreeModule(&MTAVDLLHandle); //Try restoring a backup of the DLL DLLddio_MakePath(szolddll,DLLLocalD3Dir,"mtav.dll",NULL); @@ -2636,7 +2636,7 @@ int MTVersionCheck(void) DLLRunCheck = (DLLRunCheck_fp *)DLLmod_GetSymbol(&MTAVDLLHandle,"DLLRunCheck",4); if(!DLLRunCheck) { - DLLmprintf ((0,"Unable to Find DLLRunCheck() function in mtav.dll\n")); + DLLmprintf(0,"Unable to Find DLLRunCheck() function in mtav.dll\n"); DLLmod_FreeModule(&MTAVDLLHandle); //Try restoring a backup of the DLL DLLddio_MakePath(szolddll,DLLLocalD3Dir,"mtav.dll",NULL); @@ -2648,11 +2648,11 @@ int MTVersionCheck(void) DLLAVGetVersion((int *)&mtver); if(MTAVersionCheck(mtver,MTUpdateURL)) { - DLLmprintf ((0,"VersionCheck() returned an unexpected return code!\n")); + DLLmprintf(0,"VersionCheck() returned an unexpected return code!\n"); DLLmod_FreeModule(&MTAVDLLHandle); return 0; } - DLLmprintf ((0,"Getting Version # from Mastertracker.\n")); + DLLmprintf(0,"Getting Version # from Mastertracker.\n"); do { // @@ -2669,7 +2669,7 @@ int MTVersionCheck(void) if(MTUpdateURL[0]) { //We need to get a new DLL - DLLmprintf ((0,"Mastertracker says we need a new version, which is at %s.\n",MTUpdateURL)); + DLLmprintf(0,"Mastertracker says we need a new version, which is at %s.\n",MTUpdateURL); sprintf(sznewdll,"%s\\newmtav.dll",DLLLocalD3Dir); DLLddio_MakePath(sznewdll,DLLLocalD3Dir,"newmtav.dll",NULL); inetfile = new InetGetFile(MTUpdateURL,sznewdll); @@ -2679,13 +2679,13 @@ int MTVersionCheck(void) if(inetfile->IsFileError()) { //Error here - DLLmprintf ((0,"Mastertracker update DLL not received. Error code: %d.\n",inetfile->GetErrorCode())); + DLLmprintf(0,"Mastertracker update DLL not received. Error code: %d.\n",inetfile->GetErrorCode()); DLLmod_FreeModule(&MTAVDLLHandle); return 0; } if(inetfile->IsFileReceived()) { - DLLmprintf ((0,"Mastertracker update DLL received.\n")); + DLLmprintf(0,"Mastertracker update DLL received.\n"); DLLmod_FreeModule(&MTAVDLLHandle); DLLddio_MakePath(szolddll,DLLLocalD3Dir,"mtav.dll",NULL); DLLddio_MakePath(szbakdll,DLLLocalD3Dir,"mtav.bak",NULL); @@ -2700,7 +2700,7 @@ int MTVersionCheck(void) } else { - DLLmprintf ((0,"Mastertracker says we are up to date\n")); + DLLmprintf(0,"Mastertracker says we are up to date\n"); //Here is where we call into the DLL so it can do it's magic DLLAVInit(0); DLLmod_FreeModule(&MTAVDLLHandle); @@ -2709,7 +2709,7 @@ int MTVersionCheck(void) } else { - DLLmprintf ((0,"Mastertracker timeout while getting version\n")); + DLLmprintf(0,"Mastertracker timeout while getting version\n"); DLLmod_FreeModule(&MTAVDLLHandle); return 0; } @@ -2721,7 +2721,7 @@ int JoinNewLobby(char *lobby) { int rcode; char *p; - DLLmprintf((0,"Entering new lobby")); + DLLmprintf(0,"Entering new lobby"); void * title_text = DLLCreateNewUITextItem(TXT_PXO_ENTERINGLOBBY,UICOL_WINDOW_TITLE); void * cancel_on_text = DLLCreateNewUITextItem(TXT_PXO_CANCEL,UICOL_HOTSPOT_HI); @@ -2752,7 +2752,7 @@ int JoinNewLobby(char *lobby) } else { - DLLmprintf((0,"Unable to join lobby: %d\n",rcode)); + DLLmprintf(0,"Unable to join lobby: %d\n",rcode); char txtmessage[200]; char cleanlobby[50]; memset(cleanlobby,0,29); @@ -3178,7 +3178,7 @@ int GetPilotStats(char *pilot) } if(p==(char *)-1) { - DLLmprintf((0,"Timeout looking for user\n")); + DLLmprintf(0,"Timeout looking for user\n"); DLLDoMessageBox(TXT_PXO_MASTERTRACKER,TXT_PXO_TIMEOUTMT,MSGBOX_OK,UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL); DLLCloseSplashScreen(); return 0; @@ -3190,7 +3190,7 @@ int GetPilotStats(char *pilot) tokp++; strcpy(tid,p); strcpy(real_pilot,tokp); - DLLmprintf((0,"Requesting pilot info for %s %s\n",tid,real_pilot)); + DLLmprintf(0,"Requesting pilot info for %s %s\n",tid,real_pilot); memset(&d3_pilot_info,0,sizeof(vmt_descent3_struct)); GetD3PilotData(&d3_pilot_info,real_pilot,tid); int iresult = 0; @@ -3214,7 +3214,7 @@ int GetPilotStats(char *pilot) } if(iresult==1) { - DLLmprintf((0,"Got pilot info for %s %s\n",tid,real_pilot)); + DLLmprintf(0,"Got pilot info for %s %s\n",tid,real_pilot); //Do rank thingy here. @@ -3322,7 +3322,7 @@ void AutoLoginAndJoinGame(void) DLLDatabaseRead("TrackerPassword",szpassword,&passlen); if(!*DLLAuto_login_addr) { - DLLmprintf((0,"Can't autostart because no IP address was specified!!\n")); + DLLmprintf(0,"Can't autostart because no IP address was specified!!\n"); *DLLMultiGameStarting = 0; goto failed_login; } @@ -3361,7 +3361,7 @@ void AutoLoginAndJoinGame(void) if(valret == 1) { //User was validated - DLLmprintf ((0,"Mastertracker user validated!\n")); + DLLmprintf(0,"Mastertracker user validated!\n"); strcpy(DLLTracker_id,sztrackerid); strcpy(DLLMPlayers[DLLPlayer_num].tracker_id,sztrackerid); @@ -3369,14 +3369,14 @@ void AutoLoginAndJoinGame(void) else if(valret == -1) { //User invalid! - DLLmprintf ((0,"Mastertracker user not validated!\n")); + DLLmprintf(0,"Mastertracker user not validated!\n"); DLLDoMessageBox(TXT_PXO_MASTERTRACKER,TXT_PXO_BADLOGIN,MSGBOX_OK,UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL); goto failed_login; } else { //timeout waiting for tracker! - DLLmprintf ((0,"Mastertracker timeout!\n")); + DLLmprintf(0,"Mastertracker timeout!\n"); DLLDoMessageBox(TXT_PXO_MASTERTRACKER,TXT_PXO_TIMEOUTMT,MSGBOX_OK,UICOL_WINDOW_TITLE,UICOL_TEXT_NORMAL); goto failed_login; } @@ -3394,7 +3394,7 @@ void AutoLoginAndJoinGame(void) if ((DLLTryToJoinServer (&s_address))) { - DLLmprintf ((0,"Menu: Game joined!\n")); + DLLmprintf(0,"Menu: Game joined!\n"); *DLLMultiGameStarting = 1; } @@ -3443,7 +3443,7 @@ void AutoLoginAndStartGame(void) if(valret == 1) { //User was validated - DLLmprintf ((0,"Mastertracker user validated!\n")); + DLLmprintf(0,"Mastertracker user validated!\n"); DLLPrintDedicatedMessage ("Mastertracker user validated.\n"); strcpy(DLLTracker_id,sztrackerid); strcpy(DLLMPlayers[DLLPlayer_num].tracker_id,sztrackerid); @@ -3452,14 +3452,14 @@ void AutoLoginAndStartGame(void) else if(valret == -1) { //User invalid! - DLLmprintf ((0,"Mastertracker user not validated!\n")); + DLLmprintf(0,"Mastertracker user not validated!\n"); DLLPrintDedicatedMessage ("Mastertracker user not validated!\n"); goto failed_login; } else { //timeout waiting for tracker! - DLLmprintf ((0,"Mastertracker timeout!\n")); + DLLmprintf(0,"Mastertracker timeout!\n"); DLLPrintDedicatedMessage ("Mastertracker timeout!\n"); goto failed_login; } @@ -3501,7 +3501,7 @@ int ShowMessageOfTheDay(void) if(Motd_version==last_motd_version) { //MOTD is old.... - DLLmprintf((0,"MOTD is old, skipping\n")); + DLLmprintf(0,"MOTD is old, skipping\n"); return 1; } @@ -3520,7 +3520,7 @@ int ShowMessageOfTheDay(void) DLLDatabaseRead("LastMOTD",szlastmotd,&motdlen); - DLLmprintf((0,"Getting message of the day...\n")); + DLLmprintf(0,"Getting message of the day...\n"); DLLCreateSplashScreen(TXT_PXO_CONNECTING,1); int mcode = GetD3MOTD(sznewmotd,MAX_MOTD_LEN); do @@ -3540,7 +3540,7 @@ int ShowMessageOfTheDay(void) if(mcode==1) { - DLLmprintf((0,"Message of the day: %s\n",sznewmotd)); + DLLmprintf(0,"Message of the day: %s\n",sznewmotd); if(strcmp(szlastmotd,sznewmotd)!=0) { DLLNewUIGameWindowOpen(main_wnd); @@ -3557,19 +3557,19 @@ int ShowMessageOfTheDay(void) } else { - DLLmprintf((0,"Message of the day is old, ignoring!\n")); + DLLmprintf(0,"Message of the day is old, ignoring!\n"); rval = 1; goto close_motd; } } else { - DLLmprintf((0,"Get message of the day failed (%d)!\n",mcode)); + DLLmprintf(0,"Get message of the day failed (%d)!\n",mcode); goto close_motd; } close_motd: - DLLmprintf((0,"Ending motd\n")); + DLLmprintf(0,"Ending motd\n"); DLLNewUIGameWindowDestroy(main_wnd); DLLRemoveUITextItem(motd_text); DLLRemoveUITextItem(close_on_text); diff --git a/legacy/mtclient/mtgametrack.cpp b/legacy/mtclient/mtgametrack.cpp index 1a0b19c8..31b126cc 100644 --- a/legacy/mtclient/mtgametrack.cpp +++ b/legacy/mtclient/mtgametrack.cpp @@ -148,9 +148,9 @@ typedef int (*nw_DoReceiveCallbacks_fp)(void); extern nw_DoReceiveCallbacks_fp DLLnw_DoReceiveCallbacks; #if ( defined(MONO) && (!defined(RELEASE)) ) -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #else -#define DLLmprintf(args) +#define DLLmprintf(...) #endif typedef void( *Debug_ConsolePrintf_fp ) (int n, const char *format, ... ); @@ -235,7 +235,7 @@ void IdleGameTracker() { DLLnw_DoReceiveCallbacks(); //uint32_t bytesin; - //mprintf ((0,"IdleGameTracker() entered.\n")); + //mprintf(0,"IdleGameTracker() entered.\n"); if((TrackerGameIsRunning)&&((DLLtimer_GetTime()-LastTrackerUpdate)>TRACKER_UPDATE_INTERVAL)) { @@ -244,7 +244,7 @@ void IdleGameTracker() time( &aclock ); /* Get time in seconds */ newtime = localtime( &aclock ); //Time to update the tracker again - DLLmprintf((0,"[%.24s] Updating the PXO game tracker!\n",asctime(newtime))); + DLLmprintf(0,"[%.24s] Updating the PXO game tracker!\n",asctime(newtime)); SendGameTrackerPacker(&TrackerGameData); // sendto(gamesock,(const char *)&TrackerGameData,TrackerGameData.len,0,(SOCKADDR *)>rackaddr,sizeof(SOCKADDR_IN)); TrackerAckdUs = 0; @@ -260,7 +260,7 @@ void IdleGameTracker() time( &aclock ); /* Get time in seconds */ newtime = localtime( &aclock ); //Time to update the tracker again - DLLmprintf((0,"[%.24s] (Resending) Updating the PXO game tracker!\n",asctime(newtime))); + DLLmprintf(0,"[%.24s] (Resending) Updating the PXO game tracker!\n",asctime(newtime)); SendGameTrackerPacker(&TrackerGameData); TrackerAckdUs = 0; @@ -307,11 +307,11 @@ void HandleGamePacket(uint8_t *data,int len, network_address *from) case GNT_GAMELIST_LITE_DATA: if(len < (GAME_HEADER_ONLY_SIZE + sizeof(game_list))) { - DLLmprintf((0,"(%d) packet is too small!\n",len)); + DLLmprintf(0,"(%d) packet is too small!\n",len); } //Woohoo! Game data! put it in the buffer (if one's free) - //DLLmprintf ((0,"GNT_GAMELIST_LITE_DATA received.\n")); + //DLLmprintf(0,"GNT_GAMELIST_LITE_DATA received.\n"); for(int i=0;idwZCmpCaps & D3DPCMPCAPS_LESSEQUAL) { d3d_CanZCompare = true; - mprintf((0, "Device HAS Z compare caps!\n")); + mprintf(0, "Device HAS Z compare caps!\n"); } else - mprintf((0, "Device DOES NOT have Z compare caps!\n")); + mprintf(0, "Device DOES NOT have Z compare caps!\n"); // Check if it supports Wbuffering if (pdpc->dwRasterCaps & D3DPRASTERCAPS_WBUFFER) { - mprintf((0, "Device has Wbuffer!\n")); + mprintf(0, "Device has Wbuffer!\n"); d3d_WBuffer = true; UseWBuffer = true; } else { - mprintf((0, "Device DOES NOT have Wbuffer!\n")); + mprintf(0, "Device DOES NOT have Wbuffer!\n"); d3d_WBuffer = false; UseWBuffer = false; } // Check for zbias if (pdpc->dwRasterCaps & D3DPRASTERCAPS_ZBIAS) { - mprintf((0, "Device has ZBias!\n")); + mprintf(0, "Device has ZBias!\n"); d3d_ZBias = true; } else { - mprintf((0, "Device DOES NOT have ZBias!\n")); + mprintf(0, "Device DOES NOT have ZBias!\n"); d3d_ZBias = false; } // Check for fog table if (pdpc->dwRasterCaps & D3DPRASTERCAPS_FOGVERTEX) { - mprintf((0, "Device has Fogtable!\n")); + mprintf(0, "Device has Fogtable!\n"); d3d_CanFog = true; } else { - mprintf((0, "Device DOES NOT have Fogtable!\n")); + mprintf(0, "Device DOES NOT have Fogtable!\n"); d3d_CanFog = false; } @@ -277,18 +277,18 @@ void d3d_GetCaps() { // Check for mip mapping if (pdpc->dwTextureFilterCaps & (D3DPTFILTERCAPS_MIPLINEAR)) { d3d_CanMip = true; - mprintf((0, "Device has mip map capabilities!\n")); + mprintf(0, "Device has mip map capabilities!\n"); } else { d3d_CanMip = false; - mprintf((0, "Device DOES NOT have mip map capabilities!\n")); + mprintf(0, "Device DOES NOT have mip map capabilities!\n"); } // Get the interface to the gamma control int ddrval = lpFrontBuffer->QueryInterface(IID_IDirectDrawGammaControl, (LPVOID *)&lpGammaControl); if (ddrval != DD_OK) - mprintf((0, "D3D_INIT: QueryInterface for gamma failed.\n")); + mprintf(0, "D3D_INIT: QueryInterface for gamma failed.\n"); else { - mprintf((0, "Gamma interface detection successful!\n")); + mprintf(0, "Gamma interface detection successful!\n"); d3d_CanGamma = true; } @@ -300,9 +300,9 @@ void d3d_GetCaps() { lpDD->GetCaps(&hcaps, &helcaps); if (hcaps.dwCaps2 & DDCAPS2_PRIMARYGAMMA) { - mprintf((0, "Device DOES NOT have gamma support.\n")); + mprintf(0, "Device DOES NOT have gamma support.\n"); } else { - mprintf((0, "Secondary gamma detection successful!\n")); + mprintf(0, "Secondary gamma detection successful!\n"); } // Now detect for riva128 (only if wbuffer is not detected for that card) @@ -312,9 +312,9 @@ void d3d_GetCaps() { if (did.dwDeviceId == 0x18 || did.dwDeviceId == 0x19) { d3d_IsRiva128 = true; // NoLightmaps=true; - mprintf((0, "Device IS Riva128!\n")); + mprintf(0, "Device IS Riva128!\n"); } else { - mprintf((0, "Device IS NOT Riva128!\n")); + mprintf(0, "Device IS NOT Riva128!\n"); } } @@ -330,7 +330,7 @@ void d3d_SetGammaString(float val) { sprintf(envvalue, "%f", val); SetEnvironmentVariable(envstring, envvalue); - mprintf((0, "Setting D3D gamma to %f\n", val)); + mprintf(0, "Setting D3D gamma to %f\n", val); } // Places a device into our global list of 3d devices to choose from @@ -342,7 +342,7 @@ HRESULT WINAPI d3d_Enumerate3DDevice(LPGUID lpGUID, LPSTR lpDeviceDescription, L use_it = 1; if (use_it) { - mprintf((0, "Found 3d device %s: %s\n", lpDeviceName, lpDeviceDescription)); + mprintf(0, "Found 3d device %s: %s\n", lpDeviceName, lpDeviceDescription); d3d_device *d2d = (d3d_device *)lpContext; d3d_device *d3d = (d3d_device *)&D3D_devices[Num_d3d_devices++]; @@ -371,7 +371,7 @@ HRESULT WINAPI d3d_Enumerate3DDevice(LPGUID lpGUID, LPSTR lpDeviceDescription, L BOOL WINAPI d3d_Enumerate2DDevice(LPGUID lpGUID, LPSTR lpDeviceDescription, LPSTR lpDeviceName, LPVOID lpContext) { d3d_device *d2d = (d3d_device *)&D2D_devices[Num_d2d_devices++]; - mprintf((0, "Found 2d device %s: %s\n", lpDeviceName, lpDeviceDescription)); + mprintf(0, "Found 2d device %s: %s\n", lpDeviceName, lpDeviceDescription); if (lpGUID) { memmove(&d2d->guid_2d, lpGUID, sizeof(GUID)); @@ -418,13 +418,13 @@ d3d_device *d3d_PollDevices() { ddrval = DirectDrawEnumerate(d3d_Enumerate2DDevice, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: DirectDrawEnumerate failed.\n")); + mprintf(0, "D3D_INIT: DirectDrawEnumerate failed.\n"); goto D3DError; } // Go through all 2d devices then create their 3d devices to create the total // number of 3d devices to to choose from - mprintf((0, "Found %d 2d devices...checking for 3d devices.\n", Num_d2d_devices)); + mprintf(0, "Found %d 2d devices...checking for 3d devices.\n", Num_d2d_devices); for (i = 0; i < Num_d2d_devices; i++) { @@ -433,21 +433,21 @@ d3d_device *d3d_PollDevices() { // Create direct draw surface ddrval = DirectDrawCreate(d2d->pguid_2d, &lpDD1, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: DirectDrawCreate failed.\n")); + mprintf(0, "D3D_INIT: DirectDrawCreate failed.\n"); goto D3DError; } ddrval = lpDD1->QueryInterface(IID_IDirect3D3, (LPVOID *)&lpD3D); if (ddrval != DD_OK) { lpD3D = NULL; - mprintf((0, "D3D_INIT: QueryInterface failed.\n")); + mprintf(0, "D3D_INIT: QueryInterface failed.\n"); goto D3DError; } // Enumerate this 3d device ddrval = lpD3D->EnumDevices(d3d_Enumerate3DDevice, d2d); if (ddrval != DD_OK) { - mprintf((0, "WIN_DD32: D3D enum devices failed. (0x%x)\n", ddrval)); + mprintf(0, "WIN_DD32: D3D enum devices failed. (0x%x)\n", ddrval); } lpD3D->Release(); @@ -458,11 +458,11 @@ d3d_device *d3d_PollDevices() { } for (i = 0; i < Num_d3d_devices; i++) { - mprintf((0, "D3D Device %d: %s\n", i, D3D_devices[i].name)); + mprintf(0, "D3D Device %d: %s\n", i, D3D_devices[i].name); } if (Num_d3d_devices <= 0) { - mprintf((0, "No D3D device found!\n")); + mprintf(0, "No D3D device found!\n"); return NULL; } @@ -472,7 +472,7 @@ d3d_device *d3d_PollDevices() { if (Num_d3d_devices > 1) { char tempbuffer[255]; int templen = 255; - mprintf((0, "More than one D3D device found!\n")); + mprintf(0, "More than one D3D device found!\n"); Database->read("RenderingDeviceName", tempbuffer, &templen); @@ -493,7 +493,7 @@ d3d_device *d3d_PollDevices() { if (FindArg("-useseconddevice") && Num_d3d_devices > 1) use_device = Num_d3d_devices - 1; - mprintf((0, "Using %s\n", D3D_devices[use_device].name)); + mprintf(0, "Using %s\n", D3D_devices[use_device].name); // Use the last device. return &D3D_devices[use_device]; @@ -502,7 +502,7 @@ d3d_device *d3d_PollDevices() { return NULL; D3DError: - mprintf((0, "Direct3D Polling failed.\n")); + mprintf(0, "Direct3D Polling failed.\n"); return NULL; } @@ -536,7 +536,7 @@ int d3d_GetTexClass(int handle, int map_type) { else if (w == 32) tex_class = 3; else { - mprintf((0, "Bad class for d3d!\n")); + mprintf(0, "Bad class for d3d!\n"); Int3(); } @@ -553,8 +553,8 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa int w, h; uint16_t *src_data; - // mprintf ((0,"Uploading bitmap %d type %d\n",handle,map_type)); - // mprintf ((0,"Slot=%d handle=%d\n",slot,handle)); + // mprintf(0,"Uploading bitmap %d type %d\n",handle,map_type); + // mprintf(0,"Slot=%d handle=%d\n",slot,handle); ASSERT(slot != -1); ASSERT(slot == handle); @@ -602,7 +602,7 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa if (map_type == MAP_TYPE_BUMPMAP) { ddrval = dest_sp->Lock(NULL, &surf_desc, DDLOCK_WAIT, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D:Normal upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:Normal upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); return; } @@ -631,7 +631,7 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa // ddrval=dest_sp->Lock(NULL,&surf_desc,DDLOCK_WAIT|DDLOCK_WRITEONLY,NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D:Upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:Upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); return; } @@ -681,7 +681,7 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa for (int i = 0; i < NUM_MIP_LEVELS; i++) { ddrval = upload_sp->Lock(NULL, &surf_desc, DDLOCK_WAIT, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D:mip=%d Upload lock error %d! %s\n", i, ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:mip=%d Upload lock error %d! %s\n", i, ddrval, d3d_ErrorString(ddrval)); return; } @@ -710,7 +710,7 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa ddrval = dest_mipsurf->GetAttachedSurface(&ddsCaps, &dest_mipsurf); if (ddrval != DD_OK) { - mprintf((0, "Couldn't get attached dest mip surface %d!\n", i)); + mprintf(0, "Couldn't get attached dest mip surface %d!\n", i); return; } dest_mipsurf->Release(); @@ -721,7 +721,7 @@ void d3d_UploadBitmapToSurface(int handle, int map_type, int slot, int new_uploa // Do a non-mipped bitmap ddrval = upload_sp->Lock(NULL, &surf_desc, DDLOCK_WAIT, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D:Normal upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:Normal upload lock error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); return; } @@ -751,7 +751,7 @@ int d3d_CreateTextureFromBitmap(int bm_handle, int map_type) { int retval = -1; HRESULT ddrval; - // mprintf ((0,"Creating texture from handle %d type %d\n",bm_handle,map_type)); + // mprintf(0,"Creating texture from handle %d type %d\n",bm_handle,map_type); if (map_type == MAP_TYPE_BUMPMAP) { ASSERT(GameBumpmaps[bm_handle].cache_slot == -1); @@ -846,7 +846,7 @@ int d3d_CreateTextureFromBitmap(int bm_handle, int map_type) { } if (ddrval != DD_OK) { - mprintf((0, "Creating texture surface failed!\n")); + mprintf(0, "Creating texture surface failed!\n"); return -1; } @@ -898,7 +898,7 @@ void d3d_FreeTextureCache() { for (i = 0; i < MAX_BITMAPS; i++) { if (GameBitmaps[i].cache_slot != -1) { if (GameBitmaps[i].cache_slot != i) { - mprintf((0, "Error cache slot is %d when it should be %d!\n", GameBitmaps[i].cache_slot, i)); + mprintf(0, "Error cache slot is %d when it should be %d!\n", GameBitmaps[i].cache_slot, i); } ASSERT(GameBitmaps[i].cache_slot == i); @@ -957,7 +957,7 @@ int d3d_CreateUploadSurfaces() { ddrval = lpDD->CreateSurface(&ddsd, &UploadSurfaces[i], NULL); if (ddrval != DD_OK) { - mprintf((0, "Creating 1555 texture surface failed!\n")); + mprintf(0, "Creating 1555 texture surface failed!\n"); return 0; } } @@ -982,7 +982,7 @@ int d3d_CreateUploadSurfaces() { ddrval = lpDD->CreateSurface(&ddsd, &Upload4444Surfaces[i], NULL); if (ddrval != DD_OK) { - mprintf((0, "Creating 4444 texture surface failed!\n")); + mprintf(0, "Creating 4444 texture surface failed!\n"); return 0; } } @@ -1023,7 +1023,7 @@ int d3d_TextureCacheInit() { // Allocate room to hold all our surfaces UploadSurfaces = (LPDIRECTDRAWSURFACE4 *)mem_malloc(NUM_TEXTURE_CLASSES * sizeof(LPDIRECTDRAWSURFACE4)); if (UploadSurfaces == NULL) { - mprintf((0, "Couldn't allocate memory for UploadSurfaces!\n")); + mprintf(0, "Couldn't allocate memory for UploadSurfaces!\n"); rend_SetErrorMessage("Couldn't alloc mem for UploadSurfaces!"); return 0; @@ -1032,7 +1032,7 @@ int d3d_TextureCacheInit() { // Allocate room to hold all our 4444 surfaces Upload4444Surfaces = (LPDIRECTDRAWSURFACE4 *)mem_malloc(NUM_TEXTURE_CLASSES * sizeof(LPDIRECTDRAWSURFACE4)); if (Upload4444Surfaces == NULL) { - mprintf((0, "Couldn't allocate memory for Upload4444Surfaces!\n")); + mprintf(0, "Couldn't allocate memory for Upload4444Surfaces!\n"); rend_SetErrorMessage("Couldn't alloc mem for Upload4444Surfaces!"); return 0; @@ -1040,7 +1040,7 @@ int d3d_TextureCacheInit() { BitmapTextureSurfaces = (LPDIRECTDRAWSURFACE4 *)mem_malloc(MAX_BITMAPS * sizeof(LPDIRECTDRAWSURFACE4)); if (BitmapTextureSurfaces == NULL) { - mprintf((0, "Couldn't allocate memory for BitmapTextureSurfaces!\n")); + mprintf(0, "Couldn't allocate memory for BitmapTextureSurfaces!\n"); rend_SetErrorMessage("Couldn't alloc mem for BitmapTextureSurfaces!"); return 0; @@ -1049,7 +1049,7 @@ int d3d_TextureCacheInit() { // Allocate room to hold all our surfaces LightmapTextureSurfaces = (LPDIRECTDRAWSURFACE4 *)mem_malloc(MAX_LIGHTMAPS * sizeof(LPDIRECTDRAWSURFACE4)); if (LightmapTextureSurfaces == NULL) { - mprintf((0, "Couldn't allocate memory for LightmapTextureSurfaces!\n")); + mprintf(0, "Couldn't allocate memory for LightmapTextureSurfaces!\n"); rend_SetErrorMessage("Couldn't alloc mem for LightmapTextureSurfaces!"); return 0; } @@ -1057,13 +1057,13 @@ int d3d_TextureCacheInit() { if (d3d_CanBumpmap) { BumpmapTextureSurfaces = (LPDIRECTDRAWSURFACE4 *)mem_malloc(MAX_BUMPMAPS * sizeof(LPDIRECTDRAWSURFACE4)); if (BumpmapTextureSurfaces == NULL) { - mprintf((0, "Couldn't allocate memory for BumpmapTextureSurfaces!\n")); + mprintf(0, "Couldn't allocate memory for BumpmapTextureSurfaces!\n"); rend_SetErrorMessage("Couldn't alloc mem for BumpmapTextureSurfaces!"); return 0; } if (!d3d_LoadEnvironmentMap()) { - mprintf((0, "couldn't load env map\n")); + mprintf(0, "couldn't load env map\n"); return 0; } } @@ -1071,7 +1071,7 @@ int d3d_TextureCacheInit() { // Enumerate those texture formats lpD3DDevice->EnumTextureFormats(d3d_EnumTexturePixelFormats, 0); if (Num_texture_formats < 1) { - mprintf((0, "No texture formats available!\n")); + mprintf(0, "No texture formats available!\n"); rend_SetErrorMessage("No valid texture formats available!"); return 0; } @@ -1090,12 +1090,12 @@ int d3d_TextureCacheInit() { if (rcount == 5 && gcount == 5 && bcount == 5 && acount == 1) { found_format = i; - mprintf((1, "Alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask)); + mprintf(1, "Alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask); } } if (found_format == -1) { - mprintf((0, "Couldn't find a valid 1555 pixel format!\n")); + mprintf(0, "Couldn't find a valid 1555 pixel format!\n"); rend_SetErrorMessage("Couldn't find a valid 1555 pixel format! Card doesn't support 1555 format!"); return 0; } @@ -1116,12 +1116,12 @@ int d3d_TextureCacheInit() { if (rcount == 4 && gcount == 4 && bcount == 4 && acount == 4) { found_format = i; - mprintf((1, "Alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask)); + mprintf(1, "Alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask); } } if (found_format == -1) { - mprintf((0, "Couldn't find a valid 4444 pixel format!\n")); + mprintf(0, "Couldn't find a valid 4444 pixel format!\n"); rend_SetErrorMessage("Couldn't find a valid 4444 pixel format! Card doesn't support 1555 format!"); return 0; } @@ -1138,13 +1138,13 @@ int d3d_TextureCacheInit() { if (pf->dwBumpBitCount == 16 && pf->dwBumpDuBitMask == 0x000000ff && pf->dwBumpDvBitMask == 0x0000ff00 && pf->dwBumpLuminanceBitMask == 0) { found_format = i; - mprintf((0, "Found a suitable bumpmapping format\n")); + mprintf(0, "Found a suitable bumpmapping format\n"); } } } if (found_format == -1) { - mprintf((0, "Couldn't find a valid bumpmap pixel format!\n")); + mprintf(0, "Couldn't find a valid bumpmap pixel format!\n"); d3d_CanBumpmap = false; } else Bumpmap_texture_format = TextureFormats[found_format]; @@ -1166,16 +1166,16 @@ int d3d_TextureCacheInit() { if (pf->dwFourCC == FOURCC_DXT1) { found_format = i; - mprintf((0, "Compress format: r=%d g=%d b=%d a=%d\n", rcount, gcount, bcount, acount)); - mprintf((1, "Texture compression alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask)); + mprintf(0, "Compress format: r=%d g=%d b=%d a=%d\n", rcount, gcount, bcount, acount); + mprintf(1, "Texture compression alpha bit mask is %d!\n", pf->dwRGBAlphaBitMask); } } if (found_format == -1 || FindArg("-nocompress")) { - mprintf((0, "Device doesn't support texture compression!\n")); + mprintf(0, "Device doesn't support texture compression!\n"); d3d_CanCompress = false; } else { - mprintf((0, "Device DOES support texture compression!\n")); + mprintf(0, "Device DOES support texture compression!\n"); d3d_CanCompress = true; Compressed_texture_format = TextureFormats[found_format]; } @@ -1280,7 +1280,7 @@ void d3d_SetDefaultStates() { if (d3d_WBuffer) d3d_SetWBufferDepth(5000); - mprintf((0, "Direct3D initted to %d x %d\n", D3D_state.screen_width, D3D_state.screen_height)); + mprintf(0, "Direct3D initted to %d x %d\n", D3D_state.screen_width, D3D_state.screen_height); Last_texture_bound[0] = -1; Last_texture_bound[1] = -1; @@ -1354,7 +1354,7 @@ TryAgain: dd = d3d_PollDevices(); if (!dd) { - mprintf((1, "ERROR: No Direct3D devices found!!!")); + mprintf(1, "ERROR: No Direct3D devices found!!!"); rend_SetErrorMessage("No Direct3D devices found!!!"); return 0; } @@ -1365,7 +1365,7 @@ TryAgain: ddrval = DirectDrawCreate(dd->pguid_2d, &lpDD1, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: DirectDrawCreate failed.\n")); + mprintf(0, "D3D_INIT: DirectDrawCreate failed.\n"); rend_SetErrorMessage("DirectDrawCreate failed."); goto D3DError; @@ -1375,14 +1375,14 @@ TryAgain: if (ddrval != DD_OK) { lpDD = NULL; rend_SetErrorMessage("DirectDrawCreate2 failed."); - mprintf((0, "D3D_INIT: DirectDrawCreate2 failed.\n")); + mprintf(0, "D3D_INIT: DirectDrawCreate2 failed.\n"); goto D3DError; } ddrval = lpDD->SetCooperativeLevel(hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN | DDSCL_ALLOWREBOOT); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: SetCooperativeLevel EXCLUSIVE failed.\n D3D_Error=%s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D_INIT: SetCooperativeLevel EXCLUSIVE failed.\n D3D_Error=%s\n", d3d_ErrorString(ddrval)); rend_SetErrorMessage("SetCoopLevel EXCULUSIVE failed."); goto D3DError; } @@ -1391,13 +1391,13 @@ TryAgain: if (D3D_preferred_state.bit_depth != 16 && D3D_preferred_state.bit_depth != 32) D3D_preferred_state.bit_depth = 16; - mprintf((0, "Opening screen with bit-depth of %d.\n", D3D_preferred_state.bit_depth)); + mprintf(0, "Opening screen with bit-depth of %d.\n", D3D_preferred_state.bit_depth); ddrval = lpDD->SetDisplayMode(D3D_preferred_state.width, D3D_preferred_state.height, D3D_preferred_state.bit_depth, 0, 0); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: SetDisplayMode failed, trying default!\n")); + mprintf(0, "D3D_INIT: SetDisplayMode failed, trying default!\n"); retval = -1; D3D_preferred_state.width = 640; @@ -1407,7 +1407,7 @@ TryAgain: ddrval = lpDD->SetDisplayMode(D3D_preferred_state.width, D3D_preferred_state.height, 16, 0, 0); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: SetDisplayMode failed.\n")); + mprintf(0, "D3D_INIT: SetDisplayMode failed.\n"); rend_SetErrorMessage("SetDisplayMode failed."); goto D3DError; } @@ -1422,7 +1422,7 @@ TryAgain: ddrval = lpDD->CreateSurface(&ddsd2, &lpFrontBuffer, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: CreateSurface (Front) failed.\n")); + mprintf(0, "D3D_INIT: CreateSurface (Front) failed.\n"); rend_SetErrorMessage("CreateSurface (front) failed."); goto D3DError; } @@ -1432,7 +1432,7 @@ TryAgain: ddrval = lpFrontBuffer->GetAttachedSurface(&ddscaps, &lpBackBuffer); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: GetAttachedSurface (Back) failed. Erorr=%s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D_INIT: GetAttachedSurface (Back) failed. Erorr=%s\n", d3d_ErrorString(ddrval)); rend_SetErrorMessage("CreateSurface (back) failed."); goto D3DError; } @@ -1441,7 +1441,7 @@ TryAgain: ddrval = lpDD->QueryInterface(IID_IDirect3D3, (LPVOID *)&lpD3D); if (ddrval != DD_OK) { lpD3D = NULL; - mprintf((0, "D3D_INIT: QueryInterface failed.\n")); + mprintf(0, "D3D_INIT: QueryInterface failed.\n"); rend_SetErrorMessage("QueryInterface D3D failed."); goto D3DError; } @@ -1451,7 +1451,7 @@ TryAgain: lpD3D->EnumZBufferFormats(dd->guid_3d, d3d_EnumZPixelFormats, 0); if (NumZDepths == 0) { - mprintf((0, "D3D_INIT: Couldn't find zbuffer format!\n")); + mprintf(0, "D3D_INIT: Couldn't find zbuffer format!\n"); rend_SetErrorMessage("Couldn't find a zbuffer format!"); goto D3DError; } @@ -1476,7 +1476,7 @@ TryAgain: if (found_format == -1) found_format = 0; else - mprintf((0, "Found a 32bit zbuffer.\n")); + mprintf(0, "Found a 32bit zbuffer.\n"); } ddsd2.ddpfPixelFormat = ZPixFormats[found_format]; @@ -1485,13 +1485,13 @@ TryAgain: ddsd2.ddsCaps.dwCaps = DDSCAPS_ZBUFFER | DDSCAPS_VIDEOMEMORY; ddrval = lpDD->CreateSurface(&ddsd2, &lpZBuffer, NULL); if (ddrval != DD_OK) { - mprintf((0, "D3D_INIT: Create Zbuffer failed.\nError=%s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D_INIT: Create Zbuffer failed.\nError=%s\n", d3d_ErrorString(ddrval)); rend_SetErrorMessage("Creating zbuffer failed."); goto D3DError; } if (lpBackBuffer->AddAttachedSurface(lpZBuffer) != DD_OK) { - mprintf((0, "D3D_INIT: Attach Zbuffer failed.\n")); + mprintf(0, "D3D_INIT: Attach Zbuffer failed.\n"); rend_SetErrorMessage("Attach ZBuffer failed."); goto D3DError; } @@ -1501,7 +1501,7 @@ TryAgain: if (ddrval != DD_OK) { rend_SetErrorMessage("Create D3D Device3 failed."); - mprintf((0, "D3D_INIT: Create D3D Device3 failed. %s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D_INIT: Create D3D Device3 failed. %s\n", d3d_ErrorString(ddrval)); if (retried == false) { retried = true; @@ -1521,14 +1521,14 @@ TryAgain: ddrval = lpD3D->CreateViewport(&lpViewport, NULL); if (ddrval != DD_OK) { rend_SetErrorMessage("CreateViewport failed."); - mprintf((0, "D3D_INIT: CreateViewport failed.\n")); + mprintf(0, "D3D_INIT: CreateViewport failed.\n"); goto D3DError; } ddrval = lpD3DDevice->AddViewport(lpViewport); if (ddrval != DD_OK) { rend_SetErrorMessage("AddViewport failed."); - mprintf((0, "D3D_INIT: AddViewport failed.\n")); + mprintf(0, "D3D_INIT: AddViewport failed.\n"); goto D3DError; } @@ -1554,14 +1554,14 @@ TryAgain: if (ddrval != DD_OK) { rend_SetErrorMessage("SetViewport failed."); - mprintf((0, "D3D_INIT: SetViewport failed.\n")); + mprintf(0, "D3D_INIT: SetViewport failed.\n"); goto D3DError; } ddrval = lpD3DDevice->SetCurrentViewport(lpViewport); if (ddrval != DD_OK) { rend_SetErrorMessage("SetCurrentViewport failed."); - mprintf((0, "D3D_INIT: SetCurrentViewport failed.\n")); + mprintf(0, "D3D_INIT: SetCurrentViewport failed.\n"); goto D3DError; } @@ -1571,7 +1571,7 @@ TryAgain: goto D3DError; } - mprintf((0, "Direct3D Initialized OK!\n")); + mprintf(0, "Direct3D Initialized OK!\n"); d3d_SetDefaultStates(); @@ -1580,7 +1580,7 @@ TryAgain: return retval; D3DError: - mprintf((0, "Direct3D Initialization failed.\n")); + mprintf(0, "Direct3D Initialization failed.\n"); d3d_Close(); Int3(); @@ -1635,12 +1635,12 @@ void d3d_Close() { ddrval = lpDD->RestoreDisplayMode(); if (ddrval != DD_OK) { - mprintf((0, "RestoreDisplayMode failed (0x%x)\n", ddrval)); + mprintf(0, "RestoreDisplayMode failed (0x%x)\n", ddrval); } ddrval = lpDD->SetCooperativeLevel(hwnd, DDSCL_NORMAL); if (ddrval != DD_OK) { - mprintf((0, "WIN_DD32: SetCooperativeLevel W Failed (0x%x)\n", ddrval)); + mprintf(0, "WIN_DD32: SetCooperativeLevel W Failed (0x%x)\n", ddrval); } lpDD1->Release(); @@ -1690,7 +1690,7 @@ int d3d_GetAlphaMultiplier() { case AT_SPECULAR: return 255; default: - mprintf((0, "Unrecognized alpha type=%d\n", D3D_state.cur_alpha_type)); + mprintf(0, "Unrecognized alpha type=%d\n", D3D_state.cur_alpha_type); // Int3(); // no type defined,get jason return 255; } @@ -1764,7 +1764,7 @@ int d3d_MakeBitmapCurrent(int handle, int map_type, int tn) { if (Last_texture_bound[tn] != texnum) { ddrval = sp->QueryInterface(IID_IDirect3DTexture2, (void **)&tex_interface); if (ddrval != S_OK) { - mprintf((0, "D3D:MakeBitmapCurrent error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:MakeBitmapCurrent error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); return 0; } @@ -1953,7 +1953,7 @@ void d3d_DrawFlatPolygon(g3Point **p, int nv) { (LPVOID)TVerts, nv, D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS); if (ddrval != DD_OK) { - mprintf((0, "D3D:DrawFlatPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:DrawFlatPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); } } @@ -2033,22 +2033,22 @@ int d3d_DrawBumpmappedPolygon(g3Point **p, int nv, int handle) { } if (!d3d_MakeBitmapCurrent(handle, MAP_TYPE_BITMAP, 0)) { - mprintf((0, "Couldn't make the map current!\n")); + mprintf(0, "Couldn't make the map current!\n"); return 0; } if (!d3d_MakeBitmapCurrent(Bump_map, MAP_TYPE_BUMPMAP, 1)) { - mprintf((0, "could not set bump mapping blend modes\n")); + mprintf(0, "could not set bump mapping blend modes\n"); return 0; } if (d3d_EnvironmentMap == -1) { - mprintf((0, "Couldn't make environment map!\n")); + mprintf(0, "Couldn't make environment map!\n"); return 0; } if (!d3d_MakeBitmapCurrent(d3d_EnvironmentMap, MAP_TYPE_BITMAP, 2)) { - mprintf((0, "Couldn't set environment map!\n")); + mprintf(0, "Couldn't set environment map!\n"); return 0; } @@ -2062,7 +2062,7 @@ int d3d_DrawBumpmappedPolygon(g3Point **p, int nv, int handle) { (LPVOID)MTVerts, nv, D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS); if (ddrval != DD_OK) { - mprintf((0, "D3D:DrawBumpmappedPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:DrawBumpmappedPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); } return 1; @@ -2146,12 +2146,12 @@ void d3d_DrawMultiTexturePolygon(g3Point **p, int nv, int handle, int map_type) } if (!d3d_MakeBitmapCurrent(handle, map_type, 0)) { - mprintf((0, "Couldn't make the map current!\n")); + mprintf(0, "Couldn't make the map current!\n"); return; } if (!d3d_MakeBitmapCurrent(Overlay_map, MAP_TYPE_LIGHTMAP, 1)) { - mprintf((0, "Couldn't make the map current!\n")); + mprintf(0, "Couldn't make the map current!\n"); return; } @@ -2164,7 +2164,7 @@ void d3d_DrawMultiTexturePolygon(g3Point **p, int nv, int handle, int map_type) (LPVOID)MTVerts, nv, D3DDP_DONOTCLIP | D3DDP_DONOTLIGHT | D3DDP_DONOTUPDATEEXTENTS); if (ddrval != DD_OK) { - mprintf((0, "D3D:DrawPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:DrawPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); } } @@ -2179,7 +2179,7 @@ void d3d_DrawPolygon(int handle, g3Point **p, int nv, int map_type) { ASSERT(Overlay_type == OT_NONE); if (!d3d_DrawBumpmappedPolygon(p, nv, handle)) { - mprintf((0, "error in d3d_DrawBumpmappedPolygon\n")); + mprintf(0, "error in d3d_DrawBumpmappedPolygon\n"); } rend_SetBumpmapReadyState(0, 0); @@ -2284,7 +2284,7 @@ void d3d_DrawPolygon(int handle, g3Point **p, int nv, int map_type) { } if (!d3d_MakeBitmapCurrent(handle, map_type, 0)) { - mprintf((0, "Couldn't make the map current!\n")); + mprintf(0, "Couldn't make the map current!\n"); return; } @@ -2308,7 +2308,7 @@ void d3d_DrawPolygon(int handle, g3Point **p, int nv, int map_type) { d3d_SetAlphaType(AT_LIGHTMAP_BLEND_SATURATE); if (!d3d_MakeBitmapCurrent(Overlay_map, MAP_TYPE_LIGHTMAP, 0)) { - mprintf((0, "Couldn't make the map current!\n")); + mprintf(0, "Couldn't make the map current!\n"); return; } @@ -2333,7 +2333,7 @@ void d3d_DrawPolygon(int handle, g3Point **p, int nv, int map_type) { } if (ddrval != DD_OK) { - mprintf((0, "D3D:DrawPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval))); + mprintf(0, "D3D:DrawPolygon error %d! %s\n", ddrval, d3d_ErrorString(ddrval)); } } @@ -2355,7 +2355,7 @@ void d3d_BeginFrame(int x1, int y1, int x2, int y2, int clear_flags) { ddrval = lpD3DDevice->BeginScene(); if (ddrval != D3D_OK) { - mprintf((0, "D3D:Failed to begin scene!\n%s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D:Failed to begin scene!\n%s\n", d3d_ErrorString(ddrval)); return; } @@ -2385,7 +2385,7 @@ void d3d_EndFrame() { HRESULT ddrval; ddrval = lpD3DDevice->EndScene(); if (ddrval != D3D_OK) { - mprintf((0, "D3D:Failed to end scene!\n%s\n", d3d_ErrorString(ddrval))); + mprintf(0, "D3D:Failed to end scene!\n%s\n", d3d_ErrorString(ddrval)); return; } @@ -2414,13 +2414,13 @@ TryFlipAgain: ddrval = lpFrontBuffer->Flip(NULL, NULL); if (ddrval == DDERR_SURFACELOST) { - mprintf((0, "Front surface lost... attempting to restore...\n")); + mprintf(0, "Front surface lost... attempting to restore...\n"); Sleep(500); // Wait 1/2 second goto TryFlipAgain; } /*else if (ddrval != DD_OK ) { - mprintf((0,"D3D:Fullscreen flip failed! %s\n",d3d_ErrorString(ddrval) )); + mprintf(0,"D3D:Fullscreen flip failed! %s\n",d3d_ErrorString(ddrval) ); }*/ // Print stats from the current frame @@ -2428,10 +2428,10 @@ TryFlipAgain: int i; RTP_INCRVALUE(texture_uploads, D3D_uploads); RTP_INCRVALUE(polys_drawn, D3D_polys_drawn); - mprintf_at((1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", D3D_uploads, D3D_polys_drawn, D3D_verts_processed)); - mprintf_at((1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", D3D_sets_this_frame[0], D3D_sets_this_frame[1], - D3D_sets_this_frame[2], D3D_sets_this_frame[3])); - mprintf_at((1, 3, 0, "Sets= 4:%d 5:%d ", D3D_sets_this_frame[4], D3D_sets_this_frame[5])); + mprintf_at(1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", D3D_uploads, D3D_polys_drawn, D3D_verts_processed); + mprintf_at(1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", D3D_sets_this_frame[0], D3D_sets_this_frame[1], + D3D_sets_this_frame[2], D3D_sets_this_frame[3]); + mprintf_at(1, 3, 0, "Sets= 4:%d 5:%d ", D3D_sets_this_frame[4], D3D_sets_this_frame[5]); for (i = 0; i < 8; i++) D3D_sets_this_frame[i] = 0; #endif @@ -2943,7 +2943,7 @@ void d3d_SetMipState(int8_t state) { int d3d_SetPreferredState(renderer_preferred_state *pref_state) { int retval = 1; renderer_preferred_state old_state = D3D_preferred_state; - mprintf((0, "In D3d_SetPreferredState\n")); + mprintf(0, "In D3d_SetPreferredState\n"); D3D_preferred_state = *pref_state; @@ -2993,7 +2993,7 @@ void d3d_SetGammaValue(float val) { if (!d3d_CanGamma) return; - mprintf((0, "Setting gamma to %f\n", val)); + mprintf(0, "Setting gamma to %f\n", val); DDGAMMARAMP rampvals; @@ -3013,7 +3013,7 @@ void d3d_SetGammaValue(float val) { } HRESULT rval = lpGammaControl->SetGammaRamp(0, &rampvals); - mprintf((0, "Gamma return val is %d (%x) (%s)\n", rval, rval, d3d_ErrorString(rval))); + mprintf(0, "Gamma return val is %d (%x) (%s)\n", rval, rval, d3d_ErrorString(rval)); } // Gets the current state of the renderer @@ -3076,7 +3076,7 @@ int d3d_lfb_locked = 0; // Locks the linear frame buffer for application access void d3d_GetLFBLock(renderer_lfb *lfb) { if (d3d_lfb_locked != 0) { - mprintf((0, "ERROR!!! You are trying to get an lfb lock and there already is one!\n")); + mprintf(0, "ERROR!!! You are trying to get an lfb lock and there already is one!\n"); lfb->data = NULL; return; } @@ -3103,7 +3103,7 @@ void d3d_GetLFBLock(renderer_lfb *lfb) { // Releases the previous LFB lock void d3d_ReleaseLFBLock(renderer_lfb *lfb) { if (d3d_lfb_locked != 1) { - mprintf((0, "ERROR!!! You are trying to release an LFB lock and there is none!\n")); + mprintf(0, "ERROR!!! You are trying to release an LFB lock and there is none!\n"); return; } @@ -3307,7 +3307,7 @@ void d3d_Screenshot(int bm_handle) { // Release the lock lpFrontBuffer->Unlock(NULL); } else { - mprintf((0, "Couldn't get a lock to d3d front buffer!\n")); + mprintf(0, "Couldn't get a lock to d3d front buffer!\n"); Int3(); } } diff --git a/legacy/renderer/opengl.cpp b/legacy/renderer/opengl.cpp index f2d420a5..c4988fe6 100644 --- a/legacy/renderer/opengl.cpp +++ b/legacy/renderer/opengl.cpp @@ -62,24 +62,20 @@ extern int WindowGL; // JEFF: I PUT THIS IN TO MAKE THINGS A LITTLE BRIGHTER SO I CAN SEE WHILE TESTING #define BRIGHTNESS_HACK 1.6f -/* -#ifndef NDEBUG - GLenum GL_error_code; - const uint8_t *GL_error_string; - #define CHECK_ERROR(x) { GL_error_code=dglGetError ();\ - if (GL_error_code!=GL_NO_ERROR)\ - {\ - GL_error_string=gluErrorString -(GL_error_code);\ - mprintf ((0,"GL_ERROR: id=%d code=%d -String=%s\n",x,GL_error_code,GL_error_string));\ - }\ - } +#ifdef ENABLE_CHECK_ERROR +GLenum GL_error_code; +const uint8_t *GL_error_string; +#define CHECK_ERROR(x) \ + { \ + GL_error_code = dglGetError(); \ + if (GL_error_code != GL_NO_ERROR) { \ + GL_error_string = gluErrorString(GL_error_code); \ + mprintf(0, "GL_ERROR: id=%d code=%d String=%s\n", x, GL_error_code, GL_error_string); \ + } \ + } #else - #define CHECK_ERROR(x) -#endif*/ - -#define CHECK_ERROR(x) + #define CHECK_ERROR(x) +#endif #if defined(WIN32) // Moved from DDGR library @@ -236,10 +232,10 @@ int opengl_CheckExtension(const char *extName) { // Gets some specific information about this particular flavor of opengl void opengl_GetInformation() { - mprintf((0, "OpenGL Vendor: %s\n", dglGetString(GL_VENDOR))); - mprintf((0, "OpenGL Renderer: %s\n", dglGetString(GL_RENDERER))); - mprintf((0, "OpenGL Version: %s\n", dglGetString(GL_VERSION))); - mprintf((0, "OpenGL Extensions: %s\n", dglGetString(GL_EXTENSIONS))); + mprintf(0, "OpenGL Vendor: %s\n", dglGetString(GL_VENDOR)); + mprintf(0, "OpenGL Renderer: %s\n", dglGetString(GL_RENDERER)); + mprintf(0, "OpenGL Version: %s\n", dglGetString(GL_VERSION)); + mprintf(0, "OpenGL Extensions: %s\n", dglGetString(GL_EXTENSIONS)); /* #ifndef RELEASE // If this is the microsoft driver, then make stuff go faster @@ -322,7 +318,7 @@ int opengl_InitCache() { // Sets default states for our renderer void opengl_SetDefaults() { - mprintf((0, "Setting states\n")); + mprintf(0, "Setting states\n"); OpenGL_state.cur_color = 0x00FFFFFF; OpenGL_state.cur_bilinear_state = -1; @@ -455,7 +451,7 @@ int opengl_Setup(HDC glhdc) { return NULL; } - mprintf((0, "Choose pixel format successful!\n")); + mprintf(0, "Choose pixel format successful!\n"); // Try and set the new PFD if (SetPixelFormat(glhdc, pf, &pfd) == FALSE) { @@ -465,7 +461,7 @@ int opengl_Setup(HDC glhdc) { return NULL; } - mprintf((0, "SetPixelFormat successful!\n")); + mprintf(0, "SetPixelFormat successful!\n"); // Get a copy of the newly set PFD if (DescribePixelFormat(glhdc, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd_copy) == 0) { @@ -491,7 +487,7 @@ int opengl_Setup(HDC glhdc) { } ASSERT(ResourceContext != NULL); - mprintf((0, "Making context current\n")); + mprintf(0, "Making context current\n"); dwglMakeCurrent((HDC)glhdc, ResourceContext); Already_loaded = 1; @@ -688,7 +684,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { int retval = 1; int i; - mprintf((0, "Setting up opengl mode!\n")); + mprintf(0, "Setting up opengl mode!\n"); if (pref_state) { OpenGL_preferred_state = *pref_state; @@ -723,7 +719,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { int retval = ChangeDisplaySettings(&devmode, 0); if (retval != DISP_CHANGE_SUCCESSFUL) { - mprintf((0, "Display mode change failed (err=%d), trying default!\n", retval)); + mprintf(0, "Display mode change failed (err=%d), trying default!\n", retval); retval = -1; devmode.dmBitsPerPel = 16; devmode.dmPelsWidth = 640; @@ -732,7 +728,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { retval = ChangeDisplaySettings(&devmode, 0); if (retval != DISP_CHANGE_SUCCESSFUL) { - mprintf((0, "OpenGL_INIT:Change display setting failed failed!\n")); + mprintf(0, "OpenGL_INIT:Change display setting failed failed!\n"); rend_SetErrorMessage("OGL: ChangeDisplaySettings failed. Make sure your desktop is set to 16bit mode!"); ChangeDisplaySettings(NULL, 0); goto D3DError; @@ -742,8 +738,10 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { OpenGL_preferred_state.height = 480; } } else - mprintf((0, "Setdisplaymode to %d x %d (%d bits) is successful!\n", OpenGL_preferred_state.width, - OpenGL_preferred_state.height, OpenGL_preferred_state.bit_depth)); + mprintf(0, "Setdisplaymode to %d x %d (%d bits) is successful!\n", + OpenGL_preferred_state.width, + OpenGL_preferred_state.height, + OpenGL_preferred_state.bit_depth); } memset(&OpenGL_state, 0, sizeof(rendering_state)); @@ -775,7 +773,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { height = OpenGL_preferred_state.height; RECT rect; GetWindowRect((HWND)hOpenGLWnd, &rect); - mprintf((0, "rect=%d %d %d %d\n", rect.top, rect.right, rect.bottom, rect.left)); + mprintf(0, "rect=%d %d %d %d\n", rect.top, rect.right, rect.bottom, rect.left); } OpenGL_state.screen_width = width; @@ -809,7 +807,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { // Get some info opengl_GetInformation(); - mprintf((0, "Setting up projection matrix\n")); + mprintf(0, "Setting up projection matrix\n"); dglMatrixMode(GL_PROJECTION); dglLoadIdentity(); @@ -841,7 +839,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { ASSERT(opengl_packed_Translate_table); ASSERT(opengl_packed_4444_translate_table); - mprintf((0, "Building packed OpenGL translate table...\n")); + mprintf(0, "Building packed OpenGL translate table...\n"); for (i = 0; i < 65536; i++) { int r = (i >> 10) & 0x1f; @@ -889,7 +887,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { ASSERT(opengl_Translate_table); ASSERT(opengl_4444_translate_table); - mprintf((0, "Building OpenGL translate table...\n")); + mprintf(0, "Building OpenGL translate table...\n"); for (i = 0; i < 65536; i++) { uint32_t pix; @@ -956,7 +954,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { OpenGL_state.initted = 1; - mprintf((0, "OpenGL initialization at %d x %d was successful.\n", width, height)); + mprintf(0, "OpenGL initialization at %d x %d was successful.\n", width, height); return retval; @@ -1220,7 +1218,7 @@ void opengl_TranslateBitmapToOpenGL(int texnum, int bm_handle, int map_type, int } } - // mprintf ((1,"Doing slow upload to opengl!\n")); + // mprintf(1,"Doing slow upload to opengl!\n"); if (map_type == MAP_TYPE_LIGHTMAP) GameLightmaps[bm_handle].flags &= ~LF_LIMITS; @@ -1247,7 +1245,7 @@ int opengl_MakeBitmapCurrent(int handle, int map_type, int tn) { } if (w != h) { - mprintf((0, "Can't use non-square textures with OpenGL!\n")); + mprintf(0, "Can't use non-square textures with OpenGL!\n"); return 0; } @@ -1865,11 +1863,10 @@ void opengl_Flip() { RTP_INCRVALUE(texture_uploads, OpenGL_uploads); RTP_INCRVALUE(polys_drawn, OpenGL_polys_drawn); - mprintf_at( - (1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", OpenGL_uploads, OpenGL_polys_drawn, OpenGL_verts_processed)); - mprintf_at((1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", OpenGL_sets_this_frame[0], OpenGL_sets_this_frame[1], - OpenGL_sets_this_frame[2], OpenGL_sets_this_frame[3])); - mprintf_at((1, 3, 0, "Sets= 4:%d 5:%d ", OpenGL_sets_this_frame[4], OpenGL_sets_this_frame[5])); + mprintf_at(1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", OpenGL_uploads, OpenGL_polys_drawn, OpenGL_verts_processed); + mprintf_at(1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", OpenGL_sets_this_frame[0], OpenGL_sets_this_frame[1], + OpenGL_sets_this_frame[2], OpenGL_sets_this_frame[3]); + mprintf_at(1, 3, 0, "Sets= 4:%d 5:%d ", OpenGL_sets_this_frame[4], OpenGL_sets_this_frame[5]); for (i = 0; i < 10; i++) OpenGL_sets_this_frame[i] = 0; #endif @@ -1998,7 +1995,7 @@ void opengl_SetZBufferState(int8_t state) { OpenGL_sets_this_frame[5]++; OpenGL_state.cur_zbuffer_state = state; - // mprintf ((0,"OPENGL: Setting zbuffer state to %d.\n",state)); + // mprintf(0,"OPENGL: Setting zbuffer state to %d.\n",state); if (state) { dglEnable(GL_DEPTH_TEST); @@ -2013,7 +2010,7 @@ void opengl_SetZValues(float nearz, float farz) { OpenGL_state.cur_near_z = nearz; OpenGL_state.cur_far_z = farz; - // mprintf ((0,"OPENGL:Setting depth range to %f - %f\n",nearz,farz)); + // mprintf(0,"OPENGL:Setting depth range to %f - %f\n",nearz,farz); // JEFF: glDepthRange must take parameters [0,1] // It is set in init @@ -2359,7 +2356,7 @@ void opengl_SetGammaValue(float val) { OpenGL_preferred_state.gamma = val; - mprintf((0, "Setting gamma to %f\n", val)); + mprintf(0, "Setting gamma to %f\n", val); #if defined(WIN32) WORD rampvals[3 * 256]; @@ -2392,7 +2389,7 @@ int opengl_SetPreferredState(renderer_preferred_state *pref_state) { if (OpenGL_state.initted) { int reinit = 0; - mprintf((0, "Inside pref state!\n")); + mprintf(0, "Inside pref state!\n"); // Change gamma if needed if (pref_state->width != OpenGL_state.screen_width || pref_state->height != OpenGL_state.screen_height || diff --git a/legacy/renderer/renderer.cpp b/legacy/renderer/renderer.cpp index b6ce0212..ba91d769 100644 --- a/legacy/renderer/renderer.cpp +++ b/legacy/renderer/renderer.cpp @@ -549,7 +549,7 @@ int rend_Init(renderer_type state, oeApplication *app, renderer_preferred_state OpenGL_window_initted = 0; } #endif - mprintf((0, "Renderer init is set to %d\n", Renderer_initted)); + mprintf(0, "Renderer init is set to %d\n", Renderer_initted); switch (Renderer_type) { case RENDERER_SOFTWARE_16BIT: case RENDERER_SOFTWARE_8BIT: @@ -616,7 +616,7 @@ int rend_Init(renderer_type state, oeApplication *app, renderer_preferred_state #endif // #ifdef DEDICATED_ONLY } void rend_Close() { - mprintf((0, "CLOSE:Renderer init is set to %d\n", Renderer_initted)); + mprintf(0, "CLOSE:Renderer init is set to %d\n", Renderer_initted); if (!Renderer_initted) return; #ifdef USE_OPENGL @@ -772,7 +772,7 @@ void rend_SetFogBorders(float fog_near, float fog_far) { } void rend_SetRendererType(renderer_type state) { Renderer_type = state; - mprintf((0, "RendererType is set to %d.\n", state)); + mprintf(0, "RendererType is set to %d.\n", state); } void rend_SetLighting(light_state state) { switch (Renderer_type) { @@ -1158,7 +1158,7 @@ void rend_ClearZBuffer() { } // Clears the zbuffer for the screen void rend_ResetCache() { - mprintf((0, "Resetting texture cache!\n")); + mprintf(0, "Resetting texture cache!\n"); switch (Renderer_type) { case RENDERER_SOFTWARE_16BIT: case RENDERER_SOFTWARE_8BIT: @@ -1694,7 +1694,7 @@ void rend_GetProjectionParameters(int *width, int *height) { #endif break; default: - mprintf((0, "Function not implemented for this lib!\n")); + mprintf(0, "Function not implemented for this lib!\n"); Int3(); break; } @@ -1709,7 +1709,7 @@ void rend_GetProjectionScreenParameters(int &screenLX, int &screenTY, int &scree } break; default: - mprintf((0, "Function not implemented for this lib!\n")); + mprintf(0, "Function not implemented for this lib!\n"); Int3(); break; } @@ -1752,7 +1752,7 @@ float rend_GetAspectRatio() { break; #endif default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); return -1; Int3(); break; @@ -1765,7 +1765,7 @@ void rend_DrawLFBBitmap(int sx, int sy, int w, int h, int dx, int dy, uint16_t * lfb.type = LFB_LOCK_WRITE; rend_GetLFBLock(&lfb); if (lfb.data == NULL) { - mprintf((0, "Couldn't get lock in rend_DrawLFBBitmap!\n")); + mprintf(0, "Couldn't get lock in rend_DrawLFBBitmap!\n"); return; } for (i = 0; i < h; i++) { @@ -1877,7 +1877,7 @@ int rend_SetPreferredState(renderer_preferred_state *pref_state) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -1899,7 +1899,7 @@ void rend_SetGammaValue(float val) { case RENDERER_DIRECT3D: break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -1940,7 +1940,7 @@ void rend_GetRenderState(rendering_state *rstate) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -1969,7 +1969,7 @@ void rend_CopyBitmapToFramebuffer(int bm_handle, int x, int y) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -1994,7 +1994,7 @@ void rend_SetFrameBufferCopyState(bool state) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2014,7 +2014,7 @@ void rend_SetResolution(int width, int height) { case RENDERER_DIRECT3D: break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2037,7 +2037,7 @@ void rend_CloseOpenGLWindow() { opengl_Close(); WindowGL = 0; OpenGL_window_initted = 0; - mprintf((1, "SHUTTING DOWN WINDOWED OPENGL!")); + mprintf(1, "SHUTTING DOWN WINDOWED OPENGL!"); #endif } // Sets the state of the OpenGLWindow to on or off @@ -2091,7 +2091,7 @@ void rend_SetCoplanarPolygonOffset(float factor) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2112,7 +2112,7 @@ void rend_PreUploadTextureToCard(int handle, int map_type) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2133,7 +2133,7 @@ void rend_FreePreUploadedTexture(int handle, int map_type) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2160,7 +2160,7 @@ int rend_LowVidMem() { case RENDERER_DIRECT3D: return 0; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2180,7 +2180,7 @@ int rend_SupportsBumpmapping() { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2199,7 +2199,7 @@ void rend_SetBumpmapReadyState(int state, int map) { Bump_map = map; break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2221,7 +2221,7 @@ void *rend_RetrieveDirectDrawObj(void **frontsurf, void **backsurf) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } @@ -2254,7 +2254,7 @@ void rend_GetStatistics(tRendererStats *stats) { #endif break; default: - mprintf((0, "Function not implemented for the lib!\n")); + mprintf(0, "Function not implemented for the lib!\n"); Int3(); break; } diff --git a/lib/pserror.h b/lib/pserror.h index 068eb89b..692b4e50 100644 --- a/lib/pserror.h +++ b/lib/pserror.h @@ -212,7 +212,7 @@ static inline void SetDebugBreakHandlers(void (*stop)(), void (*resume)()) { #define ASSERT(x) \ do { \ if (!(unsigned)(x)) { \ - mprintf((0, "Assertion failed (%s) in %s line %d.\n", #x, __FILE__, __LINE__)); \ + mprintf(0, "Assertion failed (%s) in %s line %d.\n", #x, __FILE__, __LINE__); \ if (Debug_break) \ DEBUG_BREAK(); \ else \ @@ -221,7 +221,7 @@ static inline void SetDebugBreakHandlers(void (*stop)(), void (*resume)()) { } while (0) #define Int3() \ do { \ - mprintf((0, "Int3 at %s line %d.\n", __FILE__, __LINE__)); \ + mprintf(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \ if (Debug_break) \ DEBUG_BREAK(); \ else \ @@ -246,7 +246,7 @@ static inline void SetDebugBreakHandlers(void (*stop)(), void (*resume)()) { #define ASSERT(x) SDL_assert(x) #define Int3() \ do { \ - mprintf((0, "Int3 at %s line %d.\n", __FILE__, __LINE__)); \ + mprintf(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \ if (Debug_break) \ DEBUG_BREAK(); \ else \ diff --git a/linux/lnxcon_null.cpp b/linux/lnxcon_null.cpp index 126fbc4d..fc1e1e75 100644 --- a/linux/lnxcon_null.cpp +++ b/linux/lnxcon_null.cpp @@ -81,4 +81,4 @@ bool con_null_Create(void) { void con_null_Destroy(void) {} // put some data up on the screen -void con_null_Puts(int window, const char *str) { mprintf((0, str)); } +void con_null_Puts(int window, const char *str) { mprintf(0, str); } diff --git a/linux/lnxcontroller.cpp b/linux/lnxcontroller.cpp index 0e35fd78..5b49d65d 100644 --- a/linux/lnxcontroller.cpp +++ b/linux/lnxcontroller.cpp @@ -294,7 +294,7 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { case ctMouseButton: for (j = 0; j < CT_MAX_BUTTONS; j++) { if (ddio_MouseBtnUpCount(j)) { - // mprintf((0, "MseBtn %d down\n", j)); + // mprintf(0, "MseBtn %d down\n", j); val = MAKE_CONFIG_DATA(CONTROLLER_CTL_INFO(1, NULL_CONTROLLER), CONTROLLER_CTL_VALUE(j + 1, NULL_BINDING)); return val; } @@ -386,13 +386,13 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { } if (m_ControlList[i].flags & CTF_Y_AXIS) { pos = get_axis_value(i, CT_Y_AXIS, ctAnalog); - // mprintf((0, "y=%.2f ", pos)); + // mprintf(0, "y=%.2f ", pos); if (fabs(pos) >= 0.90f) val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_Y_AXIS, NULL_BINDING)); } if (m_ControlList[i].flags & CTF_X_AXIS) { pos = get_axis_value(i, CT_X_AXIS, ctAnalog); - // mprintf((0, "x=%.2f\n", pos)); + // mprintf(0, "x=%.2f\n", pos); if (fabs(pos) >= 0.90f) val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_X_AXIS, NULL_BINDING)); } @@ -815,7 +815,7 @@ void lnxgameController::extctl_getpos(int id) { if ((ji.buttons & (1 << i)) && !(m_ExtCtlStates[id].buttons & (1 << i))) { m_ExtCtlStates[id].btnpresses[i]++; m_ExtCtlStates[id].btnstarts[i] = timer_val; - // mprintf((0, "Start time for %d = %f\n", i, timer_val)); + // mprintf(0, "Start time for %d = %f\n", i, timer_val); } if (ji.buttons & (1 << i)) // if button is down @@ -917,7 +917,7 @@ bool lnxgameController::enum_controllers() { m_ControlList[num_devs].sensmod[i] = 1.0f; } m_ControlList[num_devs].deadzone = JOY_DEADZONE; - mprintf((0, "Controller %s found.\n", jc.name)); + mprintf(0, "Controller %s found.\n", jc.name); // okay, now search for a "****.ctl" file in the current directory parse_ctl_file(num_devs, jc.name); @@ -1101,7 +1101,7 @@ float lnxgameController::get_button_value(int8_t controller, ct_format format, u break; default: - mprintf((1, "gameController::button unsupported format for function\n")); + mprintf(1, "gameController::button unsupported format for function\n"); } return val; @@ -1167,7 +1167,7 @@ float lnxgameController::get_axis_value(int8_t controller, uint8_t axis, ct_form normalizer = ctldev->normalizer[axis] * m_frame_time; nullzone = MOUSE_DEADZONE; if (axis == CT_X_AXIS) { - // mprintf_at((4, 4, 0, "m_dX:%03d normal:%03.2f", (int)axisval, normalizer)); + // mprintf_at(4, 4, 0, "m_dX:%03d normal:%03.2f", (int)axisval, normalizer); } } else { @@ -1204,7 +1204,7 @@ float lnxgameController::get_axis_value(int8_t controller, uint8_t axis, ct_form val = val - (float)1.0; } else { val = (float)0.0; - mprintf((1, "gameController::axis unsupported format for function.\n")); + mprintf(1, "gameController::axis unsupported format for function.\n"); } ct_packet key_slide1, key_bank; @@ -1338,7 +1338,7 @@ float lnxgameController::get_pov_value(int8_t controller, ct_format format, uint break; default: - mprintf((1, "gameController::pov unsupported format for function\n")); + mprintf(1, "gameController::pov unsupported format for function\n"); } return val; @@ -1366,7 +1366,7 @@ float lnxgameController::get_key_value(int key, ct_format format) { break; default: - mprintf((1, "gameController::key unsupported format for function\n")); + mprintf(1, "gameController::key unsupported format for function\n"); } return val; diff --git a/linux/lnxdata.cpp b/linux/lnxdata.cpp index bef3a7d6..a87655d4 100644 --- a/linux/lnxdata.cpp +++ b/linux/lnxdata.cpp @@ -90,7 +90,7 @@ oeLnxAppDatabase::~oeLnxAppDatabase() { return; } - mprintf((0, "Can't Export Database Since It's Not There!\n")); + mprintf(0, "Can't Export Database Since It's Not There!\n"); } CRegistry *oeLnxAppDatabase::GetSystemRegistry() { return database; } @@ -105,7 +105,7 @@ bool oeLnxAppDatabase::create_record(const char *pathname) { database->CreateKey((char *)pathname); return true; } - mprintf((0, "Can't CreateKey because database NULL\n")); + mprintf(0, "Can't CreateKey because database NULL\n"); return false; } @@ -115,7 +115,7 @@ bool oeLnxAppDatabase::lookup_record(const char *pathname) { if (database) { return database->LookupKey((char *)pathname); } - mprintf((0, "Can't lookup key because database NULL\n")); + mprintf(0, "Can't lookup key because database NULL\n"); return false; } @@ -125,7 +125,7 @@ bool oeLnxAppDatabase::read(const char *label, char *entry, int *entrylen) { ASSERT(entry); ASSERT(entrylen); if (!database) { - mprintf((0, "Can't read record because database NULL\n")); + mprintf(0, "Can't read record because database NULL\n"); return false; } @@ -146,7 +146,7 @@ bool oeLnxAppDatabase::read(const char *label, void *entry, int wordsize) { ASSERT(label); ASSERT(entry); if (!database) { - mprintf((0, "Can't read record because Database NULL\n")); + mprintf(0, "Can't read record because Database NULL\n"); return false; } @@ -169,7 +169,7 @@ bool oeLnxAppDatabase::read(const char *label, void *entry, int wordsize) { *((uint32_t *)entry) = (uint32_t)data; break; default: - mprintf((0, "Unable to read key %s, unsupported size", label)); + mprintf(0, "Unable to read key %s, unsupported size", label); return false; break; } @@ -190,7 +190,7 @@ bool oeLnxAppDatabase::write(const char *label, const char *entry, int entrylen) ASSERT(label); ASSERT(entry); if (!database) { - mprintf((0, "Can't write record because database NULL\n")); + mprintf(0, "Can't write record because database NULL\n"); return false; } @@ -200,7 +200,7 @@ bool oeLnxAppDatabase::write(const char *label, const char *entry, int entrylen) bool oeLnxAppDatabase::write(const char *label, int entry) { ASSERT(label); if (!database) { - mprintf((0, "Can't write record because database NULL\n")); + mprintf(0, "Can't write record because database NULL\n"); return false; } return database->CreateRecord((char *)label, REGT_DWORD, &entry); diff --git a/linux/registry.cpp b/linux/registry.cpp index 54414806..7068abe6 100644 --- a/linux/registry.cpp +++ b/linux/registry.cpp @@ -240,10 +240,10 @@ bool CRegistry::Import() { char *ptr; file = fopen(name, "rt"); if (!file) { - mprintf((0, "REGISTRY: Unable to import %s\n", name)); + mprintf(0, "REGISTRY: Unable to import %s\n", name); return false; } - mprintf((0, "REGISTRY: Importing %s\n", name)); + mprintf(0, "REGISTRY: Importing %s\n", name); Destroy(); bool oktocreate; @@ -262,7 +262,7 @@ bool CRegistry::Import() { if (buffer[0] == '[') { // Create a key! PARSE_KEY(newbuff); - // mprintf((0,"Found Key: |%s|\n",newbuff)); + // mprintf(0,"Found Key: |%s|\n",newbuff); CreateKey(newbuff); } else if (buffer[0] == '\"') { // Create a record @@ -297,9 +297,9 @@ bool CRegistry::Import() { ptr++; // blow by = PARSE_STRING(data); if (!CreateRecord(newbuff, REGT_STRING, data)) { - // mprintf((0,"Unable to create String record: %s\n",newbuff)); + // mprintf(0,"Unable to create String record: %s\n",newbuff); } else { - // mprintf((0,"Created String record %s = %s\n",newbuff,data)); + // mprintf(0,"Created String record %s = %s\n",newbuff,data); } break; case REGT_DWORD: @@ -308,14 +308,14 @@ bool CRegistry::Import() { PARSE_TOKEN(data); idata = hextoi(data); if (!CreateRecord(newbuff, REGT_DWORD, &idata)) { - // mprintf((0,"Unable to create dword record: %s\n",newbuff)); + // mprintf(0,"Unable to create dword record: %s\n",newbuff); } else { - // mprintf((0,"Created dword record %s = %X\n",newbuff,idata)); + // mprintf(0,"Created dword record %s = %X\n",newbuff,idata); } break; }; } else { - // mprintf((0,"Expected [ or \"\n")); + // mprintf(0,"Expected [ or \"\n"); } } } @@ -326,7 +326,7 @@ bool CRegistry::Import() { void CRegistry::CreateKey(const char *name) { tKey *curr; if (LookupKey(name)) { - // mprintf((0,"Key: %s already exists\n",name)); + // mprintf(0,"Key: %s already exists\n",name); return; } if (!root) { @@ -427,7 +427,7 @@ bool CRegistry::CreateRecord(const char *name, char type, void *data) { curr = LookupRecord(name, olddata); if (curr) { // ok we have an old value, replace it! - // mprintf((0,"Replacing %s\n",name)); + // mprintf(0,"Replacing %s\n",name); if (curr->data) free(curr->data); free(olddata); diff --git a/manage/doorpage.cpp b/manage/doorpage.cpp index 8090a286..5886cbef 100644 --- a/manage/doorpage.cpp +++ b/manage/doorpage.cpp @@ -395,7 +395,7 @@ int mng_FindSpecificDoorPage(char *name, mngs_door_page *doorpage, int offset) { } if (!infile) { - mprintf((0, "Couldn't open table file to find door!\n")); + mprintf(0, "Couldn't open table file to find door!\n"); Int3(); return 0; } @@ -482,7 +482,7 @@ int mng_AssignDoorPageToDoor(mngs_door_page *doorpage, int n) { doorpointer->close_sound = mng_GetGuaranteedSoundPage(doorpage->close_sound_name); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignDoorPage...\n", doorpage->image_name)); + mprintf(0, "Couldn't load file '%s' in AssignDoorPage...\n", doorpage->image_name); doorpointer->model_handle = -1; return 0; } else @@ -528,7 +528,7 @@ void mng_LoadNetDoorPage(CFILE *infile, bool overlay) { n = FindDoorName(doorpage.door_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING DOOR %s\n", doorpage.door_struct.name)); + mprintf(0, "OVERLAYING DOOR %s\n", doorpage.door_struct.name); mng_FreePagetypePrimitives(PAGETYPE_DOOR, doorpage.door_struct.name, 0); mng_AssignDoorPageToDoor(&doorpage, n); } @@ -538,7 +538,7 @@ void mng_LoadNetDoorPage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadDoor(&doorpage); ASSERT(ret >= 0); } else - mprintf((0, "Could not load doorpage named %s!\n", doorpage.door_struct.name)); + mprintf(0, "Could not load doorpage named %s!\n", doorpage.door_struct.name); } // Reads a door page from a local table file. It then allocs a door and @@ -583,7 +583,7 @@ void mng_LoadLocalDoorPage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_DOOR && !stricmp(addon->Addon_tracklocks[tidx].name, doorpage.door_struct.name)) { // found it!! - mprintf((0, "DoorPage: %s previously loaded\n", doorpage.door_struct.name)); + mprintf(0, "DoorPage: %s previously loaded\n", doorpage.door_struct.name); need_to_load_page = false; break; } @@ -642,5 +642,5 @@ void mng_LoadLocalDoorPage(CFILE *infile) { mng_AllocTrackLock(doorpage.door_struct.name, PAGETYPE_DOOR); } else - mprintf((0, "Could not load doorpage named %s!\n", doorpage.door_struct.name)); + mprintf(0, "Could not load doorpage named %s!\n", doorpage.door_struct.name); } diff --git a/manage/gamefilepage.cpp b/manage/gamefilepage.cpp index 9d3274ca..342afebd 100644 --- a/manage/gamefilepage.cpp +++ b/manage/gamefilepage.cpp @@ -270,7 +270,7 @@ void mng_LoadNetGamefilePage(CFILE *infile, bool overlay) { int n = FindGamefileName(gamefilepage.gamefile_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING GAMEFILE %s\n", gamefilepage.gamefile_struct.name)); + mprintf(0, "OVERLAYING GAMEFILE %s\n", gamefilepage.gamefile_struct.name); mng_FreePagetypePrimitives(PAGETYPE_GAMEFILE, gamefilepage.gamefile_struct.name, 0); mng_AssignGamefilePageToGamefile(&gamefilepage, n); } @@ -280,7 +280,7 @@ void mng_LoadNetGamefilePage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadGamefile(&gamefilepage); ASSERT(ret >= 0); } else - mprintf((0, "Could not load gamefilepage named %s!\n", gamefilepage.gamefile_struct.name)); + mprintf(0, "Could not load gamefilepage named %s!\n", gamefilepage.gamefile_struct.name); } // Reads a gamefile page from a local table file. It then allocs a gamefile and @@ -324,7 +324,7 @@ void mng_LoadLocalGamefilePage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_GAMEFILE && !stricmp(addon->Addon_tracklocks[tidx].name, gamefilepage.gamefile_struct.name)) { // found it!! - mprintf((0, "GamefilePage: %s previously loaded\n", gamefilepage.gamefile_struct.name)); + mprintf(0, "GamefilePage: %s previously loaded\n", gamefilepage.gamefile_struct.name); need_to_load_page = false; break; } @@ -382,5 +382,5 @@ void mng_LoadLocalGamefilePage(CFILE *infile) { mng_AllocTrackLock(gamefilepage.gamefile_struct.name, PAGETYPE_GAMEFILE); } else - mprintf((0, "Could not load gamefilepage named %s!\n", gamefilepage.gamefile_struct.name)); + mprintf(0, "Could not load gamefilepage named %s!\n", gamefilepage.gamefile_struct.name); } diff --git a/manage/generic.cpp b/manage/generic.cpp index f0814804..8fcb27c3 100644 --- a/manage/generic.cpp +++ b/manage/generic.cpp @@ -1783,7 +1783,7 @@ int mng_FindSpecificGenericPage(char *name, mngs_generic_page *genericpage, int } if (!infile) { - mprintf((0, "Couldn't open table file to find generic!\n")); + mprintf(0, "Couldn't open table file to find generic!\n"); Int3(); return 0; } @@ -1965,7 +1965,7 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE img_handle = LoadPolyModel(genericpage->image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->image_name)); + mprintf(0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->image_name); objinfopointer->render_handle = -1; return 0; } else @@ -1975,7 +1975,7 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE img_handle = LoadPolyModel(genericpage->med_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->med_image_name)); + mprintf(0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->med_image_name); objinfopointer->med_render_handle = -1; return 0; } else @@ -1987,7 +1987,7 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE img_handle = LoadPolyModel(genericpage->lo_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->lo_image_name)); + mprintf(0, "Couldn't load file '%s' in AssignGenericPage...\n", genericpage->lo_image_name); objinfopointer->lo_render_handle = -1; return 0; } else @@ -2001,8 +2001,9 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE int sound_handle = mng_GetGuaranteedSoundPage(genericpage->sound_name[i]); if (sound_handle < 0) { - mprintf((0, "Couldn't load sound file '%s' in AssignPowPage %s...\n", genericpage->sound_name[i], - genericpage->objinfo_struct.name)); + mprintf(0, "Couldn't load sound file '%s' in AssignPowPage %s...\n", + genericpage->sound_name[i], + genericpage->objinfo_struct.name); objinfopointer->sounds[i] = SOUND_NONE_INDEX; } else objinfopointer->sounds[i] = sound_handle; @@ -2035,8 +2036,9 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE int sound_handle = mng_GetGuaranteedSoundPage(genericpage->ai_sound_name[i]); if (sound_handle < 0) { - mprintf((0, "Couldn't load ai sound file '%s' in AssignPowPage %s...\n", genericpage->ai_sound_name[i], - genericpage->objinfo_struct.name)); + mprintf(0, "Couldn't load ai sound file '%s' in AssignPowPage %s...\n", + genericpage->ai_sound_name[i], + genericpage->objinfo_struct.name); objinfopointer->ai_info->sound[i] = SOUND_NONE_INDEX; } else objinfopointer->ai_info->sound[i] = sound_handle; @@ -2053,8 +2055,9 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE int weapon_handle = mng_GetGuaranteedWeaponPage(genericpage->weapon_name[i][j]); if (weapon_handle < 0) { - mprintf((0, "Couldn't load weapon file '%s' in AssignPowPage %s...\n", genericpage->weapon_name[i][j], - genericpage->objinfo_struct.name)); + mprintf(0, "Couldn't load weapon file '%s' in AssignPowPage %s...\n", + genericpage->weapon_name[i][j], + genericpage->objinfo_struct.name); objinfopointer->static_wb[i].gp_weapon_index[j] = LASER_INDEX; } else objinfopointer->static_wb[i].gp_weapon_index[j] = weapon_handle; @@ -2070,8 +2073,9 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE int fire_sound_handle = mng_GetGuaranteedSoundPage(genericpage->fire_sound_name[i][j]); if (fire_sound_handle < 0) { - mprintf((0, "Couldn't load fire sound file '%s' in AssignPowPage %s...\n", - genericpage->fire_sound_name[i][j], genericpage->objinfo_struct.name)); + mprintf(0, "Couldn't load fire sound file '%s' in AssignPowPage %s...\n", + genericpage->fire_sound_name[i][j], + genericpage->objinfo_struct.name); objinfopointer->static_wb[i].fm_fire_sound_index[j] = SOUND_NONE_INDEX; } else objinfopointer->static_wb[i].fm_fire_sound_index[j] = fire_sound_handle; @@ -2089,8 +2093,9 @@ int mng_AssignGenericPageToObjInfo(mngs_generic_page *genericpage, int n, CFILE int anim_sound_handle = mng_GetGuaranteedSoundPage(genericpage->anim_sound_name[i][j]); if (anim_sound_handle < 0) { - mprintf((0, "Couldn't load anim sound file '%s' in AssignPowPage %s...\n", - genericpage->anim_sound_name[i][j], genericpage->objinfo_struct.name)); + mprintf(0, "Couldn't load anim sound file '%s' in AssignPowPage %s...\n", + genericpage->anim_sound_name[i][j], + genericpage->objinfo_struct.name); objinfopointer->anim[i].elem[j].anim_sound_index = SOUND_NONE_INDEX; } else objinfopointer->anim[i].elem[j].anim_sound_index = anim_sound_handle; @@ -2208,7 +2213,7 @@ void mng_LoadNetGenericPage(CFILE *infile, bool overlay) { int n = FindObjectIDName(genericpage.objinfo_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING GENERIC %s\n", genericpage.objinfo_struct.name)); + mprintf(0, "OVERLAYING GENERIC %s\n", genericpage.objinfo_struct.name); mng_FreePagetypePrimitives(PAGETYPE_GENERIC, genericpage.objinfo_struct.name, 0); mng_AssignGenericPageToObjInfo(&genericpage, n); } @@ -2218,7 +2223,7 @@ void mng_LoadNetGenericPage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadGeneric(&genericpage, infile); ASSERT(ret >= 0); } else - mprintf((0, "Could not load genericpage named %s!\n", genericpage.objinfo_struct.name)); + mprintf(0, "Could not load genericpage named %s!\n", genericpage.objinfo_struct.name); } // Reads a generic page from a local table file. It then allocs a generic and @@ -2262,7 +2267,7 @@ void mng_LoadLocalGenericPage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_GENERIC && !stricmp(addon->Addon_tracklocks[tidx].name, genericpage.objinfo_struct.name)) { // found it!! - mprintf((0, "GenericPage: %s previously loaded\n", genericpage.objinfo_struct.name)); + mprintf(0, "GenericPage: %s previously loaded\n", genericpage.objinfo_struct.name); need_to_load_page = false; break; } @@ -2320,7 +2325,7 @@ void mng_LoadLocalGenericPage(CFILE *infile) { mng_AllocTrackLock(genericpage.objinfo_struct.name, PAGETYPE_GENERIC); } else - mprintf((0, "Could not load genericpage named %s!\n", genericpage.objinfo_struct.name)); + mprintf(0, "Could not load genericpage named %s!\n", genericpage.objinfo_struct.name); } // First searches through the object index to see if the object is already diff --git a/manage/manage.cpp b/manage/manage.cpp index b84e3576..acb3e1da 100644 --- a/manage/manage.cpp +++ b/manage/manage.cpp @@ -596,7 +596,7 @@ int mng_InitTableFiles() { #endif } } else { - mprintf((0, "Network is down...\n")); + mprintf(0, "Network is down...\n"); Network_up = 0; } @@ -673,7 +673,7 @@ int mng_LoadTableFiles(int show_progress) { int mng_InitLocalTables() { // Set the local table directory from the base directory strcpy(LocalD3Dir, Base_directory); - mprintf((1, "Local dir:%s\n", LocalD3Dir)); + mprintf(1, "Local dir:%s\n", LocalD3Dir); // Make the CFILE system first look at our local directories. If the goods aren't // found there, try out on the network @@ -726,7 +726,7 @@ int mng_InitNetTables() { Error("D3_DIR environment variable not set."); strcpy(NetD3Dir, dir); - mprintf((1, "Net dir:%s\n", NetD3Dir)); + mprintf(1, "Net dir:%s\n", NetD3Dir); ddio_MakePath(NetModelsDir, NetD3Dir, "data", "models", NULL); ddio_MakePath(NetSoundsDir, NetD3Dir, "data", "sounds", NULL); ddio_MakePath(NetRoomsDir, NetD3Dir, "data", "rooms", NULL); @@ -766,14 +766,14 @@ void mng_CheckToCreateNetTables() { if (errno == ENOENT) { outfile = (CFILE *)cfopen(TableFilename, "wb"); if (!outfile) { - mprintf((0, "Error creating table file! The network must be down...\n")); + mprintf(0, "Error creating table file! The network must be down...\n"); Network_up = 0; } else { mng_WriteNewUnknownPage(outfile); cfclose(outfile); } } else { - mprintf((0, "Error creating table file! The network must be down...\n")); + mprintf(0, "Error creating table file! The network must be down...\n"); Network_up = 0; } } @@ -787,7 +787,7 @@ void mng_CheckToCreateLocalTables() { if (!Network_up) { strcpy(TableFilename, NET_TABLE); - mprintf((0, "table filename = %s\n", TableFilename)); + mprintf(0, "table filename = %s\n", TableFilename); return; } @@ -910,7 +910,7 @@ void mng_BackupTableFile() { } if (!cfexist(str) || cf_Diff(str, TableFilename)) { - mprintf((0, "Making local copy of table file.\n")); + mprintf(0, "Making local copy of table file.\n"); if (!cf_CopyFile(str, TableFilename, 1)) Error("There was an error making a backup copy of the table file.\n"); @@ -918,7 +918,7 @@ void mng_BackupTableFile() { if (!cf_CopyFile(str, TableLockFilename, 1)) Error("There was an error making a backup copy of the locker table file.\n"); } else { - mprintf((0, "Local table file same as network copy.\n")); + mprintf(0, "Local table file same as network copy.\n"); TableTimeThreshold.dwHighDateTime = -1; Fast_load_trick = 1; } @@ -962,7 +962,7 @@ int mng_AllocTrackLock(char *name, int pagetype) { strcpy(GlobalTrackLocks[i].name, name); GlobalTrackLocks[i].pagetype = pagetype; GlobalTrackLocks[i].used = 1; - mprintf((0, "Tracklock %s allocated.\n", name)); + mprintf(0, "Tracklock %s allocated.\n", name); return i; } Error("Couldn't get a free tracklock!"); @@ -970,7 +970,7 @@ int mng_AllocTrackLock(char *name, int pagetype) { } // Frees a tracklock void mng_FreeTrackLock(int n) { - mprintf((0, "Tracklock %s freed.\n", GlobalTrackLocks[n].name)); + mprintf(0, "Tracklock %s freed.\n", GlobalTrackLocks[n].name); GlobalTrackLocks[n].pagetype = PAGETYPE_UNKNOWN; GlobalTrackLocks[n].used = 0; GlobalTrackLocks[n].name[0] = 0; @@ -1125,7 +1125,7 @@ int mng_RenamePage(char *oldname, char *newname, int pagetype) { mngs_Pagelock pl; char oname[PAGENAME_LEN]; - mprintf((0, "Renaming %s to %s...\n", oldname, newname)); + mprintf(0, "Renaming %s to %s...\n", oldname, newname); strcpy(oname, oldname); strcpy(pl.name, oname); pl.pagetype = pagetype; @@ -1243,7 +1243,7 @@ int mng_LoadNetPages(int show_progress) { int int_progress = 0; int len; - mprintf((0, "Loading pages...")); + mprintf(0, "Loading pages..."); if (Dedicated_server) show_progress = 0; // turn off progress meter for dedicated server // If the network is up we still want to read from the local table because it @@ -1259,7 +1259,7 @@ int mng_LoadNetPages(int show_progress) { } else infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file (%s) to read pages!\n", TableFilename)); + mprintf(0, "Couldn't open table file (%s) to read pages!\n", TableFilename); Error("Cannot open table file <%s>", TableFilename); return 0; } @@ -1271,7 +1271,7 @@ int mng_LoadNetPages(int show_progress) { start_time = timer_GetTime(); while (!cfeof(infile)) { // Read in a pagetype. If its a page we recognize, load it - // mprintf ((0,".")); + // mprintf(0,"."); if (show_progress) { current_byte = cftell(infile); @@ -1288,7 +1288,7 @@ int mng_LoadNetPages(int show_progress) { len = cf_ReadInt(infile); switch (pagetype) { case PAGETYPE_TEXTURE: - mprintf((0, "T")); + mprintf(0, "T"); PrintDedicatedMessage("T"); mng_LoadNetTexturePage(infile); @@ -1298,42 +1298,42 @@ int mng_LoadNetPages(int show_progress) { Error("Your local table file is invalid. You must update from the network."); break; case PAGETYPE_DOOR: - mprintf((0, "D")); + mprintf(0, "D"); PrintDedicatedMessage("D"); mng_LoadNetDoorPage(infile); break; case PAGETYPE_GENERIC: - mprintf((0, "G")); + mprintf(0, "G"); PrintDedicatedMessage("G"); mng_LoadNetGenericPage(infile); break; case PAGETYPE_GAMEFILE: - mprintf((0, "F")); + mprintf(0, "F"); PrintDedicatedMessage("F"); mng_LoadNetGamefilePage(infile); break; case PAGETYPE_SOUND: - mprintf((0, "S")); + mprintf(0, "S"); PrintDedicatedMessage("S"); mng_LoadNetSoundPage(infile); break; case PAGETYPE_SHIP: - mprintf((0, "P")); + mprintf(0, "P"); PrintDedicatedMessage("P"); mng_LoadNetShipPage(infile); break; case PAGETYPE_WEAPON: - mprintf((0, "W")); + mprintf(0, "W"); PrintDedicatedMessage("W"); mng_LoadNetWeaponPage(infile); break; case PAGETYPE_MEGACELL: - mprintf((0, "M")); + mprintf(0, "M"); PrintDedicatedMessage("M"); mng_LoadNetMegacellPage(infile); break; case PAGETYPE_UNKNOWN: - mprintf((0, "?")); + mprintf(0, "?"); break; default: Int3(); // Unrecognized pagetype, possible corrupt data following @@ -1342,8 +1342,8 @@ int mng_LoadNetPages(int show_progress) { } n_pages++; } - mprintf((0, "\n%d pages read in %.1f seconds.\n", n_pages, timer_GetTime() - start_time)); - mprintf((0, "\n")); + mprintf(0, "\n%d pages read in %.1f seconds.\n", n_pages, timer_GetTime() - start_time); + mprintf(0, "\n"); PrintDedicatedMessage((0, "\nPage reading completed.\n")); cfclose(infile); @@ -1355,9 +1355,9 @@ int mng_LoadNetPages(int show_progress) { if (!infile) return 1; - mprintf((0, "==================================================\n")); - mprintf((0, " Loading extra.gam \n")); - mprintf((0, "==================================================\n")); + mprintf(0, "==================================================\n"); + mprintf(0, " Loading extra.gam \n"); + mprintf(0, "==================================================\n"); PrintDedicatedMessage("\nLoading extra.gam.....\n"); n_pages = 0; @@ -1368,42 +1368,42 @@ int mng_LoadNetPages(int show_progress) { len = cf_ReadInt(infile); switch (pagetype) { case PAGETYPE_TEXTURE: - mprintf((0, "T")); + mprintf(0, "T"); PrintDedicatedMessage("T"); mng_LoadNetTexturePage(infile, true); break; case PAGETYPE_DOOR: - mprintf((0, "D")); + mprintf(0, "D"); PrintDedicatedMessage("D"); mng_LoadNetDoorPage(infile, true); break; case PAGETYPE_GENERIC: - mprintf((0, "G")); + mprintf(0, "G"); PrintDedicatedMessage("G"); mng_LoadNetGenericPage(infile, true); break; case PAGETYPE_GAMEFILE: - mprintf((0, "F")); + mprintf(0, "F"); PrintDedicatedMessage("F"); mng_LoadNetGamefilePage(infile, true); break; case PAGETYPE_SOUND: - mprintf((0, "S")); + mprintf(0, "S"); PrintDedicatedMessage("S"); mng_LoadNetSoundPage(infile, true); break; case PAGETYPE_SHIP: - mprintf((0, "P")); + mprintf(0, "P"); PrintDedicatedMessage("P"); mng_LoadNetShipPage(infile, true); break; case PAGETYPE_WEAPON: - mprintf((0, "W")); + mprintf(0, "W"); PrintDedicatedMessage("W"); mng_LoadNetWeaponPage(infile, true); break; case PAGETYPE_UNKNOWN: - mprintf((0, "?")); + mprintf(0, "?"); break; default: Int3(); // Unrecognized pagetype, possible corrupt data following @@ -1414,7 +1414,7 @@ int mng_LoadNetPages(int show_progress) { } n_pages++; } - mprintf((0, "\n%d extra pages read.\n", n_pages)); + mprintf(0, "\n%d extra pages read.\n", n_pages); TablefileNameOverride = NULL; cfclose(infile); return 1; @@ -1425,10 +1425,10 @@ int mng_LoadLocalPages() { uint8_t pagetype; int len; - mprintf((0, "Overlaying local pages...")); + mprintf(0, "Overlaying local pages..."); infile = cfopen(LocalTableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open local table file (%s) to read pages!\n", LocalTableFilename)); + mprintf(0, "Couldn't open local table file (%s) to read pages!\n", LocalTableFilename); return 1; } Loading_locals = 1; @@ -1438,7 +1438,7 @@ int mng_LoadLocalPages() { pagetype = cf_ReadByte(infile); if (!Old_table_method) len = cf_ReadInt(infile); - mprintf((0, ".")); + mprintf(0, "."); switch (pagetype) { case PAGETYPE_TEXTURE: mng_LoadLocalTexturePage(infile); @@ -1476,7 +1476,7 @@ int mng_LoadLocalPages() { break; } } - mprintf((0, "\n")); + mprintf(0, "\n"); cfclose(infile); Loading_locals = 0; return 1; @@ -1521,13 +1521,13 @@ void mng_TransferPages() { CFILE *infile, *outfile; int pagetype; int num_tracklocks = 0; - mprintf((0, "Transferring pages, please wait...\n")); + mprintf(0, "Transferring pages, please wait...\n"); if (!mng_MakeLocker()) return; infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file to transfer!\n")); + mprintf(0, "Couldn't open table file to transfer!\n"); Int3(); return; } @@ -1622,7 +1622,7 @@ void mng_TransferPages() { if (found != -1) mng_WritePagelock(outfile, &temp_pl); else { - mprintf((0, "Found unused lock file %s\n", temp_pl.name)); + mprintf(0, "Found unused lock file %s\n", temp_pl.name); } } else @@ -1641,7 +1641,7 @@ void mng_TransferPages() { goto done; } mng_EraseLocker(); - mprintf((0, "Done transferring pages...good luck!\n")); + mprintf(0, "Done transferring pages...good luck!\n"); done:; mem_free(local_tracklocks); } @@ -1678,7 +1678,7 @@ void ReorderPages(int local) { ReorderPagelocks(); return; #endif - mprintf((0, "Reordering pages, please wait...\n")); + mprintf(0, "Reordering pages, please wait...\n"); if (local) infile = cfopen(LocalTableFilename, "rb"); else { @@ -1687,7 +1687,7 @@ void ReorderPages(int local) { infile = cfopen(TableFilename, "rb"); } if (!infile) { - mprintf((0, "Couldn't open table file to reorder!\n")); + mprintf(0, "Couldn't open table file to reorder!\n"); Int3(); return; } @@ -1696,7 +1696,7 @@ void ReorderPages(int local) { else outfile = cfopen(TempTableFilename, "wb"); if (!outfile) { - mprintf((0, "Couldn't open temp table file to reorder!\n")); + mprintf(0, "Couldn't open temp table file to reorder!\n"); cfclose(infile); Int3(); return; @@ -1980,7 +1980,7 @@ void BuildOldFilesForDirectory(char *path, FILETIME threshold) { // Searches through all our netdirectories for old files void BuildOldFileList(FILETIME threshold) { char str[MAX_PATH]; - mprintf((0, "Building old files list!\n")); + mprintf(0, "Building old files list!\n"); BuildOldFilesForDirectory(NetModelsDir, threshold); BuildOldFilesForDirectory(NetSoundsDir, threshold); BuildOldFilesForDirectory(NetMiscDir, threshold); @@ -1994,7 +1994,7 @@ void BuildOldFileList(FILETIME threshold) { BuildOldFilesForDirectory(str, threshold); ddio_MakePath(str, NetD3Dir, "data", "scripts", NULL); BuildOldFilesForDirectory(str, threshold); - mprintf((0, "Found %d old files.\n", Num_old_files)); + mprintf(0, "Found %d old files.\n", Num_old_files); } #endif // Returns true if the passed in primitive is old (ie needs to be updated from the network) @@ -2025,7 +2025,7 @@ void UpdatePrimitive(char *localname, char *netname, char *primname, int pagetyp temp_pl.pagetype = pagetype; strcpy(temp_pl.name, pagename); if (!InLockList(&temp_pl)) { - mprintf((0, "Making a local copy of %s for next time.\n", primname)); + mprintf(0, "Making a local copy of %s for next time.\n", primname); if (!cf_CopyFile(localname, netname, 1)) { Int3(); // get Jason return; @@ -2100,14 +2100,14 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype CFILE *infile, *outfile; uint8_t pagetype, replaced = 0; int done = 0, len; - mprintf((0, "Replacing '%s' with '%s' (%s).\n", srcname, destname, local ? "locally" : "to network")); + mprintf(0, "Replacing '%s' with '%s' (%s).\n", srcname, destname, local ? "locally" : "to network"); if (local) infile = cfopen(LocalTableFilename, "rb"); else infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file to replace page %s!\n", srcname)); + mprintf(0, "Couldn't open table file to replace page %s!\n", srcname); Int3(); return 0; } @@ -2116,7 +2116,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype else outfile = cfopen(TempTableFilename, "wb"); if (!outfile) { - mprintf((0, "Couldn't open temp table file to replace page %s!\n", srcname)); + mprintf(0, "Couldn't open temp table file to replace page %s!\n", srcname); cfclose(infile); Int3(); return 0; @@ -2124,7 +2124,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype // Allocate memory for copying uint8_t *copybuffer = (uint8_t *)mem_malloc(COPYBUFFER_SIZE); if (!copybuffer) { - mprintf((0, "Couldn't allocate memory to replace page %s!\n", srcname)); + mprintf(0, "Couldn't allocate memory to replace page %s!\n", srcname); cfclose(infile); cfclose(outfile); Int3(); @@ -2247,9 +2247,9 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype mng_AssignAndWritePage(handle, dest_pagetype, outfile); } if (replaced) - mprintf((0, "Page replaced.\n")); + mprintf(0, "Page replaced.\n"); else - mprintf((0, "New page added.\n")); + mprintf(0, "New page added.\n"); cfclose(infile); cfclose(outfile); mem_free(copybuffer); @@ -2270,14 +2270,14 @@ int mng_DeletePage(char *name, int dest_pagetype, int local) { int done = 0; int deleted = 0; - mprintf((0, "Deleting %s (%s).\n", name, local ? "locally" : "on network")); + mprintf(0, "Deleting %s (%s).\n", name, local ? "locally" : "on network"); if (local) infile = cfopen(LocalTableFilename, "rb"); else infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file to delete page!\n")); + mprintf(0, "Couldn't open table file to delete page!\n"); Int3(); return 0; } @@ -2286,7 +2286,7 @@ int mng_DeletePage(char *name, int dest_pagetype, int local) { else outfile = cfopen(TempTableFilename, "wb"); if (!outfile) { - mprintf((0, "Couldn't open temp table file to delete page!\n")); + mprintf(0, "Couldn't open temp table file to delete page!\n"); cfclose(infile); Int3(); return 0; @@ -2294,7 +2294,7 @@ int mng_DeletePage(char *name, int dest_pagetype, int local) { // Allocate memory for copying uint8_t *copybuffer = (uint8_t *)mem_malloc(COPYBUFFER_SIZE); if (!copybuffer) { - mprintf((0, "Couldn't allocate memory to delete page!\n")); + mprintf(0, "Couldn't allocate memory to delete page!\n"); cfclose(infile); cfclose(outfile); Int3(); @@ -2399,7 +2399,7 @@ int mng_DeletePage(char *name, int dest_pagetype, int local) { ASSERT(deleted == 1); } else { if (!deleted) { - mprintf((0, "Not found locally?!\n")); + mprintf(0, "Not found locally?!\n"); } } cfclose(infile); @@ -2659,7 +2659,7 @@ void mng_PopAddonPages() { AddOnTablefile *addondata = &AddOnDataTables[Num_addon_tables]; for (i = 0; i < addondata->Num_addon_tracklocks; i++) { - mprintf((0, "Freeing addon page %s [%s].\n", addondata->Addon_tracklocks[i].name, addondata->AddOnTableFilename)); + mprintf(0, "Freeing addon page %s [%s].\n", addondata->Addon_tracklocks[i].name, addondata->AddOnTableFilename); // set the Loading_addon_table to the appropriate value... // it depends on if we are overlaying from a previous tablefile @@ -2825,7 +2825,7 @@ void mng_PushAddonPage(int pagetype, char *name, int overlay) { } } } - mprintf((0, "Adding addon page %s [%s] to list.\n", name, addon->AddOnTableFilename)); + mprintf(0, "Adding addon page %s [%s] to list.\n", name, addon->AddOnTableFilename); addon->Addon_tracklocks[addon->Num_addon_tracklocks].used = 1; addon->Addon_tracklocks[addon->Num_addon_tracklocks].pagetype = pagetype; addon->Addon_tracklocks[addon->Num_addon_tracklocks].overlay = overlay; @@ -2853,10 +2853,10 @@ void mng_CompileAddonPages(void) { // overlay > 1 (from addontable[overlay-2] if (curr_tablefile == 1) { file = cfopen(TableFilename, "rb"); - mprintf((0, "Compiling addon pages of %s\n", TableFilename)); + mprintf(0, "Compiling addon pages of %s\n", TableFilename); } else { file = cfopen(AddOnDataTables[curr_tablefile - 2].AddOnTableFilename, "rb"); - mprintf((0, "Compiling addon pages of %s\n", AddOnDataTables[curr_tablefile - 2].AddOnTableFilename)); + mprintf(0, "Compiling addon pages of %s\n", AddOnDataTables[curr_tablefile - 2].AddOnTableFilename); } ASSERT(file != NULL); @@ -2923,9 +2923,10 @@ void mng_CompileAddonPages(void) { continue; // this is it! - mprintf((0, "***Compiling: %s[%s] to %d\n", AddOnDataTables[tf].Addon_tracklocks[i].name, - (curr_tablefile == 1) ? TableFilename : AddOnDataTables[curr_tablefile - 2].AddOnTableFilename, - page_pos)); + mprintf(0, "***Compiling: %s[%s] to %d\n", + AddOnDataTables[tf].Addon_tracklocks[i].name, + (curr_tablefile == 1) ? TableFilename : AddOnDataTables[curr_tablefile - 2].AddOnTableFilename, + page_pos); ASSERT(AddOnDataTables[tf].Addon_tracklocks[i].stack_filepos == 0); AddOnDataTables[tf].Addon_tracklocks[i].stack_filepos = page_pos; found_page = true; @@ -2972,11 +2973,11 @@ void mng_LoadAddonPages() { for (c = 0; c < Num_addon_tables; c++) { addon = &AddOnDataTables[c]; - mprintf((0, "------------------------------------\nLoading addon pages for %s....\n", addon->AddOnTableFilename)); + mprintf(0, "------------------------------------\nLoading addon pages for %s....\n", addon->AddOnTableFilename); Addon_filename = addon->AddOnTableFilename; infile = cfopen(addon->AddOnTableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't addon table file (%s) to read pages!\n", addon->AddOnTableFilename)); + mprintf(0, "Couldn't addon table file (%s) to read pages!\n", addon->AddOnTableFilename); return; } Loading_addon_table = c; @@ -2985,7 +2986,7 @@ void mng_LoadAddonPages() { pagetype = cf_ReadByte(infile); len = cf_ReadInt(infile); - mprintf((0, ".")); + mprintf(0, "."); switch (pagetype) { case PAGETYPE_TEXTURE: mng_LoadLocalTexturePage(infile); @@ -3022,7 +3023,7 @@ void mng_LoadAddonPages() { break; } } - mprintf((0, "------------------------------------\n")); + mprintf(0, "------------------------------------\n"); cfclose(infile); } @@ -3053,7 +3054,7 @@ void Read256TextureNames () infile=(CFILE *)cfopen (GameArgs[n+1],"rt"); if (!infile) { - mprintf ((0,"Couldn't open 256 file!\n")); + mprintf(0,"Couldn't open 256 file!\n"); return; } diff --git a/manage/megapage.cpp b/manage/megapage.cpp index 218af07a..63ee83a5 100644 --- a/manage/megapage.cpp +++ b/manage/megapage.cpp @@ -202,7 +202,7 @@ int mng_FindSpecificMegacellPage(char *name, mngs_megacell_page *megacellpage, i else infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file to find megacell!\n")); + mprintf(0, "Couldn't open table file to find megacell!\n"); Int3(); return 0; } @@ -294,7 +294,7 @@ void mng_LoadNetMegacellPage(CFILE *infile) { int ret = mng_SetAndLoadMegacell(&megacellpage); ASSERT(ret >= 0); } else - mprintf((0, "Could not load megacellpage named %s!\n", megacellpage.megacell_struct.name)); + mprintf(0, "Could not load megacellpage named %s!\n", megacellpage.megacell_struct.name); } // Reads a megacell page from a local table file. It then allocs a megacell and // loads any images/models associated with that megacell @@ -334,5 +334,5 @@ void mng_LoadLocalMegacellPage(CFILE *infile) { if (Loading_addon_table == -1) mng_AllocTrackLock(megacellpage.megacell_struct.name, PAGETYPE_MEGACELL); } else - mprintf((0, "Could not load megacellpage named %s!\n", megacellpage.megacell_struct.name)); + mprintf(0, "Could not load megacellpage named %s!\n", megacellpage.megacell_struct.name); } diff --git a/manage/pagelock.cpp b/manage/pagelock.cpp index b2b3e687..e92e3974 100644 --- a/manage/pagelock.cpp +++ b/manage/pagelock.cpp @@ -235,7 +235,7 @@ char *mng_CheckIfLockerPresent() { cf_ReadString(lockname, sizeof(lockname), infile); - mprintf((0, "%s has already got exlusive access to the table file.\n", lockname)); + mprintf(0, "%s has already got exlusive access to the table file.\n", lockname); cfclose(infile); @@ -251,7 +251,7 @@ int TableVersionCurrent() { infile = (CFILE *)cfopen(VersionFile, "rb"); if (!infile) { - mprintf((0, "Couldn't open the version file for querying!\n")); + mprintf(0, "Couldn't open the version file for querying!\n"); return 0; } @@ -301,7 +301,7 @@ int mng_MakeLocker() { outfile = (CFILE *)cfopen(LockerFile, "wb"); if (!outfile) { OutrageMessageBox("Error opening the locker file!"); - mprintf((0, "couldn't open the locker file!\n")); + mprintf(0, "couldn't open the locker file!\n"); return 0; } #endif @@ -471,7 +471,7 @@ int mng_ReadPagelock(CFILE *fp, mngs_Pagelock *pl) { pl->holder[PAGELOCK_NAME_LEN] = 0; if (pl->pagetype == PAGETYPE_POWERUP) { - mprintf((0, "Powerup lock: %d, %s, %s\n", pl->pagetype, pl->name, pl->holder)); + mprintf(0, "Powerup lock: %d, %s, %s\n", pl->pagetype, pl->name, pl->holder); } return 1; @@ -556,7 +556,7 @@ int mng_DeletePagelock(char *name, int pagetype) { int done = 0, deleted = 0; mngs_Pagelock temp_pl; - mprintf((0, "Deleting pagelock %s.\n", name)); + mprintf(0, "Deleting pagelock %s.\n", name); infile = (CFILE *)cfopen(TableLockFilename, "rb"); if (!infile) { @@ -631,7 +631,7 @@ int mng_DeletePagelockSeries(char *names[], int num, int pagetype) { if (found == -1) mng_WritePagelock(outfile, &temp_pl); else - mprintf((0, "Deleting pagelock %s.\n", names[found])); + mprintf(0, "Deleting pagelock %s.\n", names[found]); } else mng_WritePagelock(outfile, &temp_pl); @@ -682,7 +682,7 @@ int mng_DeleteDuplicatePagelocks() { int found = -1; for (i = 0; i < num; i++) { if (temp_pl.pagetype == already_read[i].pagetype && !stricmp(temp_pl.name, already_read[i].name)) { - mprintf((0, "Found duplicated %s\n", temp_pl.name)); + mprintf(0, "Found duplicated %s\n", temp_pl.name); found = i; duplicates++; } @@ -701,7 +701,7 @@ int mng_DeleteDuplicatePagelocks() { } cfclose(infile); - mprintf((0, "Found %d duplicates!\n", duplicates)); + mprintf(0, "Found %d duplicates!\n", duplicates); /* cfclose (outfile); if (remove (TableLockFilename)) @@ -757,9 +757,9 @@ int mng_UnlockPagelockSeries(const char *names[], int *pagetypes, int num) { else { if (pagetypes[found] == temp_pl.pagetype) { if (already_done[found]) { - mprintf((0, "Found duplicate=%s\n", names[found])); + mprintf(0, "Found duplicate=%s\n", names[found]); } else { - mprintf((0, "Replacing pagelock %s to UNLOCKED.\n", names[found])); + mprintf(0, "Replacing pagelock %s to UNLOCKED.\n", names[found]); strcpy(temp_pl.holder, "UNLOCKED"); mng_WritePagelock(outfile, &temp_pl); total++; @@ -776,7 +776,7 @@ int mng_UnlockPagelockSeries(const char *names[], int *pagetypes, int num) { cfclose(infile); cfclose(outfile); - mprintf((0, "Unlocked %d pages\n", total)); + mprintf(0, "Unlocked %d pages\n", total); if (remove(TableLockFilename)) { snprintf(ErrorString, sizeof(ErrorString), "There was a problem deleting the temp file - errno %d", errno); diff --git a/manage/shippage.cpp b/manage/shippage.cpp index da30c6a2..b57f8cc8 100644 --- a/manage/shippage.cpp +++ b/manage/shippage.cpp @@ -865,7 +865,7 @@ int mng_FindSpecificShipPage(char *name, mngs_ship_page *shippage, int offset) { } if (!infile) { - mprintf((0, "Couldn't open table file to find ship!\n")); + mprintf(0, "Couldn't open table file to find ship!\n"); Int3(); return 0; } @@ -979,7 +979,7 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { img_handle = LoadPolyModel(shippage->image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->image_name)); + mprintf(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->image_name); shippointer->model_handle = -1; return 0; } else @@ -989,7 +989,7 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { img_handle = LoadPolyModel(shippage->dying_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->dying_image_name)); + mprintf(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->dying_image_name); shippointer->dying_model_handle = -1; return 0; } else @@ -1002,7 +1002,7 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { img_handle = LoadPolyModel(shippage->med_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->med_image_name)); + mprintf(0, "Couldn't load file '%s' in AssignShipPage...\n", shippage->med_image_name); shippointer->med_render_handle = -1; return 0; } else @@ -1014,7 +1014,7 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { img_handle = LoadPolyModel(shippage->lo_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignGenericPage...\n", shippage->lo_image_name)); + mprintf(0, "Couldn't load file '%s' in AssignGenericPage...\n", shippage->lo_image_name); shippointer->lo_render_handle = -1; return 0; } else @@ -1029,8 +1029,9 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { int weapon_handle = mng_GetGuaranteedWeaponPage(shippage->weapon_name[i][j], infile); if (weapon_handle < 0) { - mprintf((0, "Couldn't load weapon file '%s' in AssignPowPage %s...\n", shippage->weapon_name[i][j], - shippage->ship_struct.name)); + mprintf(0, "Couldn't load weapon file '%s' in AssignPowPage %s...\n", + shippage->weapon_name[i][j], + shippage->ship_struct.name); shippointer->static_wb[i].gp_weapon_index[j] = LASER_INDEX; } else shippointer->static_wb[i].gp_weapon_index[j] = weapon_handle; @@ -1046,8 +1047,9 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { int fire_sound_handle = mng_GetGuaranteedSoundPage(shippage->fire_sound_name[i][j], infile); if (fire_sound_handle < 0) { - mprintf((0, "Couldn't load fire_sound file '%s' in AssignPowPage %s...\n", shippage->fire_sound_name[i][j], - shippage->ship_struct.name)); + mprintf(0, "Couldn't load fire_sound file '%s' in AssignPowPage %s...\n", + shippage->fire_sound_name[i][j], + shippage->ship_struct.name); shippointer->static_wb[i].fm_fire_sound_index[j] = SOUND_NONE_INDEX; } else shippointer->static_wb[i].fm_fire_sound_index[j] = fire_sound_handle; @@ -1061,8 +1063,9 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { int sound_handle = mng_GetGuaranteedSoundPage(shippage->firing_sound_name[i], infile); if (sound_handle < 0) { - mprintf((0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", shippage->firing_sound_name[i], - shippage->ship_struct.name)); + mprintf(0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", + shippage->firing_sound_name[i], + shippage->ship_struct.name); shippointer->firing_sound[i] = SOUND_NONE_INDEX; } else shippointer->firing_sound[i] = sound_handle; @@ -1073,8 +1076,9 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { int sound_handle = mng_GetGuaranteedSoundPage(shippage->release_sound_name[i], infile); if (sound_handle < 0) { - mprintf((0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", shippage->release_sound_name[i], - shippage->ship_struct.name)); + mprintf(0, "Couldn't load firing_sound file '%s' in AssignPowPage %s...\n", + shippage->release_sound_name[i], + shippage->ship_struct.name); shippointer->firing_release_sound[i] = SOUND_NONE_INDEX; } else shippointer->firing_release_sound[i] = sound_handle; @@ -1085,7 +1089,7 @@ int mng_AssignShipPageToShip(mngs_ship_page *shippage, int n, CFILE *infile) { shippointer->spew_powerup[i] = mng_GetGuaranteedGenericPage(shippage->spew_powerup_name[i], infile); if (shippointer->spew_powerup[i] > -1 && Object_info[shippointer->spew_powerup[i]].type != OBJ_POWERUP) { // DAJ -1FIX - mprintf((1, "Spew powerup is not a powerup! Setting to none.\n")); + mprintf(1, "Spew powerup is not a powerup! Setting to none.\n"); shippointer->spew_powerup[i] = -1; } } else @@ -1157,7 +1161,7 @@ void mng_AssignShipToShipPage(int n, mngs_ship_page *shippage) { if (shippointer->spew_powerup[i] != -1) { if (Object_info[shippointer->spew_powerup[i]].type != OBJ_POWERUP) { - mprintf((1, "Spew powerup is not a powerup! Setting to none.\n")); + mprintf(1, "Spew powerup is not a powerup! Setting to none.\n"); shippage->spew_powerup_name[i][0] = 0; } else strcpy(shippage->spew_powerup_name[i], Object_info[shippointer->spew_powerup[i]].name); @@ -1179,7 +1183,7 @@ void mng_LoadNetShipPage(CFILE *infile, bool overlay) { int n = FindShipName(shippage.ship_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING SHIP %s\n", shippage.ship_struct.name)); + mprintf(0, "OVERLAYING SHIP %s\n", shippage.ship_struct.name); mng_FreePagetypePrimitives(PAGETYPE_SHIP, shippage.ship_struct.name, 0); mng_AssignShipPageToShip(&shippage, n); } @@ -1188,7 +1192,7 @@ void mng_LoadNetShipPage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadShip(&shippage, infile); ASSERT(ret >= 0); } else - mprintf((0, "Could not load shippage named %s!\n", shippage.ship_struct.name)); + mprintf(0, "Could not load shippage named %s!\n", shippage.ship_struct.name); } // Reads a ship page from a local table file. It then allocs a ship and @@ -1233,7 +1237,7 @@ void mng_LoadLocalShipPage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_SHIP && !stricmp(addon->Addon_tracklocks[tidx].name, shippage.ship_struct.name)) { // found it!! - mprintf((0, "ShipPage: %s previously loaded\n", shippage.ship_struct.name)); + mprintf(0, "ShipPage: %s previously loaded\n", shippage.ship_struct.name); need_to_load_page = false; break; } @@ -1301,5 +1305,5 @@ void mng_LoadLocalShipPage(CFILE *infile) { } } else - mprintf((0, "Could not load shippage named %s!\n", shippage.ship_struct.name)); + mprintf(0, "Could not load shippage named %s!\n", shippage.ship_struct.name); } diff --git a/manage/soundpage.cpp b/manage/soundpage.cpp index c434b8fb..2f5c9256 100644 --- a/manage/soundpage.cpp +++ b/manage/soundpage.cpp @@ -345,7 +345,7 @@ int mng_FindSpecificSoundPage(char *name, mngs_sound_page *soundpage, int offset } } if (!infile) { - mprintf((0, "Couldn't open table file to find sound!\n")); + mprintf(0, "Couldn't open table file to find sound!\n"); Int3(); return 0; } @@ -415,7 +415,7 @@ int mng_AssignSoundPageToSound(mngs_sound_page *soundpage, int n) { // Try and load our sound raw from the disk raw_handle = LoadSoundFile(soundpage->raw_name, Sounds[n].import_volume, false); if (raw_handle < 0) { - mprintf((0, "Couldn't load file '%s' in AssignSoundPage...\n", soundpage->raw_name)); + mprintf(0, "Couldn't load file '%s' in AssignSoundPage...\n", soundpage->raw_name); soundpointer->sample_index = -1; return 0; } else @@ -445,7 +445,7 @@ void mng_LoadNetSoundPage(CFILE *infile, bool overlay) { int n = FindSoundName(soundpage.sound_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING SOUND %s\n", soundpage.sound_struct.name)); + mprintf(0, "OVERLAYING SOUND %s\n", soundpage.sound_struct.name); mng_FreePagetypePrimitives(PAGETYPE_SOUND, soundpage.sound_struct.name, 0); mng_AssignSoundPageToSound(&soundpage, n); } @@ -454,7 +454,7 @@ void mng_LoadNetSoundPage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadSound(&soundpage); ASSERT(ret >= 0); } else - mprintf((0, "Could not load soundpage named %s!\n", soundpage.sound_struct.name)); + mprintf(0, "Could not load soundpage named %s!\n", soundpage.sound_struct.name); } // Reads a sound page from a local table file. It then allocs a sound and // loads any raws associated with that sound @@ -495,7 +495,7 @@ void mng_LoadLocalSoundPage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_SOUND && !stricmp(addon->Addon_tracklocks[tidx].name, soundpage.sound_struct.name)) { // found it!! - mprintf((0, "SoundPage: %s previously loaded\n", soundpage.sound_struct.name)); + mprintf(0, "SoundPage: %s previously loaded\n", soundpage.sound_struct.name); need_to_load_page = false; break; } @@ -552,7 +552,7 @@ void mng_LoadLocalSoundPage(CFILE *infile) { if (Loading_addon_table == -1) mng_AllocTrackLock(soundpage.sound_struct.name, PAGETYPE_SOUND); } else - mprintf((0, "Could not load soundpage named %s!\n", soundpage.sound_struct.name)); + mprintf(0, "Could not load soundpage named %s!\n", soundpage.sound_struct.name); } // First searches through the sound index to see if the sound is already // loaded. If not, searches in the table file and loads it. diff --git a/manage/texpage.cpp b/manage/texpage.cpp index e2f3016f..f65b34a9 100644 --- a/manage/texpage.cpp +++ b/manage/texpage.cpp @@ -710,7 +710,7 @@ int mng_ReadNewTexturePage(CFILE *infile, mngs_texture_page *texpage) { texpage->num_proc_elements = cf_ReadShort(infile); if (texpage->num_proc_elements > MAX_PROC_ELEMENTS) { - mprintf((0, "Warning! Too many procedural elements!\n")); + mprintf(0, "Warning! Too many procedural elements!\n"); Int3(); } @@ -771,7 +771,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { infile = cfopen(TableFilename, "rb"); if (!infile) { - mprintf((0, "Couldn't open table file to delete texture!\n")); + mprintf(0, "Couldn't open table file to delete texture!\n"); Int3(); return 0; } @@ -782,7 +782,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { outfile = cfopen(TempTableFilename, "wb"); if (!outfile) { - mprintf((0, "Couldn't open temp table file to delete texture!\n")); + mprintf(0, "Couldn't open temp table file to delete texture!\n"); cfclose(infile); Int3(); return 0; @@ -815,7 +815,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { { mng_WriteNewTexturePage(outfile, &texpage1); } else - mprintf((0, "Deleting %s (%s).\n", names[found], local ? "locally" : "on network")); + mprintf(0, "Deleting %s (%s).\n", names[found], local ? "locally" : "on network"); } cfclose(infile); @@ -869,7 +869,7 @@ int mng_FindSpecificTexPage(char *name, mngs_texture_page *texpage, int offset) } if (!infile) { - mprintf((0, "Couldn't open table file to find texture!\n")); + mprintf(0, "Couldn't open table file to find texture!\n"); Int3(); return 0; } @@ -972,7 +972,7 @@ int mng_AssignTexPageToTexture(mngs_texture_page *texpage, int n, CFILE *infile) { tex->flags&=~(TF_TEXTURE_64|TF_TEXTURE_32); tex->flags|=TF_TEXTURE_256; - mprintf ((0,"Found 256...%s\n",tex->name)); + mprintf(0,"Found 256...%s\n",tex->name); int len=strlen (texpage->bitmap_name); texpage->bitmap_name[len-3]='t'; texpage->bitmap_name[len-2]='g'; @@ -993,7 +993,7 @@ int mng_AssignTexPageToTexture(mngs_texture_page *texpage, int n, CFILE *infile) bm_handle = LoadTextureImage(texpage->bitmap_name, NULL, NORMAL_TEXTURE, mipped, pageable); if (bm_handle < 0) { - mprintf((0, "Couldn't load bitmap '%s' in AssignTexPage...\n", texpage->bitmap_name)); + mprintf(0, "Couldn't load bitmap '%s' in AssignTexPage...\n", texpage->bitmap_name); tex->bm_handle = 0; return 0; } else @@ -1125,7 +1125,7 @@ void mng_LoadNetTexturePage(CFILE *infile, bool overlay) { n = FindTextureName(texpage1.tex_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING TEXTURE %s\n", texpage1.tex_struct.name)); + mprintf(0, "OVERLAYING TEXTURE %s\n", texpage1.tex_struct.name); mng_FreePagetypePrimitives(PAGETYPE_TEXTURE, texpage1.tex_struct.name, 0); mng_AssignTexPageToTexture(&texpage1, n); } @@ -1135,7 +1135,7 @@ void mng_LoadNetTexturePage(CFILE *infile, bool overlay) { int ret = mng_SetAndLoadTexture(&texpage1, infile); ASSERT(ret >= 0); } else - mprintf((0, "Could not load texpage named %s!\n", texpage1.tex_struct.name)); + mprintf(0, "Could not load texpage named %s!\n", texpage1.tex_struct.name); } // Loads in a texture page from a file, superseding any texture with that name @@ -1176,7 +1176,7 @@ void mng_LoadLocalTexturePage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_TEXTURE && !stricmp(addon->Addon_tracklocks[tidx].name, texpage1.tex_struct.name)) { // found it!! - mprintf((0, "TexturePage: %s previously loaded\n", texpage1.tex_struct.name)); + mprintf(0, "TexturePage: %s previously loaded\n", texpage1.tex_struct.name); need_to_load_page = false; break; } @@ -1236,7 +1236,7 @@ void mng_LoadLocalTexturePage(CFILE *infile) { mng_AllocTrackLock(texpage1.tex_struct.name, PAGETYPE_TEXTURE); } else - mprintf((0, "Could not load texpage named %s!\n", texpage1.tex_struct.name)); + mprintf(0, "Could not load texpage named %s!\n", texpage1.tex_struct.name); } #include "mem.h" diff --git a/manage/weaponpage.cpp b/manage/weaponpage.cpp index c3c52e8b..c2190f5b 100644 --- a/manage/weaponpage.cpp +++ b/manage/weaponpage.cpp @@ -752,7 +752,7 @@ void mng_WriteNewWeaponPage(CFILE *outfile, mngs_weapon_page *weaponpage) { #ifdef OEM void DoOEMNapalmBarrelHack(mngs_weapon_page *weaponpage) { if (!strcmp(weaponpage->weapon_struct.name, "NapalmBarrelPart2")) { - mprintf((0, "BASHING NAPALMBARRELPART2!!!!!!\n")); + mprintf(0, "BASHING NAPALMBARRELPART2!!!!!!\n"); weaponpage->weapon_struct.flags |= (WF_SATURATE | WF_NO_ROTATE | WF_CUSTOM_SIZE | WF_NAPALM); weaponpage->weapon_struct.custom_size = 6.0f; weaponpage->weapon_struct.phys_info.mass = 0.6f; @@ -764,7 +764,7 @@ void DoOEMNapalmBarrelHack(mngs_weapon_page *weaponpage) { weaponpage->weapon_struct.phys_info.velocity.z = 50.0f; } else { - mprintf((0, "BASHING NAPALMBARREL!!!!!!\n")); + mprintf(0, "BASHING NAPALMBARREL!!!!!!\n"); weaponpage->weapon_struct.flags |= (WF_INVISIBLE | WF_CUSTOM_SIZE | WF_NAPALM); weaponpage->weapon_struct.custom_size = 1.0f; weaponpage->weapon_struct.phys_info.flags |= PF_USES_PARENT_VELOCITY; @@ -1190,7 +1190,7 @@ int mng_FindSpecificWeaponPage(char *name, mngs_weapon_page *weaponpage) { } if (!infile) { - mprintf((0, "Couldn't open table file to find weapon!\n")); + mprintf(0, "Couldn't open table file to find weapon!\n"); Int3(); return 0; } @@ -1267,7 +1267,7 @@ int mng_FindSpecificWeaponPage(char *name, mngs_weapon_page *weaponpage, int off } if (!infile) { - mprintf((0, "Couldn't open table file to find weapon!\n")); + mprintf(0, "Couldn't open table file to find weapon!\n"); Int3(); return 0; } @@ -1406,7 +1406,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = bm_AllocLoadFileBitmap(weaponpage->hud_image_name, 0); if (img_handle < 0) { - mprintf((0, "Couldn't load bitmap '%s' in AssignWeaponPage...\n", weaponpage->hud_image_name)); + mprintf(0, "Couldn't load bitmap '%s' in AssignWeaponPage...\n", weaponpage->hud_image_name); weaponpointer->hud_image_handle = -1; Weapon_error = "Can't load HUD image"; Weapon_error_filename = weaponpage->hud_image_name; @@ -1422,7 +1422,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = LoadPolyModel(weaponpage->fire_image_name, 1); if (img_handle < 0) { - mprintf((0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->fire_image_name)); + mprintf(0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->fire_image_name); weaponpointer->fire_image_handle = -1; Weapon_error = "Can't load fire image"; Weapon_error_filename = weaponpage->fire_image_name; @@ -1444,7 +1444,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedTexturePage(weaponpage->explode_image_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->explode_image_name)); + mprintf(0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->explode_image_name); weaponpointer->explode_image_handle = -1; } else weaponpointer->explode_image_handle = img_handle; @@ -1456,7 +1456,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedTexturePage(weaponpage->particle_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->particle_name)); + mprintf(0, "Couldn't load bitmap/model '%s' in AssignWeaponPage...\n", weaponpage->particle_name); weaponpointer->particle_handle = -1; } else weaponpointer->particle_handle = img_handle; @@ -1468,7 +1468,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedWeaponPage(weaponpage->spawn_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->spawn_name)); + mprintf(0, "Couldn't load spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->spawn_name); weaponpointer->spawn_handle = -1; } else weaponpointer->spawn_handle = img_handle; @@ -1479,8 +1479,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedWeaponPage(weaponpage->alternate_spawn_name, infile); if (img_handle < 0) { - mprintf( - (0, "Couldn't load alternate spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->alternate_spawn_name)); + mprintf(0, "Couldn't load alternate spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->alternate_spawn_name); weaponpointer->alternate_spawn_handle = -1; } else weaponpointer->alternate_spawn_handle = img_handle; @@ -1492,7 +1491,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedGenericPage(weaponpage->robot_spawn_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load robot spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->robot_spawn_name)); + mprintf(0, "Couldn't load robot spawn weapon '%s' in AssignWeaponPage...\n", weaponpage->robot_spawn_name); weaponpointer->robot_spawn_handle = -1; } else weaponpointer->robot_spawn_handle = img_handle; @@ -1504,7 +1503,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedTexturePage(weaponpage->smoke_image_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load smoke trail file '%s' in AssignWeaponPage...\n", weaponpage->smoke_image_name)); + mprintf(0, "Couldn't load smoke trail file '%s' in AssignWeaponPage...\n", weaponpage->smoke_image_name); weaponpointer->flags &= ~WF_SMOKE; weaponpointer->smoke_handle = -1; @@ -1520,7 +1519,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedTexturePage(weaponpage->scorch_image_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load scorch file '%s' in AssignWeaponPage...\n", weaponpage->scorch_image_name)); + mprintf(0, "Couldn't load scorch file '%s' in AssignWeaponPage...\n", weaponpage->scorch_image_name); weaponpointer->scorch_handle = -1; } else @@ -1534,7 +1533,7 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf img_handle = mng_GetGuaranteedTexturePage(weaponpage->icon_name, infile); if (img_handle < 0) { - mprintf((0, "Couldn't load icon file '%s' in AssignWeaponPage...\n", weaponpage->icon_name)); + mprintf(0, "Couldn't load icon file '%s' in AssignWeaponPage...\n", weaponpage->icon_name); weaponpointer->icon_handle = -1; } else @@ -1549,8 +1548,9 @@ int mng_AssignWeaponPageToWeapon(mngs_weapon_page *weaponpage, int n, CFILE *inf sound_handle = mng_GetGuaranteedSoundPage(weaponpage->sound_name[i]); if (sound_handle < 0) { - mprintf((0, "Couldn't load sound file '%s' in AssignWeaponPage. Weapon=%s\n", weaponpage->sound_name[i], - weaponpage->weapon_struct.name)); + mprintf(0, "Couldn't load sound file '%s' in AssignWeaponPage. Weapon=%s\n", + weaponpage->sound_name[i], + weaponpage->weapon_struct.name); weaponpointer->sounds[i] = SOUND_NONE_INDEX; } else weaponpointer->sounds[i] = sound_handle; @@ -1655,18 +1655,18 @@ void mng_LoadNetWeaponPage(CFILE *infile, bool overlay) { int n = FindWeaponName(weaponpage.weapon_struct.name); if (n != -1) { if (overlay) { - mprintf((0, "OVERLAYING WEAPON %s\n", weaponpage.weapon_struct.name)); + mprintf(0, "OVERLAYING WEAPON %s\n", weaponpage.weapon_struct.name); mng_FreePagetypePrimitives(PAGETYPE_WEAPON, weaponpage.weapon_struct.name, 0); mng_AssignWeaponPageToWeapon(&weaponpage, n); } - // mprintf ((0,"Found weapon dependency! You probably should reorder the netpages.\n")); + // mprintf(0,"Found weapon dependency! You probably should reorder the netpages.\n"); return; } int ret = mng_SetAndLoadWeapon(&weaponpage, infile); ASSERT(ret >= 0); } else - mprintf((0, "Could not load weaponpage named %s!\n", weaponpage.weapon_struct.name)); + mprintf(0, "Could not load weaponpage named %s!\n", weaponpage.weapon_struct.name); } // Reads a weapon page from a local table file. It then allocs a weapon and @@ -1709,7 +1709,7 @@ void mng_LoadLocalWeaponPage(CFILE *infile) { if (addon->Addon_tracklocks[tidx].pagetype == PAGETYPE_WEAPON && !stricmp(addon->Addon_tracklocks[tidx].name, weaponpage.weapon_struct.name)) { // found it!! - mprintf((0, "WeaponPage: %s previously loaded\n", weaponpage.weapon_struct.name)); + mprintf(0, "WeaponPage: %s previously loaded\n", weaponpage.weapon_struct.name); need_to_load_page = false; break; } @@ -1770,5 +1770,5 @@ void mng_LoadLocalWeaponPage(CFILE *infile) { mng_AllocTrackLock(weaponpage.weapon_struct.name, PAGETYPE_WEAPON); } else - mprintf((0, "Could not load weaponpage named %s!\n", weaponpage.weapon_struct.name)); + mprintf(0, "Could not load weaponpage named %s!\n", weaponpage.weapon_struct.name); } diff --git a/mem/mem.cpp b/mem/mem.cpp index 21cf6bd3..6bab9420 100644 --- a/mem/mem.cpp +++ b/mem/mem.cpp @@ -259,7 +259,7 @@ int mem_GetTotalMemoryUsed(void) { return LnxTotalMemUsed; } void *mem_malloc_sub(int size, const char *file, int line) { void *new_mem = malloc(size); if (!new_mem) { - mprintf((0, "Out of memory allocating %d bytes: line %d in %s\n", size, line, file)); + mprintf(0, "Out of memory allocating %d bytes: line %d in %s\n", size, line, file); Int3(); return NULL; } @@ -277,13 +277,13 @@ void mem_free_sub(void *memblock) { } } void mem_error_msg(const char *file, int line, int size) { - mprintf((0, "Memory error (size=%d) line %d in %s\n", size, line, file)); + mprintf(0, "Memory error (size=%d) line %d in %s\n", size, line, file); Int3(); } char *mem_strdup_sub(const char *string, const char *file, int line) { char *ret = strdup(string); if (!ret) { - mprintf((0, "Out of memory allocating %d bytes: line %d in %s\n", strlen(string) + 1, line, file)); + mprintf(0, "Out of memory allocating %d bytes: line %d in %s\n", strlen(string) + 1, line, file); Int3(); return NULL; } @@ -382,16 +382,16 @@ void mem_Init() { GlobalMemoryStatus(&ms); Heap = HeapCreate(HEAP_NO_SERIALIZE, 16000000, 0); // GetProcessHeap(); if (!Heap) { - mprintf((0, "Unable to create memory heap! error: %d\n", GetLastError())); + mprintf(0, "Unable to create memory heap! error: %d\n", GetLastError()); Error("Unable to create memory heap; your system may not have enough memory to run."); } ASSERT(Heap); HeapCompact(Heap, 0); - mprintf((0, "System Memory Status:\n")); - mprintf((0, "Percent of memory in use: %d\n", ms.dwMemoryLoad)); - mprintf((0, "Bytes of physical memory : %d\n", ms.dwTotalPhys)); - mprintf((0, "Free physical memory bytes : %d\n", ms.dwAvailPhys)); - mprintf((0, "Available virtual memory : %d\n", ms.dwAvailPageFile)); + mprintf(0, "System Memory Status:\n"); + mprintf(0, "Percent of memory in use: %d\n", ms.dwMemoryLoad); + mprintf(0, "Bytes of physical memory : %d\n", ms.dwTotalPhys); + mprintf(0, "Free physical memory bytes : %d\n", ms.dwAvailPhys); + mprintf(0, "Available virtual memory : %d\n", ms.dwAvailPageFile); // See if there is enough memory to run if (((int64_t)ms.dwAvailPageFile + ms.dwAvailPhys) < (50 * 1024 * 1024)) { @@ -401,11 +401,11 @@ void mem_Init() { ms.dwTotalPhys, ms.dwAvailPhys, ms.dwAvailPageFile); return; } else if ((ms.dwTotalPhys) < (62 * 1024 * 1024)) { - mprintf((0, "Using low memory mode!\n")); + mprintf(0, "Using low memory mode!\n"); Mem_low_memory_mode = true; return; } else if ((ms.dwTotalPhys) < (46 * 1024 * 1024)) { - mprintf((0, "Using super low memory mode!\n")); + mprintf(0, "Using super low memory mode!\n"); Mem_low_memory_mode = true; Mem_superlow_memory_mode = true; return; @@ -465,12 +465,12 @@ void *mem_malloc_sub(int size, const char *file, int line) { } #endif if (size < 0) { - mprintf((0, "Some bozo is trying to allocate a negative length of memory!\n")); - mprintf((0, "Offending file: %s line: %d\n", file, line)); + mprintf(0, "Some bozo is trying to allocate a negative length of memory!\n"); + mprintf(0, "Offending file: %s line: %d\n", file, line); Int3(); return NULL; } else if (size == 0) { - mprintf((0, "Warning: Zero byte malloc in %s line %d!\n", file, line)); + mprintf(0, "Warning: Zero byte malloc in %s line %d!\n", file, line); Int3(); return (void *)MEM_NO_MEMORY_PTR; } @@ -506,7 +506,7 @@ void *mem_malloc_sub(int size, const char *file, int line) { if (bail_now == false) { track_node = false; #ifdef MEM_DEBUG - mprintf((0, "Out of memory tracking slots!!!!\n")); + mprintf(0, "Out of memory tracking slots!!!!\n"); #endif } bail_now = true; @@ -533,7 +533,7 @@ void *mem_malloc_sub(int size, const char *file, int line) { int errors; if (mi->ptr == NULL) { errors = GetLastError(); - mprintf((0, "Unable to alloc memory in mem_malloc_sub()!\n")); + mprintf(0, "Unable to alloc memory in mem_malloc_sub()!\n"); Int3(); ASSERT(mi->ptr); Error("Out of memory, unable to continue."); @@ -585,7 +585,7 @@ void mem_free_sub(void *memblock) { uint16_t mem_sig = MEM_GAURDIAN_SIG; if (memcmp((char *)memblock + freemem->len, &mem_sig, 2) != 0) { // Corrupted memory found when we went to free it. - mprintf((0, "Memory block found to be damaged when it was freed!\n")); + mprintf(0, "Memory block found to be damaged when it was freed!\n"); Int3(); } Total_mem_used -= freemem->len; @@ -593,7 +593,7 @@ void mem_free_sub(void *memblock) { deleteNode(mynode->data); return; } else { - mprintf((0, "Warning, hash lookup of memory block failed!\n")); + mprintf(0, "Warning, hash lookup of memory block failed!\n"); HeapFree(Heap, HEAP_NO_SERIALIZE, memblock); return; } @@ -680,7 +680,7 @@ MemClass::~MemClass() { mem_shutdown(); } // memory routines void mem_shutdown() { // free failsafe memory block. - mprintf((0, "Shutting down memory system.\n")); + mprintf(0, "Shutting down memory system.\n"); if (Mem_failsafe_block) { mem_free(Mem_failsafe_block); Mem_failsafe_block = NULL; @@ -688,26 +688,26 @@ void mem_shutdown() { #ifdef MEM_DEBUG free(hashTable); if (Total_mem_used) - mprintf((0, "%d bytes leaked in mem_malloc heap!\n", Total_mem_used)); + mprintf(0, "%d bytes leaked in mem_malloc heap!\n", Total_mem_used); #ifdef MEM_LOGFILE fclose(mem_out); #endif - mprintf((0, "Looking for memory leaks.\n")); + mprintf(0, "Looking for memory leaks.\n"); for (int i = 0; i < MEM_MAX_MALLOCS; i++) { if (mem_info[i].ptr != (void *)MEM_NO_MEMORY_PTR) { - mprintf((0, "Memory leaked from %s line %d length %d.\n", mem_info[i].file, mem_info[i].line, mem_info[i].len)); + mprintf(0, "Memory leaked from %s line %d length %d.\n", mem_info[i].file, mem_info[i].line, mem_info[i].len); /* - //mprintf((0,"%d\n",strdup_malloc_line)); + //mprintf(0,"%d\n",strdup_malloc_line); if( (strcmp(mem_info[i].file,"main\\mem\\mem.cpp")==0) && (mem_info[i].line==(strdup_malloc_line+1)) ) { - mprintf((0,"Memory leak from mem_strdup() (%s)\n",mem_info[i].ptr)); + mprintf(0,"Memory leak from mem_strdup() (%s)\n",mem_info[i].ptr); } */ } } - mprintf((0, "Done looking for memory leaks.\n")); - mprintf((0, "Memory library high water mark: %d\n", Mem_high_water_mark)); + mprintf(0, "Done looking for memory leaks.\n"); + mprintf(0, "Memory library high water mark: %d\n", Mem_high_water_mark); Mem_next_slot = 0; #endif if (Heap) { @@ -853,8 +853,8 @@ void mem_heapcheck(void) { freemem = &mem_info[i]; uint16_t mem_sig = MEM_GAURDIAN_SIG; if (memcmp((char *)freemem->ptr + freemem->len, &mem_sig, 2) != 0) { - mprintf((0, "Memory block found to be damaged in mem_heapcheck()!\n")); - mprintf((0, "Originally allocated from file %s, line %d\n", freemem->file, freemem->line)); + mprintf(0, "Memory block found to be damaged in mem_heapcheck()!\n"); + mprintf(0, "Originally allocated from file %s, line %d\n", freemem->file, freemem->line); Int3(); } } diff --git a/misc/error.cpp b/misc/error.cpp index eecef2da..eedf5150 100644 --- a/misc/error.cpp +++ b/misc/error.cpp @@ -129,7 +129,7 @@ void Error(const char *fmt, ...) { va_end(arglist); snprintf(Exit_title_str, sizeof(Exit_title_str), "%s Error", App_title); - mprintf((0, "%s\n", Exit_message)); + mprintf(0, "%s\n", Exit_message); #ifdef _DEBUG int answer; diff --git a/model/polymodel.cpp b/model/polymodel.cpp index e32b7a1d..799eadab 100644 --- a/model/polymodel.cpp +++ b/model/polymodel.cpp @@ -961,7 +961,7 @@ int ReloadModelTextures(int modelnum) { ret = FindTextureName(name_buf); if (ret == -1) { ret = 0; - // mprintf ((0,"Object texture %s is not in memory!\n",name_buf)); + // mprintf(0,"Object texture %s is not in memory!\n",name_buf); } } @@ -1295,12 +1295,12 @@ int ReadNewModelFile(int polynum, CFILE *infile) { version = cf_ReadInt(infile); if (version < 18) { - mprintf((0, "Old POF Version of %d fixed up to %d\n", version, version * 100)); + mprintf(0, "Old POF Version of %d fixed up to %d\n", version, version * 100); version *= 100; } if (version < PM_COMPATIBLE_VERSION || version > PM_OBJFILE_VERSION) { - mprintf((0, "Bad version (%d) in model file!\n", version)); + mprintf(0, "Bad version (%d) in model file!\n", version); Int3(); return 0; } @@ -1334,7 +1334,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { case ID_OHDR: { // Object header - // mprintf ((0,"Object header...\n")); + // mprintf(0,"Object header...\n"); pm->n_models = cf_ReadInt(infile); pm->rad = cf_ReadFloat(infile); @@ -1372,7 +1372,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { char props[MAX_PROP_LEN]; float d; - // mprintf((0,"Got chunk SOBJ, len=%d\n",len)); + // mprintf(0,"Got chunk SOBJ, len=%d\n",len); n = cf_ReadInt(infile); @@ -1670,7 +1670,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { if (pm->n_attach == (num_normals = cf_ReadInt(infile))) f_uvec = true; else { - mprintf((0, "WARNING: Ingoring ATTACH normals - total number doesn't match number of attach points\n")); + mprintf(0, "WARNING: Ingoring ATTACH normals - total number doesn't match number of attach points\n"); // Int3(); DataError("Model <%s> specifies %d attach points but only contains %d attach normals\n", pm->name, pm->n_attach, num_normals); @@ -1752,7 +1752,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { int i, n; char name_buf[128]; - // mprintf((0,"Got chunk TXTR, len=%d\n",len)); + // mprintf(0,"Got chunk TXTR, len=%d\n",len); n = cf_ReadInt(infile); pm->n_textures = n; @@ -1774,7 +1774,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { ret = FindTextureName(name_buf); if (ret == -1) { ret = 0; - // mprintf ((0,"Object texture %s is not in memory!\n",name_buf)); + // mprintf(0,"Object texture %s is not in memory!\n",name_buf); } } @@ -1789,7 +1789,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { case ID_ROT_ANIM: case ID_ANIM: { int nframes; - // mprintf ((0,"ROT ANIM chunk!!!\n")); + // mprintf(0,"ROT ANIM chunk!!!\n"); if (!timed) { nframes = cf_ReadInt(infile); @@ -1851,7 +1851,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { if (t == 0) { /*if (pm->submodel[i].keyframe_angles[0]>=32768) { - mprintf ((0,"\nFlipping suboject %s!\n",pm->submodel[i].name)); + mprintf(0,"\nFlipping suboject %s!\n",pm->submodel[i].name); pm->submodel[i].keyframe_angles[0]*=-1; }*/ } @@ -1872,7 +1872,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { case ID_POS_ANIM: { int nframes; - // mprintf ((0,"POS ANIM chunk!!!\n")); + // mprintf(0,"POS ANIM chunk!!!\n"); if (!timed) { nframes = cf_ReadInt(infile); pm->num_key_pos = nframes; @@ -1920,7 +1920,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { break; } default: - // mprintf((0,"Unknown chunk <%c%c%c%c>, len = %d\n",id,id>>8,id>>16,id>>24,len)); + // mprintf(0,"Unknown chunk <%c%c%c%c>, len = %d\n",id,id>>8,id>>16,id>>24,len); cfseek(infile, len, SEEK_CUR); break; } @@ -1962,10 +1962,10 @@ int ReadNewModelFile(int polynum, CFILE *infile) { } if (pm->submodel[i].num_key_angles == 0 && (pm->submodel[i].flags & SOF_ROTATE)) { - mprintf((0, "You have a rotator that has no keyframe on model %s.\n", pm->name)); + mprintf(0, "You have a rotator that has no keyframe on model %s.\n", pm->name); pm->submodel[i].flags &= ~SOF_ROTATE; } else if (pm->submodel[i].num_key_angles == 0 && (pm->submodel[i].flags & SOF_TURRET)) { - mprintf((0, "You have a turret that has no keyframe on model %s.\n", pm->name)); + mprintf(0, "You have a turret that has no keyframe on model %s.\n", pm->name); pm->submodel[i].flags &= ~SOF_TURRET; } @@ -2012,7 +2012,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { } if (done == 0) { - mprintf((0, "Couldn't get a good keyframe!\n")); + mprintf(0, "Couldn't get a good keyframe!\n"); Int3(); } } @@ -2032,7 +2032,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { } if (done == 0) { - mprintf((0, "Couldn't get a good keyframe!\n")); + mprintf(0, "Couldn't get a good keyframe!\n"); Int3(); } } @@ -2053,7 +2053,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { pm->new_style = 1; if (pm->n_models > MAX_SUBOBJECTS) { - mprintf((0, "This model has more than the max number of subobjects! (%d)\n", MAX_SUBOBJECTS)); + mprintf(0, "This model has more than the max number of subobjects! (%d)\n", MAX_SUBOBJECTS); Int3(); FreePolyModel(pm - Poly_models); return 0; @@ -2090,7 +2090,7 @@ int LoadPolyModel(const char *filename, int pageable) { if (Poly_models[i].flags & PMF_NOT_RESIDENT) not_res = 1; - mprintf((1, "Model '%s' usage count is now %d.\n", Poly_models[i].name, Poly_models[i].used + 1)); + mprintf(1, "Model '%s' usage count is now %d.\n", Poly_models[i].name, Poly_models[i].used + 1); Poly_models[i].used = 1; FreePolyModel(i); @@ -2142,7 +2142,7 @@ int LoadPolyModel(const char *filename, int pageable) { } else Poly_models[polynum].new_style = 0; - // mprintf ((0,"Loading model %s\n",name)); + // mprintf(0,"Loading model %s\n",name); strcpy(Poly_models[polynum].name, name); int ret = 0; @@ -2172,7 +2172,7 @@ void PageInPolymodel(int polynum, int type, float *size_ptr) { return; } - mprintf((0, "Paging in polymodel %s.\n", Poly_models[polynum].name)); + mprintf(0, "Paging in polymodel %s.\n", Poly_models[polynum].name); CFILE *infile; infile = (CFILE *)cfopen(Poly_models[polynum].name, "rb"); @@ -2215,7 +2215,7 @@ void PageInPolymodel(int polynum, int type, float *size_ptr) { if (remap == 1) { // remap the damn textures - mprintf((0, "Remapping model textures for model %s.\n", Poly_models[polynum].name)); + mprintf(0, "Remapping model textures for model %s.\n", Poly_models[polynum].name); ReloadModelTextures(polynum); } @@ -3125,7 +3125,7 @@ void RemapPolyModels() { if (remap == 1) { // remap the damn textures - mprintf((0, "Remapping model textures for model %s.\n", Poly_models[i].name)); + mprintf(0, "Remapping model textures for model %s.\n", Poly_models[i].name); ReloadModelTextures(i); } } diff --git a/module/module.cpp b/module/module.cpp index 04345022..2deb46bd 100644 --- a/module/module.cpp +++ b/module/module.cpp @@ -364,16 +364,16 @@ bool mod_LoadModule(module *handle, const char *imodfilename, int flags) { strcat(fname, ext); if (!mod_FindRealFileNameCaseInsenstive(dir, fname, nname)) { - mprintf((0, "Module Load Err: %s\n", dlerror())); + mprintf(0, "Module Load Err: %s\n", dlerror()); ModLastError = MODERR_MODNOTFOUND; return false; } else { // ok we have a different filename dd_MakePath(modfilename, dir, nname, NULL); - mprintf((0, "MOD: Attempting to open %s instead of %s\n", modfilename, fname)); + mprintf(0, "MOD: Attempting to open %s instead of %s\n", modfilename, fname); handle->handle = dlopen(modfilename, f); if (!handle->handle) { - mprintf((0, "Module Load Err: %s\n", dlerror())); + mprintf(0, "Module Load Err: %s\n", dlerror()); ModLastError = MODERR_MODNOTFOUND; return false; } @@ -510,7 +510,7 @@ bool dd_SetWorkingDir(const char *path) { return (chdir(path)) ? false : true; } // These functions allow one to find a file static int globerrfn(const char *path, int err) { - mprintf((0, "Error accessing %s: %s .... \n", path, strerror(err))); + mprintf(0, "Error accessing %s: %s .... \n", path, strerror(err)); return 0; } @@ -538,7 +538,7 @@ bool CModFindFiles::Start(const char *wildcard, char *namebuf) { flags = GLOB_MARK; rc = glob(wildcard, flags, globerrfn, &ffres); if (rc == GLOB_NOSPACE) { - mprintf((0, "Out of space during glob\n")); + mprintf(0, "Out of space during glob\n"); globindex = -1; return false; } @@ -602,7 +602,7 @@ bool mod_FindRealFileNameCaseInsenstive(const char *directory, const char *fname strcat(file_to_use, t_ext); real_file = (char *)file_to_use; - mprintf((1, "MOD: Found directory \"%s\" in filename, new filename is \"%s\"\n", real_dir, real_file)); + mprintf(1, "MOD: Found directory \"%s\" in filename, new filename is \"%s\"\n", real_dir, real_file); } else { use_dir = false; real_dir = NULL; @@ -699,7 +699,7 @@ bool mod_FindRealFileNameCaseInsenstive(const char *directory, const char *fname if (found_match) { strcpy(new_filename, namebuffer); - mprintf((1, "MOD: Using \"%s\" instead of \"%s\"\n", new_filename, real_file)); + mprintf(1, "MOD: Using \"%s\" instead of \"%s\"\n", new_filename, real_file); break; } } diff --git a/movie/d3movie.cpp b/movie/d3movie.cpp index 2a41c8a1..2524a977 100644 --- a/movie/d3movie.cpp +++ b/movie/d3movie.cpp @@ -503,7 +503,7 @@ int mve_PlayMovie(const char *pMovieName, oeApplication *pApp) { char real_name[_MAX_PATH]; #ifdef __LINUX__ if (!mve_FindMovieFileRealName(pMovieName, real_name)) { - mprintf((0, "MOVIE: No such file %s\n", pMovieName)); + mprintf(0, "MOVIE: No such file %s\n", pMovieName); return MVELIB_FILE_ERROR; } #else @@ -512,7 +512,7 @@ int mve_PlayMovie(const char *pMovieName, oeApplication *pApp) { // open movie file. int hFile = open(real_name, O_RDONLY | O_BINARY); if (hFile == -1) { - mprintf((0, "MOVIE: Unable to open %s\n", real_name)); + mprintf(0, "MOVIE: Unable to open %s\n", real_name); return MVELIB_FILE_ERROR; } @@ -532,14 +532,14 @@ int mve_PlayMovie(const char *pMovieName, oeApplication *pApp) { MovieSoundDevice soundDevice; if (!mve_InitSound(pApp, soundDevice)) { - mprintf((0, "Failed to initialize sound\n")); + mprintf(0, "Failed to initialize sound\n"); close(hFile); return MVELIB_INIT_ERROR; } int result = MVE_rmPrepMovie(hFile, -1, -1, 0); if (result != 0) { - mprintf((0, "PrepMovie result = %d\n", result)); + mprintf(0, "PrepMovie result = %d\n", result); close(hFile); mve_CloseSound(soundDevice); return MVELIB_INIT_ERROR; @@ -727,7 +727,7 @@ intptr_t mve_SequenceStart(const char *mvename, int *fhandle, oeApplication *app char real_name[_MAX_PATH]; #ifdef __LINUX__ if (!mve_FindMovieFileRealName(mvename, real_name)) { - mprintf((0, "MOVIE: No such file %s\n", mvename)); + mprintf(0, "MOVIE: No such file %s\n", mvename); *fhandle = -1; return 0; } @@ -737,7 +737,7 @@ intptr_t mve_SequenceStart(const char *mvename, int *fhandle, oeApplication *app int hfile = open(real_name, O_RDONLY | O_BINARY); if (hfile == -1) { - mprintf((1, "MOVIE: Unable to open %s\n", real_name)); + mprintf(1, "MOVIE: Unable to open %s\n", real_name); *fhandle = -1; return 0; } diff --git a/music/omflex.cpp b/music/omflex.cpp index 172689b4..fe06a18a 100644 --- a/music/omflex.cpp +++ b/music/omflex.cpp @@ -148,7 +148,7 @@ bool OutrageMusicSeq::LoadTheme(const char *file) { return false; if (!inf.Open(file, "[theme file]", OMFLex)) { - mprintf((0, "Unable to find requested theme %s or bad file.\n", file)); + mprintf(0, "Unable to find requested theme %s or bad file.\n", file); return false; } @@ -210,10 +210,10 @@ bool OutrageMusicSeq::LoadTheme(const char *file) { } force_pre_error: if (cmd == INFFILE_ERROR) { - mprintf((0, "Error in music file %s line %d.\n", file, inf.line())); + mprintf(0, "Error in music file %s line %d.\n", file, inf.line()); Int3(); } else if (cmd == OMFFILEERR_LBLOVERFLOW) { - mprintf((0, "Error in music file %s line %d (too many labels).\n", file, inf.line())); + mprintf(0, "Error in music file %s line %d (too many labels).\n", file, inf.line()); Int3(); } } @@ -222,7 +222,7 @@ bool OutrageMusicSeq::LoadTheme(const char *file) { // reopen for SECOND PASS (actual code read) if (!inf.Open(file, "[theme file]", OMFLex)) { - mprintf((0, "Unable to find requested theme %s or bad file.\n", file)); + mprintf(0, "Unable to find requested theme %s or bad file.\n", file); return false; } @@ -357,13 +357,13 @@ bool OutrageMusicSeq::LoadTheme(const char *file) { force_error: if (cmd == INFFILE_ERROR) { - mprintf((0, "Error in music file %s line %d.\n", file, inf.line())); + mprintf(0, "Error in music file %s line %d.\n", file, inf.line()); Int3(); } else if (cmd == OMFFILEERR_ADDSECTION) { - mprintf((0, "Error in music file %s line %d (failed to add section).\n", file, inf.line())); + mprintf(0, "Error in music file %s line %d (failed to add section).\n", file, inf.line()); Int3(); } else if (cmd == OMFFILEERR_INSOVERFLOW) { - mprintf((0, "Error in music file %s line %d (too many instructions).\n", file, inf.line())); + mprintf(0, "Error in music file %s line %d (too many instructions).\n", file, inf.line()); Int3(); } } diff --git a/music/sequencer.cpp b/music/sequencer.cpp index c25255ed..6f27b152 100644 --- a/music/sequencer.cpp +++ b/music/sequencer.cpp @@ -240,7 +240,7 @@ void OutrageMusicSeq::Start() { m_registers[i] = 0; } - mprintf((0, "Music system on.\n")); + mprintf(0, "Music system on.\n"); } // stops the sequencer, flushes events @@ -250,7 +250,7 @@ void OutrageMusicSeq::Stop() { int i; - mprintf((0, "Music system off.\n")); + mprintf(0, "Music system off.\n"); m_sequencer_run = false; for (i = 0; i < OMS_NUM_STRM; i++) { @@ -321,7 +321,7 @@ void OutrageMusicSeq::Frame(float frame_time) { } if (start_pending_song) { - mprintf((0, "MUSIC:Starting pending song.\n")); + mprintf(0, "MUSIC:Starting pending song.\n"); LOGFILE((_logfp, "MUSIC:Starting pending song.\n")); START_PENDING_SONG(); } @@ -360,7 +360,7 @@ next_ins: // goto next instruction. strm->ip++; - // mprintf((0, "%d ", cmd)); + // mprintf(0, "%d ", cmd); AudioStream *stream = &strm->strm->m_stream; // execute opcodes. @@ -384,14 +384,14 @@ next_ins: // we start playing the current stream immediately. stream->Close(); m_dominant_strm = DOMINANT_STRM_ADJUST(); - // mprintf((0, "MUSIC: Starting stream with %s on channel %d.\n", name, m_dominant_strm)); + // mprintf(0, "MUSIC: Starting stream with %s on channel %d.\n", name, m_dominant_strm); LOGFILE((_logfp, "MUSIC: Starting stream with %s on channel %d.\n", name, m_dominant_strm)); strm->strm = &m_strm[m_dominant_strm]; stream = &strm->strm->m_stream; err = stream->Open(name); } else { m_dominant_strm = DOMINANT_STRM_ADJUST(); - // mprintf((0, "MUSIC: Preparing stream with %s on channel %d.\n", name, m_dominant_strm)); + // mprintf(0, "MUSIC: Preparing stream with %s on channel %d.\n", name, m_dominant_strm); LOGFILE((_logfp, "MUSIC: Preparing stream with %s on channel %d.\n", name, m_dominant_strm)); strm->strm = &m_strm[m_dominant_strm]; stream = &strm->strm->m_stream; @@ -401,7 +401,7 @@ next_ins: // skip instructions until error is cleared. if (!err) { - // mprintf((0, "MUSIC: Error opening stream %s on channel %d.\n", name, m_dominant_strm)); + // mprintf(0, "MUSIC: Error opening stream %s on channel %d.\n", name, m_dominant_strm); LOGFILE((_logfp, "MUSIC: Error opening stream %s on channel %d.\n", name, m_dominant_strm)); strm->error = true; } @@ -410,7 +410,7 @@ next_ins: stream->SetVolume(m_mastervol); strm->stream_idle = false; } else { - mprintf((0, "OMS: Stream was not found in track list.\n")); + mprintf(0, "OMS: Stream was not found in track list.\n"); } strm->pending_loop_name = name; @@ -436,11 +436,11 @@ next_ins: } if (!strm->error) { - // mprintf((0, "MUSIC: playing %s.\n", strm->loop_name)); + // mprintf(0, "MUSIC: playing %s.\n", strm->loop_name); LOGFILE((_logfp, "MUSIC: playing %s.\n", strm->loop_name)); LOGFILE((_logfp, "MUSIC: state of played stream is %d.\n", strm->loop_name, stream->State())); } else { - // mprintf((0, "MUSIC: Error playing %s.\n", strm->loop_name)); + // mprintf(0, "MUSIC: Error playing %s.\n", strm->loop_name); LOGFILE((_logfp, "MUSIC: Error playing %s.\n", strm->loop_name)); } break; @@ -540,7 +540,7 @@ next_ins: if (strm->request_stop) { strm->stream_idle = true; strm->request_stop = false; - mprintf((0, "MUSIC: Processed stop request.\n")); + mprintf(0, "MUSIC: Processed stop request.\n"); LOGFILE((_logfp, "MUSIC: Processed stop request.\n")); } } diff --git a/music/streamer.cpp b/music/streamer.cpp index ed5d0bdd..43acb96c 100644 --- a/music/streamer.cpp +++ b/music/streamer.cpp @@ -125,7 +125,7 @@ void oms_stream::Process(float frmtime) { case OMS_STRM_SWITCH: STREAM_COMMANDP(OMS_STRM_SWITCH, evt.parm.p); m_stream.Stop(true, &m_data.i); - mprintf((0, "%d-%d ", m_data.i, m_stream.State())); + mprintf(0, "%d-%d ", m_data.i, m_stream.State()); break; case OMS_STRM_NEXT: @@ -193,7 +193,7 @@ bool oms_stream::processCommand() { case OMS_STRM_SWITCH: // if current measure is greater than initial measure at switch, then we will stop // this stream and send a play command to the current dominant stream. - // mprintf((0, "%d-%d ",m_data.i, m_stream.State())); + // mprintf(0, "%d-%d ",m_data.i, m_stream.State()); if (m_data.i || m_stream.State() == STRM_STOPPED || m_stream.State() == STRM_INVALID) { bool *still_playing = (bool *)m_status.parm.p; *still_playing = false; @@ -243,7 +243,7 @@ void oms_stream::processQLoad(const char *fname) { STREAM_COMMANDP(OMS_STRM_LOAD, (void *)fname); m_data.p = (void *)fname; } else { - mprintf((0, "OMS: Couldn't load song %s.\n", fname)); + mprintf(0, "OMS: Couldn't load song %s.\n", fname); STREAM_COMMANDI(OMS_STRM_FREE); m_valid_result = true; diff --git a/netcon/includes/con_dll.h b/netcon/includes/con_dll.h index a1200701..21d4b96b 100644 --- a/netcon/includes/con_dll.h +++ b/netcon/includes/con_dll.h @@ -752,9 +752,9 @@ typedef struct vmt_descent3_struct { ///////////////////////////// // Defines #ifndef RELEASE -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #else -#define DLLmprintf(args) +#define DLLmprintf(...) #endif uint32_t MTClientVer = 100; @@ -1040,7 +1040,7 @@ int StartMultiplayerGameMenu() { // DLLmprintf((0,search)); if (DLLddio_FindFileStart(search, buffer)) { if (DLLIsMissionMultiPlayable(buffer)) { - DLLmprintf((0, "Found a mission: %s\n", buffer)); + DLLmprintf(0, "Found a mission: %s\n", buffer); mi = (_msn_list *)DLLmem_malloc(sizeof(msn_list)); strcpy(mi->msn_name, DLLGetMissionName(buffer)); strcpy(mi->msn_file, buffer); @@ -1050,7 +1050,7 @@ int StartMultiplayerGameMenu() { } while (DLLddio_FindNextFile(buffer)) { if (DLLIsMissionMultiPlayable(buffer)) { - DLLmprintf((0, "Found a mission: %s\n", buffer)); + DLLmprintf(0, "Found a mission: %s\n", buffer); mi = (_msn_list *)DLLmem_malloc(sizeof(msn_list)); strcpy(mi->msn_name, DLLGetMissionName(buffer)); strcpy(mi->msn_file, buffer); @@ -1064,12 +1064,12 @@ int StartMultiplayerGameMenu() { // char mn3_path[_MAX_PATH*2]; DLLddio_MakePath(search, DLLLocalD3Dir, "missions", "*.mn3", NULL); - // DLLmprintf((0,search)); + // DLLmprintf(0,search); if (DLLddio_FindFileStart(search, buffer)) { // DLLddio_MakePath(mn3_path,DLLLocalD3Dir,"missions",buffer,NULL); if (DLLIsMissionMultiPlayable(buffer) && (stricmp("d3_2.mn3", buffer) != 0)) { - DLLmprintf((0, "Found a mission: %s\n", buffer)); + DLLmprintf(0, "Found a mission: %s\n", buffer); mi = (_msn_list *)DLLmem_malloc(sizeof(msn_list)); strcpy(mi->msn_name, DLLGetMissionName(buffer)); strcpy(mi->msn_file, buffer); @@ -1082,7 +1082,7 @@ int StartMultiplayerGameMenu() { continue; // DLLddio_MakePath(mn3_path,DLLLocalD3Dir,"missions",buffer,NULL); if (DLLIsMissionMultiPlayable(buffer)) { - DLLmprintf((0, "Found a mission: %s\n", buffer)); + DLLmprintf(0, "Found a mission: %s\n", buffer); mi = (_msn_list *)DLLmem_malloc(sizeof(msn_list)); strcpy(mi->msn_name, DLLGetMissionName(buffer)); strcpy(mi->msn_file, buffer); @@ -1227,7 +1227,7 @@ int StartMultiplayerGameMenu() { { // Do warp dialog here if needed if (-1 != DLLMultiLevelSelection()) { - DLLmprintf((0, "Mission loaded successfully!\n")); + DLLmprintf(0, "Mission loaded successfully!\n"); DLLMultiStartServer(1, DLLNetgame->scriptname, teams); exit_menu = 1; ret = 1; diff --git a/netcon/lanclient/lanclient.cpp b/netcon/lanclient/lanclient.cpp index 8241254d..17b7d548 100644 --- a/netcon/lanclient/lanclient.cpp +++ b/netcon/lanclient/lanclient.cpp @@ -339,7 +339,7 @@ void DLLFUNCCALL DLLMultiInit(int *api_func) { Use_netgame_flags = 1; #include "mdllinit.h" DLLCreateStringTable("lanclient.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { All_ok = false; return; @@ -485,7 +485,7 @@ int MainMultiplayerMenu() { // char * psel = DLLListGetItem(main_list,DLLListGetSelectedIndex(main_list)) ; // selno = DLLListGetSelectedIndex(main_list); // strcpy(selgame,DLLNetwork_games[selno].name); - DLLmprintf((0, "Selected item = %s\n", selgame)); + DLLmprintf(0, "Selected item = %s\n", selgame); selti = NULL; DLLListRemoveAll(main_list); for (int k = 0; k < *DLLNum_network_games_known; k++) { @@ -504,7 +504,7 @@ int MainMultiplayerMenu() { strcat(server_mode, "-ML"); } - DLLmprintf((0, "Found game: %s\n", DLLNetwork_games[k].name)); + DLLmprintf(0, "Found game: %s\n", DLLNetwork_games[k].name); snprintf(fmtline, sizeof(fmtline), "%.20s\t\x02\x02b%s %.10s\x02\x45%.15s\x02\x63%d\x02\x6d%d/%d\x02\x7e%.3f", DLLNetwork_games[k].name, server_mode, DLLNetwork_games[k].scriptname, DLLNetwork_games[k].mission_name, DLLNetwork_games[k].level_num, @@ -520,7 +520,7 @@ int MainMultiplayerMenu() { selgame[20] = '\0'; if (strncmp(selgame, DLLNetwork_games[k].name, 19) == 0) { selti = net_game_txt_items[k]; - DLLmprintf((0, "Found previously selected game in list, reselecting...\n")); + DLLmprintf(0, "Found previously selected game in list, reselecting...\n"); } DLLListAddItem(main_list, net_game_txt_items[k]); } @@ -559,7 +559,7 @@ int MainMultiplayerMenu() { // Get the appropriate game address int gameno; gameno = DLLListGetSelectedIndex(main_list); - DLLmprintf((0, "Selected item is %d\n", gameno)); + DLLmprintf(0, "Selected item is %d\n", gameno); network_address s_address; memcpy(&s_address, &DLLNetwork_games[gameno].addr, sizeof(network_address)); s_address.connection_type = NP_TCP; @@ -569,7 +569,7 @@ int MainMultiplayerMenu() { if (DLLDoPlayerMouselookCheck(DLLNetwork_games[gameno].flags)) { if (DLLmsn_CheckGetMission(&s_address, DLLNetwork_games[gameno].mission)) { if ((DLLTryToJoinServer(&s_address))) { - DLLmprintf((0, "Menu: Game joined!\n")); + DLLmprintf(0, "Menu: Game joined!\n"); DLLNewUIWindowClose(main_wnd); exit_menu = 1; ret = 1; @@ -633,11 +633,11 @@ int MainMultiplayerMenu() { } iaddr = inet_addr(szdip); - DLLmprintf((0, "Local inet_addr %x\n", iaddr)); + DLLmprintf(0, "Local inet_addr %x\n", iaddr); if (iaddr && (INADDR_NONE != iaddr)) DLLSearchForLocalGamesTCP(iaddr, htons(iport)); else - DLLmprintf((0, "Invalid IP for local search\n")); + DLLmprintf(0, "Invalid IP for local search\n"); DLLListRemoveAll(main_list); for (a = 0; a < MAX_NET_GAMES; a++) if (net_game_txt_items[a]) @@ -698,7 +698,7 @@ void AutoLoginAndJoinGame(void) { *DLLMultiGameStarting = 0; if (!*DLLAuto_login_addr) { - DLLmprintf((0, "Can't autostart because no IP address was specified!!\n")); + DLLmprintf(0, "Can't autostart because no IP address was specified!!\n"); return; } if (*DLLAuto_login_port) { @@ -718,7 +718,7 @@ void AutoLoginAndJoinGame(void) { DLLMultiStartClient(NULL); if ((DLLTryToJoinServer(&s_address))) { - DLLmprintf((0, "Menu: Game joined!\n")); + DLLmprintf(0, "Menu: Game joined!\n"); *DLLMultiGameStarting = 1; } } diff --git a/netgames/anarchy/anarchy.cpp b/netgames/anarchy/anarchy.cpp index 1489b537..8ed679b4 100644 --- a/netgames/anarchy/anarchy.cpp +++ b/netgames/anarchy/anarchy.cpp @@ -160,7 +160,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->Set_OnPrintScores(OnPrintScores); DLLCreateStringTable("Anarchy.str", &StringTable, &StringTableSize); - mprintf((0, "%d strings loaded from string table\n", StringTableSize)); + mprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -550,7 +550,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - mprintf((0, "Unable to open output file\n")); + mprintf(0, "Unable to open output file\n"); return; } diff --git a/netgames/coop/coop.cpp b/netgames/coop/coop.cpp index 2ea19ec2..64abf108 100644 --- a/netgames/coop/coop.cpp +++ b/netgames/coop/coop.cpp @@ -216,7 +216,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us dPlayers = DMFCBase->GetPlayers(); DLLCreateStringTable("Coop.str", &StringTable, &StringTableSize); - mprintf((0, "%d strings loaded from string table\n", StringTableSize)); + mprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -525,7 +525,7 @@ void OnClientObjectKilled(object *obj, object *killer) { DLLGetUltimateParentForObject(&parent, killer); if ((parent->type != OBJ_PLAYER) && (parent->type != OBJ_OBSERVER)) { - mprintf((0, "Robot killed wasn't by a OBJ_PLAYER or OBJ_OBSERVER (%d)\n", parent->type)); + mprintf(0, "Robot killed wasn't by a OBJ_PLAYER or OBJ_OBSERVER (%d)\n", parent->type); return; } @@ -533,7 +533,7 @@ void OnClientObjectKilled(object *obj, object *killer) { player_record *pr = DMFCBase->GetPlayerRecordByPnum(killer_pnum); if (!pr) { - mprintf((0, "Invalid player record!\n")); + mprintf(0, "Invalid player record!\n"); Int3(); return; } @@ -543,7 +543,7 @@ void OnClientObjectKilled(object *obj, object *killer) { stat->Score[DSTAT_LEVEL]++; stat->Score[DSTAT_OVERALL]++; - mprintf((0, "%s's score is now %d\n", dPlayers[killer_pnum].callsign, stat->Score[DSTAT_LEVEL])); + mprintf(0, "%s's score is now %d\n", dPlayers[killer_pnum].callsign, stat->Score[DSTAT_LEVEL]); DMFCBase->OnClientObjectKilled(obj, killer); } @@ -636,7 +636,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file,filename,"wt"); if(!file){ - mprintf((0,"Unable to open output file\n")); + mprintf(0,"Unable to open output file\n"); return; } diff --git a/netgames/ctf/ctf.cpp b/netgames/ctf/ctf.cpp index 0d559d64..ae7569c4 100644 --- a/netgames/ctf/ctf.cpp +++ b/netgames/ctf/ctf.cpp @@ -352,7 +352,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->GameInit(CTFNumOfTeams); DLLCreateStringTable("CTF.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -782,7 +782,7 @@ void OnClientLevelStart(void) { if ((flagid != -1) && (goalroom >= 0) && (goalroom <= DMFCBase->GetHighestRoomIndex()) && (!ROOMNUM_OUTSIDE(goalroom)) && (dRooms[goalroom].used)) { // Safe to create the flag - DLLmprintf((0, "Creating %s Flag\n", DMFCBase->GetTeamString(i))); + DLLmprintf(0, "Creating %s Flag\n", DMFCBase->GetTeamString(i)); DLLComputeRoomCenter(&vpos, &dRooms[goalroom]); objnum = DLLObjCreate(OBJ_POWERUP, flagid, goalroom, &vpos, NULL, OBJECT_HANDLE_NONE); DLLMultiSendObject(&dObjects[objnum], 0, true); @@ -1030,7 +1030,7 @@ void OnClientCollide(uint8_t *data) { if (DMFCBase->GetScoreLimit(&killgoal)) { if (TeamScores[pteam] >= killgoal) { // That's all she wrote for this level - DLLmprintf((0, "OnClientCollide:Kill Goal Reached!\n")); + DLLmprintf(0, "OnClientCollide:Kill Goal Reached!\n"); DMFCBase->EndLevel(); } } @@ -1388,7 +1388,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } @@ -2165,7 +2165,7 @@ bool AddFlagToPlayer(int pnum, int team, int flagobjnum) { if (!ret) { // couldn't attach the flag - mprintf((0, "CTF: COULDN'T ATTACH FLAG TO PLAYER, DELETING\n")); + mprintf(0, "CTF: COULDN'T ATTACH FLAG TO PLAYER, DELETING\n"); // tell the clients to remove this flag DLLSetObjectDeadFlag(&dObjects[flagobjnum], true, false); } @@ -2173,7 +2173,7 @@ bool AddFlagToPlayer(int pnum, int team, int flagobjnum) { if (flagobjnum == -1) { // there was an error creating the flag...not good - mprintf((0, "CTF: Couldn't create/unhash flag for attachment\n")); + mprintf(0, "CTF: Couldn't create/unhash flag for attachment\n"); DMFCBase->DisconnectMe(); return false; } @@ -2435,7 +2435,7 @@ void ReceiveGameState(uint8_t *data) { if (our_objnum == -1) { // fatal error - mprintf((0, "CTF: Local Objnums don't match server objnums\n")); + mprintf(0, "CTF: Local Objnums don't match server objnums\n"); ChildFlags[i] = OBJECT_HANDLE_NONE; DMFCBase->DisconnectMe(); } else { @@ -2444,7 +2444,7 @@ void ReceiveGameState(uint8_t *data) { AddFlagToPlayer(HasFlag[i], i, our_objnum); else { // hmm, HasFlag doesn't match ChildFlags - mprintf((0, "CTF: HasFlag doesn't match ChildFlags!!!!\n")); + mprintf(0, "CTF: HasFlag doesn't match ChildFlags!!!!\n"); ChildFlags[i] = OBJECT_HANDLE_NONE; } } @@ -2464,7 +2464,7 @@ int GetFlagCountForPlayer(int pnum) { // 1st check the pnum, make sure it is OK, is it isn't, return 0 if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { // invalid player number, return 0 flags - mprintf((0, "CTF: Invalid PNUM passed to GetFlagCountForPlayer()\n")); + mprintf(0, "CTF: Invalid PNUM passed to GetFlagCountForPlayer()\n"); return 0; } @@ -2486,7 +2486,7 @@ uint8_t GetFlagMaskForPlayer(int pnum) { // 1st check the pnum, make sure it is OK, if it isn't, return 0, meaning no flags if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { // invalid player number, return 0 flags - mprintf((0, "CTF: Invalid PNUM passed to GetFlagMaskForPlayer()\n")); + mprintf(0, "CTF: Invalid PNUM passed to GetFlagMaskForPlayer()\n"); return 0; } @@ -2514,19 +2514,19 @@ bool GivePlayerFlag(int pnum, uint8_t team) { // 1st check the player num, make sure it is valid if (!DMFCBase->CheckPlayerNum(pnum)) { // not a valid player - mprintf((0, "CTF: Invalid pnum passed to GivePlayerFlag()\n")); + mprintf(0, "CTF: Invalid pnum passed to GivePlayerFlag()\n"); return false; } // 2nd check to make sure the team given is valid, and not our own team if (team >= CTFNumOfTeams) { // not a valid team - mprintf((0, "CTF: Invalid team passed to GivePlayerFlag() (team>=CTFNumOfTeams)\n")); + mprintf(0, "CTF: Invalid team passed to GivePlayerFlag() (team>=CTFNumOfTeams)\n"); return false; } if (team == DMFCBase->GetPlayerTeam(pnum)) { // we can't add a flag of the same team to a player - mprintf((0, "CTF: In GivePlayerFlag(), trying to add a player's home team flag\n")); + mprintf(0, "CTF: In GivePlayerFlag(), trying to add a player's home team flag\n"); return false; } @@ -2534,14 +2534,14 @@ bool GivePlayerFlag(int pnum, uint8_t team) { // we'll check our HasFlags[] first if (HasFlag[team] != -1) { // hmm, we have someone listed as already having this flag...odd - mprintf((0, "CTF: In GivePlayerFlag(), trying to add a flag, but we see someone else should already have it\n")); + mprintf(0, "CTF: In GivePlayerFlag(), trying to add a flag, but we see someone else should already have it\n"); int player = HasFlag[team]; if (DMFCBase->CheckPlayerNum(player)) { // this player is in the game... // make sure this player doesn't have the flag in his inventory while (DLLInvCheckItem(player, OBJ_POWERUP, FlagIDs[team])) { // we have it listed that he does - mprintf((0, "CTF: In GivePlayerFlag(), we detected the flag in someone elses inventory\n")); + mprintf(0, "CTF: In GivePlayerFlag(), we detected the flag in someone elses inventory\n"); // remove all the flags that this player has of this team...very weird DLLInvRemove(player, OBJ_POWERUP, FlagIDs[team]); SetColoredBalls(player, false); @@ -2555,7 +2555,7 @@ bool GivePlayerFlag(int pnum, uint8_t team) { // reset this value of the array HasFlag[team] = -1; if (DMFCBase->GetLocalRole() != LR_SERVER) { - mprintf((0, "CTF: Game must be out of sync, requesting game state\n")); + mprintf(0, "CTF: Game must be out of sync, requesting game state\n"); DMFCBase->RequestGameState(); } } @@ -2568,7 +2568,7 @@ bool GivePlayerFlag(int pnum, uint8_t team) { // remove all the flags the player has while (DLLInvCheckItem(player, OBJ_POWERUP, FlagIDs[team])) { - mprintf((0, "CTF: In GivePlayerFlag(), detected a flag in a stranger's inventory\n")); + mprintf(0, "CTF: In GivePlayerFlag(), detected a flag in a stranger's inventory\n"); DLLInvRemove(player, OBJ_POWERUP, FlagIDs[team]); SetColoredBalls(player, false); // check to see if the player had a flag attached to him @@ -2588,7 +2588,7 @@ bool GivePlayerFlag(int pnum, uint8_t team) { // so we got here and added a flag to the player, now we need to attach the flag to the player if (!AddFlagToPlayer(pnum, team)) { // there was an error adding the flag,,,,ack! - mprintf((0, "CTF: In GivePlayerFlag(), couldn't attach the flag to the player\n")); + mprintf(0, "CTF: In GivePlayerFlag(), couldn't attach the flag to the player\n"); } } @@ -2599,18 +2599,18 @@ bool GivePlayerFlag(int pnum, uint8_t team) { void LoseFlagForPlayer(int pnum, uint8_t team, bool remove_from_inven) { // 1st check the player number if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { - mprintf((0, "CTF:Invalid pnum passed to LoseFlagForPlayer()\n")); + mprintf(0, "CTF:Invalid pnum passed to LoseFlagForPlayer()\n"); return; } // 2nd check the team number if (team >= CTFNumOfTeams) { - mprintf((0, "CTF:Invalid team passed to LoseFlagForPlayer()\n")); + mprintf(0, "CTF:Invalid team passed to LoseFlagForPlayer()\n"); return; } if (team == DMFCBase->GetPlayerTeam(pnum)) { - mprintf((0, "CTF:Invalid team passed to LoseFlagForPlayer()...same team as player\n")); + mprintf(0, "CTF:Invalid team passed to LoseFlagForPlayer()...same team as player\n"); return; } diff --git a/netgames/dmfc/dmfcbase.cpp b/netgames/dmfc/dmfcbase.cpp index 1f6dec0b..8bfe3849 100644 --- a/netgames/dmfc/dmfcbase.cpp +++ b/netgames/dmfc/dmfcbase.cpp @@ -781,7 +781,7 @@ void DMFCBase::GameInit(int teams) { LoadSettings(); DLLCreateStringTable("dmfc.str", &DMFCStringTable, &DMFCStringTableSize); - mprintf((0, "DMFC Note: %d strings loaded from string table\n", DMFCStringTableSize)); + mprintf(0, "DMFC Note: %d strings loaded from string table\n", DMFCStringTableSize); // initialize player records PRec_Init(); @@ -1544,7 +1544,7 @@ int DMFCBase::GetMeObjNum(void) { void DMFCBase::OnGameStateRequest(int pnum) { if (pnum == -1) return; - mprintf((0, "%s is requesting Game State information\n", Players[pnum].callsign)); + mprintf(0, "%s is requesting Game State information\n", Players[pnum].callsign); } // DMFCBase::GetTeamForNewPlayer @@ -2052,7 +2052,7 @@ void DMFCBase::SwitchShowHudCallsignLevel(uint8_t level, bool announce) { DLLAddHUDMessage(DTXT_HUDLEVEL_NONE); break; default: - mprintf((0, "DMFC: Invalid HUD Name Level\n")); + mprintf(0, "DMFC: Invalid HUD Name Level\n"); return; break; }; @@ -2077,7 +2077,7 @@ void DMFCBase::SwitchServerHudCallsignLevel(uint8_t level) { DLLAddHUDMessage(DTXT_SHUDLEVEL_NONE); break; default: - mprintf((0, "DMFC: Invalid Server HUD Name Level\n")); + mprintf(0, "DMFC: Invalid Server HUD Name Level\n"); return; break; } @@ -2206,7 +2206,7 @@ void DMFCBase::UpdatePInfo(int victim, int killer, int amount) { id = FindPInfo(killer); if ((id == NULL) || (victim_slot == -1)) { - mprintf((0, "Unable to find PInfos\n")); + mprintf(0, "Unable to find PInfos\n"); return; } @@ -2220,7 +2220,7 @@ void DMFCBase::UpdatePInfo(int victim, int killer, int amount) { int killer_slot = PRec_GetPlayerSlot(killer); if ((vpi == NULL) || (killer_slot == -1)) { - mprintf((0, "Unable to find PInfos\n")); + mprintf(0, "Unable to find PInfos\n"); return; } @@ -2492,14 +2492,14 @@ bool DMFCBase::SetWeaponDeathMessage(const char *weapon_name, const char *messag int weapon_index = DLLFindWeaponName(IGNORE_TABLE(weapon_name)); if (weapon_index == -1) { - mprintf((0, "Unable to set WeaponMessage for %s...can't find it\n", weapon_name)); + mprintf(0, "Unable to set WeaponMessage for %s...can't find it\n", weapon_name); return false; } int real_weapon = WeaponHash[weapon_index]; if (real_weapon == -1) { - mprintf((0, "You forgot to call AddWeaponHash before adding this Message\n")); + mprintf(0, "You forgot to call AddWeaponHash before adding this Message\n"); return false; } @@ -2549,7 +2549,7 @@ void DMFCBase::AddWeaponHash(const char *parent, ...) { int parent_id = DLLFindWeaponName(IGNORE_TABLE(parent)); if (parent_id == -1) { - mprintf((0, "Unable to find parent weapon ID in AddWeaponHash (%s)\n", parent)); + mprintf(0, "Unable to find parent weapon ID in AddWeaponHash (%s)\n", parent); return; } @@ -2593,7 +2593,7 @@ void DMFCBase::AddWeaponHashArray(const char *parent, int count, char **array) { int parent_id = DLLFindWeaponName(IGNORE_TABLE(parent)); if (parent_id == -1) { - mprintf((0, "Unable to find parent weapon ID in AddWeaponHash (%s)\n", parent)); + mprintf(0, "Unable to find parent weapon ID in AddWeaponHash (%s)\n", parent); return; } @@ -2669,7 +2669,7 @@ player_record *DMFCBase::GetPlayerRecordByPnum(int pnum) { // Puts a temp ban on a player which will only last the duration of the game void DMFCBase::BanPlayerFromGame(int pnum) { if (pnum >= 0 && pnum < DLLMAX_PLAYERS) { - mprintf((0, "Banning %s\n", Players[pnum].callsign)); + mprintf(0, "Banning %s\n", Players[pnum].callsign); DPrintf(DTXT_DEDS_BAN, Players[pnum].callsign); tBanItem *c; c = m_BanList; @@ -2698,7 +2698,7 @@ void DMFCBase::BanPlayerFromGame(int pnum) { m_iNumBanPlayers++; } else { - mprintf((0, "Unable to ban player...pnum not valid\n")); + mprintf(0, "Unable to ban player...pnum not valid\n"); DPrintf(DTXT_DEDS_BAN_ERROR); } } @@ -2777,10 +2777,10 @@ bool DMFCBase::RemoveBan(int index) { // // returns true is the given pnum is banned from the game bool DMFCBase::IsPlayerBanned(int pnum) { - mprintf((0, "Checking a ban on a player...")); + mprintf(0, "Checking a ban on a player..."); if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { - mprintf((0, "Playernum not valid\n")); + mprintf(0, "Playernum not valid\n"); return false; } @@ -2798,16 +2798,16 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { tBanItem *c; c = m_BanList; - mprintf((0, "Checking a ban on an address...")); + mprintf(0, "Checking a ban on an address..."); while (c) { if (addr && CompareNetworkAddress(&c->addr, addr, false)) { - mprintf((0, "Player addr IS BANNED\n")); + mprintf(0, "Player addr IS BANNED\n"); return true; } if (*m_bTrackerGame) { if (tracker_id && !strcmp(tracker_id, c->tracker_id)) { - mprintf((0, "Player tid IS BANNED\n")); + mprintf(0, "Player tid IS BANNED\n"); return true; } } @@ -2816,7 +2816,7 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { } if (!addr) { - mprintf((0, "Player not banned\n")); + mprintf(0, "Player not banned\n"); return false; } @@ -2824,7 +2824,7 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { // the hosts.allow/.deny if (addr->connection_type != NP_TCP) { - mprintf((0, "Player not banned\n")); + mprintf(0, "Player not banned\n"); return false; } @@ -2839,7 +2839,7 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { while (curr) { if ((address & curr->mask) == (curr->ip & curr->mask)) { // its a match - mprintf((0, "Player not banned\n")); + mprintf(0, "Player not banned\n"); return false; } curr = curr->next; @@ -2851,13 +2851,13 @@ bool DMFCBase::IsAddressBanned(network_address *addr, const char *tracker_id) { while (curr) { if ((address & curr->mask) == (curr->ip & curr->mask)) { // its a match - mprintf((0, "Player IS banned\n")); + mprintf(0, "Player IS banned\n"); return true; } curr = curr->next; } - mprintf((0, "Player not banned\n")); + mprintf(0, "Player not banned\n"); return false; } @@ -2888,7 +2888,7 @@ void DMFCBase::DoDamageToPlayer(int pnum, int type, float amount, bool playsound // Prepares the game so that you can display UI stuff void DMFCBase::StartUIWindow(int id, void *user_data) { if (m_iUIWindowID != -1) { - mprintf((0, "DMFCBase::StartUIWindow(): A Window ID (0x%X) is already defined\n", m_iUIWindowID)); + mprintf(0, "DMFCBase::StartUIWindow(): A Window ID (0x%X) is already defined\n", m_iUIWindowID); return; } @@ -3006,7 +3006,7 @@ bool DMFCBase::InputCommandHandle(char *command_string) { /* if(!stricmp(command_string,"$help dump")) { - mprintf((0,"Dumping help commands to file\n")); + mprintf(0,"Dumping help commands to file\n"); tInputCommandNode *node = m_InputCommandRootNode; CFILE *file; @@ -3099,115 +3099,115 @@ void DMFCBase::InputCommandFree(void) { // be placed in here. void DMFCBase::InputCommandInit(void) { if (AddInputCommand(DTXT_IC_ALLOWTEAMCHANGE, DTXT_IC_ALLOWTEAMCHANGED, DMFCInputCommand_AllowTeamChange, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_AUTOBALANCE, DTXT_IC_AUTOBALANCED, DMFCInputCommand_AutoBalance, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_AUTOSAVEDISC, DTXT_IC_AUTOSAVEDISCD, DMFCInputCommand_AutoSaveDisconnect, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_AUTOSAVELEVEL, DTXT_IC_AUTOSAVELEVELD, DMFCInputCommand_AutoSaveLevel, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_BALANCE, DTXT_IC_BALANCED, DMFCInputCommand_Balance, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_BAN, DTXT_IC_BAND, DMFCInputCommand_Ban, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_BANLIST, DTXT_IC_BANLISTD, DMFCInputCommand_BanList) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_CHANGETEAM, DTXT_IC_CHANGETEAMD, DMFCInputCommand_ChangeTeam, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_ENDLEVEL, DTXT_IC_ENDLEVELD, DMFCInputCommand_EndLevel, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_HELP, DTXT_IC_HELPD, DMFCInputCommand_Help) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_HUDNAME, DTXT_IC_HUDNAMED, DMFCInputCommand_HudCallsigns) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_KICK, DTXT_IC_KICKD, DMFCInputCommand_Kick, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_KILLMSGFILTER, DTXT_IC_KILLMSGFILTERD, DMFCInputCommand_KillMsgFilter) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_NETGAMEINFO, DTXT_IC_NETGAMEINFO, DMFCInputCommand_NetGameInfo) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_OBSERVER, DTXT_IC_OBSERVERD, DMFCInputCommand_Observer) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_PIGGYBACK, DTXT_IC_PIGGYBACKD, DMFCInputCommand_Piggyback) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_PLAYERINFO, DTXT_IC_PLAYERINFOD, DMFCInputCommand_PlayerInfo) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_PLAYERS, DTXT_IC_PLAYERSD, DMFCInputCommand_Players) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REHASH, DTXT_IC_REHASHD, DMFCInputCommand_Rehash, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REMOTE, DTXT_IC_REMOTED, DMFCInputCommand_Remote) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REMOTEADMIN, DTXT_IC_REMOTEADMIND, DMFCInputCommand_RemoteAdmin, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REMOTEADMINLOGOUT, DTXT_IC_REMOTEADMINLOGOUTD, DMFCInputCommand_RemoteAdminLogout) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REMOTEADMINPASS, DTXT_IC_REMOTEADMINPASSD, DMFCInputCommand_RemoteAdminPass, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_REMOVEBAN, DTXT_IC_REMOVEBAND, DMFCInputCommand_RemoveBan, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SAVESTATS, DTXT_IC_SAVESTATSD, DMFCInputCommand_SaveStats, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SCORES, DTXT_IC_SCORESD, DMFCInputCommand_Scores) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SERVERHUDNAMES, DTXT_IC_SERVERHUDNAMESD, DMFCInputCommand_ServerHudCallsigns, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETGOALLIMIT, DTXT_IC_SETGOALLIMITD, DMFCInputCommand_SetGoalLimit, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETMAXPLAYERS, DTXT_IC_SETMAXPLAYERSD, DMFCInputCommand_SetMaxPlayers, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETPPS, DTXT_IC_SETPPSD, DMFCInputCommand_SetPPS, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETRESPAWNTIME, DTXT_IC_SETRESPAWNTIMED, DMFCInputCommand_SetRespawnTime, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETTEAMNAME, DTXT_IC_SETTEAMNAMED, DMFCInputCommand_SetTeamName, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_SETTIMELIMIT, DTXT_IC_SETTIMELIMITD, DMFCInputCommand_SetTimeLimit, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_STATMSGS, DTXT_IC_STATMSGSD, DMFCInputCommand_StatMsgs) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_TEAM, DTXT_IC_TEAMD, DMFCInputCommand_Team) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_WAIT, DTXT_IC_WAITD, DMFCInputCommand_Wait, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); if (AddInputCommand(DTXT_IC_WARP, DTXT_IC_WARPD, DMFCInputCommand_Warp, true) < 1) - mprintf((0, "DMFC Warning: Error Adding Input Command\n")); + mprintf(0, "DMFC Warning: Error Adding Input Command\n"); } // Returns true if the input command can be called remotely @@ -4385,7 +4385,7 @@ void ParseHostsFile(char *filename, tHostsNode **root) { } // we now have a valid mask (s_mask) and a valid ip (s_ip) - mprintf((0, "IP: %s Mask: %s\n", s_ip, s_mask)); + mprintf(0, "IP: %s Mask: %s\n", s_ip, s_mask); ip_address = DLLnw_GetHostAddressFromNumbers(s_ip); mask = DLLnw_GetHostAddressFromNumbers(s_mask); @@ -4406,7 +4406,7 @@ void ParseHostsFile(char *filename, tHostsNode **root) { } error_parse: - mprintf((0, "Error parsing IP Address Mask: %s\n", save_buffer)); + mprintf(0, "Error parsing IP Address Mask: %s\n", save_buffer); noerror_parse:; } @@ -4433,11 +4433,11 @@ void DMFCBase::ReadInHostsAllowDeny(void) { // parse away if (deny_exist) { - mprintf((0, "Parsing hosts.deny\n")); + mprintf(0, "Parsing hosts.deny\n"); ParseHostsFile(deny_fn, &m_DenyList); } if (allow_exist) { - mprintf((0, "Parsing hosts.allow\n")); + mprintf(0, "Parsing hosts.allow\n"); ParseHostsFile(allow_fn, &m_AllowList); } } @@ -4502,7 +4502,7 @@ void DMFCBase::ParseStartupScript(void) { if ((autoexec_arg = DLLFindArg("-autoexec")) != 0) { // a specific autoexec.dmfc file was specified, use that strcpy(path, GetGameArg(autoexec_arg + 1)); - mprintf((0, "Override AUTOEXEC.DMFC to %s\n", path)); + mprintf(0, "Override AUTOEXEC.DMFC to %s\n", path); } else { // use the default autoexec.dmfc DLLddio_MakePath(path, LocalD3Dir, "netgames", "autoexec.dmfc", NULL); @@ -4527,7 +4527,7 @@ void DMFCBase::ParseStartupScript(void) { } if (!ok_to_read) { - mprintf((0, "AUTOEXEC.DMFC: Line too long\n")); + mprintf(0, "AUTOEXEC.DMFC: Line too long\n"); } else { if (buffer[1] == '$') { InputCommandHandle(&buffer[1]); @@ -4920,8 +4920,9 @@ int DMFCBase::GetConnectingPlayerTeam(int slot) { // we need to reconnect the player to the player records before we get the team if (!PRec_ReconnectPlayerToSlot(slot, prec_num, Players, NetPlayers)) { - mprintf((0, "Unable to reassign reconnecting player (%s) to Player Record slot #%d\n", Players[slot].callsign, - prec_num)); + mprintf(0, "Unable to reassign reconnecting player (%s) to Player Record slot #%d\n", + Players[slot].callsign, + prec_num); Int3(); } else { team = PRec_GetPlayerTeam(slot); @@ -4944,7 +4945,7 @@ int DMFCBase::GetConnectingPlayerTeam(int slot) { } } - mprintf((0, "CONNECTING PLAYER (%s): Team assigned to %d\n", Players[slot].callsign, team)); + mprintf(0, "CONNECTING PLAYER (%s): Team assigned to %d\n", Players[slot].callsign, team); return team; } @@ -5058,7 +5059,7 @@ void DMFCBase::TranslateTextMacro(const char *src, char *destination, int dest_s // now replace the token... *token_string = '\0'; - mprintf((0, "Looking for token for %s\n", token)); + mprintf(0, "Looking for token for %s\n", token); CallOnGetTokenString(token, token_string, 512); // make sure we don't go too far diff --git a/netgames/dmfc/dmfccfg.cpp b/netgames/dmfc/dmfccfg.cpp index e97ffdfb..2bb8631a 100644 --- a/netgames/dmfc/dmfccfg.cpp +++ b/netgames/dmfc/dmfccfg.cpp @@ -343,10 +343,10 @@ bool CRegistry::Import() { DLLOpenCFILE(&file, name, "rt"); if (!file) { - mprintf((0, "Unable to import %s\n", name)); + mprintf(0, "Unable to import %s\n", name); return false; } - mprintf((0, "Importing %s\n", name)); + mprintf(0, "Importing %s\n", name); Destroy(); bool oktocreate; @@ -369,7 +369,7 @@ bool CRegistry::Import() { if (buffer[0] == '[') { // Create a key! PARSE_KEY(newbuff); - mprintf((0, "Found Key: |%s|\n", newbuff)); + mprintf(0, "Found Key: |%s|\n", newbuff); CreateKey(newbuff); } else if (buffer[0] == '\"') { // Create a record @@ -401,9 +401,9 @@ bool CRegistry::Import() { ptr++; // blow by = PARSE_STRING(data); if (!CreateRecord(newbuff, REGT_STRING, data)) { - mprintf((0, "Unable to create String record: %s\n", newbuff)); + mprintf(0, "Unable to create String record: %s\n", newbuff); } else { - mprintf((0, "Created String record %s = %s\n", newbuff, data)); + mprintf(0, "Created String record %s = %s\n", newbuff, data); } break; case REGT_DWORD: @@ -413,14 +413,14 @@ bool CRegistry::Import() { idata = axtoi(data); if (!CreateRecord(newbuff, REGT_DWORD, &idata)) { - mprintf((0, "Unable to create dword record: %s\n", newbuff)); + mprintf(0, "Unable to create dword record: %s\n", newbuff); } else { - mprintf((0, "Created dword record %s = %X\n", newbuff, idata)); + mprintf(0, "Created dword record %s = %X\n", newbuff, idata); } break; } } else { - mprintf((0, "Expected [ or \"\n")); + mprintf(0, "Expected [ or \"\n"); } } } @@ -431,7 +431,7 @@ bool CRegistry::Import() { void CRegistry::CreateKey(const char *name) { tKey *curr; if (LookupKey(name)) { - mprintf((0, "Key: %s already exists\n", name)); + mprintf(0, "Key: %s already exists\n", name); return; } @@ -536,7 +536,7 @@ bool CRegistry::CreateRecord(const char *name, char type, void *data) { curr = LookupRecord(name, olddata); if (curr) { // ok we have an old value, replace it! - mprintf((0, "Replacing %s\n", name)); + mprintf(0, "Replacing %s\n", name); if (curr->data) free(curr->data); free(olddata); diff --git a/netgames/dmfc/dmfcclient.cpp b/netgames/dmfc/dmfcclient.cpp index 3f91ea79..47144fa1 100644 --- a/netgames/dmfc/dmfcclient.cpp +++ b/netgames/dmfc/dmfcclient.cpp @@ -439,18 +439,17 @@ void DMFCBase::OnClientPlayerEntersGame(int player_num) { // we have a new player slot = PRec_GetFreeSlot(); if (!PRec_AssignPlayerToSlot(player_num, slot, Players, NetPlayers)) - mprintf( - (0, "Unable to assign New Player (%s) to Player Record slot #%d\n", Players[player_num].callsign, slot)); + mprintf(0, "Unable to assign New Player (%s) to Player Record slot #%d\n", Players[player_num].callsign, slot); else - mprintf((0, "(%s) has been assigned to Player Record slot #%d\n", Players[player_num].callsign, slot)); + mprintf(0, "(%s) has been assigned to Player Record slot #%d\n", Players[player_num].callsign, slot); CallOnPlayerConnect(player_num); } else { // we have a reconnecting player if (!PRec_ReconnectPlayerToSlot(player_num, slot, Players, NetPlayers)) - mprintf((0, "Unable to reassign reconnecting player (%s) to Player Record slot #%d\n", - Players[player_num].callsign, slot)); + mprintf(0, "Unable to reassign reconnecting player (%s) to Player Record slot #%d\n", + Players[player_num].callsign, slot); else - mprintf((0, "Reconnected player (%s) to Player Record slot #%d\n", Players[player_num].callsign, slot)); + mprintf(0, "Reconnected player (%s) to Player Record slot #%d\n", Players[player_num].callsign, slot); CallOnPlayerReconnect(player_num); } } @@ -481,7 +480,7 @@ void DMFCBase::OnClientPlayerEntersGame(int player_num) { PilotPicBmpHandles[w] = BAD_BITMAP_HANDLE; } - mprintf((0, "PPIC ID: %d is %d\n", w, NetPlayers[w].pilot_pic_id)); + mprintf(0, "PPIC ID: %d is %d\n", w, NetPlayers[w].pilot_pic_id); if (NetPlayers[w].pilot_pic_id != 65535) { PilotPicBmpHandles[w] = DLLPPic_GetBitmapHandle(NetPlayers[w].pilot_pic_id); if (PilotPicBmpHandles[w] < BAD_BITMAP_HANDLE) @@ -499,7 +498,7 @@ void DMFCBase::OnClientPlayerEntersGame(int player_num) { PilotPicBmpHandles[player_num] = BAD_BITMAP_HANDLE; } - mprintf((0, "PPIC ID: %d is %d\n", player_num, NetPlayers[player_num].pilot_pic_id)); + mprintf(0, "PPIC ID: %d is %d\n", player_num, NetPlayers[player_num].pilot_pic_id); if (NetPlayers[player_num].pilot_pic_id != 65535) { PilotPicBmpHandles[player_num] = DLLPPic_GetBitmapHandle(NetPlayers[player_num].pilot_pic_id); if (PilotPicBmpHandles[player_num] < BAD_BITMAP_HANDLE) @@ -539,9 +538,9 @@ void DMFCBase::OnClientPlayerDisconnect(int player_num) { PRec_SetPlayerTeam(player_num, Players[player_num].team); if (!PRec_DisconnectPlayer(player_num)) - mprintf((0, "Unable to disconnect player (%s) from Player Records\n", Players[player_num].callsign)); + mprintf(0, "Unable to disconnect player (%s) from Player Records\n", Players[player_num].callsign); else - mprintf((0, "Disconnected player (%s) from Player Records\n", Players[player_num].callsign)); + mprintf(0, "Disconnected player (%s) from Player Records\n", Players[player_num].callsign); } // DMFCBase::OnMeDisconnectFromServer @@ -611,9 +610,9 @@ void DMFCBase::OnClientLevelEnd(void) { PRec_SetPlayerTeam(i, Players[i].team); if (!PRec_DisconnectPlayer(i)) - mprintf((0, "Unable to disconnect player (%s) from Player Records\n", Players[i].callsign)); + mprintf(0, "Unable to disconnect player (%s) from Player Records\n", Players[i].callsign); else - mprintf((0, "Disconnected player (%s) from Player Records\n", Players[i].callsign)); + mprintf(0, "Disconnected player (%s) from Player Records\n", Players[i].callsign); } } } @@ -623,7 +622,7 @@ void DMFCBase::OnClientLevelEnd(void) { // Event handler when a player becomes an observer mode // If they are piggybacking another player than piggy is the object pointer, else it's NULL void DMFCBase::OnPlayerEntersObserver(int pnum, object *piggy) { - mprintf((0, "Player %d entering observermode %s\n", pnum, (piggy) ? "Piggyback" : "Roam")); + mprintf(0, "Player %d entering observermode %s\n", pnum, (piggy) ? "Piggyback" : "Roam"); player_record *pr = PRec_GetPRecordByPnum(pnum); if (pr && pr->state == STATE_INGAME) { PInfo *pi = pr->pinfo; @@ -638,7 +637,7 @@ void DMFCBase::OnPlayerEntersObserver(int pnum, object *piggy) { // // Event handler when a player is leaving observer mode void DMFCBase::OnPlayerExitsObserver(int pnum) { - mprintf((0, "Player %d leaving observer mode\n", pnum)); + mprintf(0, "Player %d leaving observer mode\n", pnum); player_record *pr = PRec_GetPRecordByPnum(pnum); if (pr && pr->state == STATE_INGAME) { PInfo *pi = pr->pinfo; @@ -666,7 +665,7 @@ bool DMFCBase::OnCanChangeTeam(int pnum, int newteam) { // // The user is requesting the game stats to be saved to file, you must handle this completly on // the game's side, nothing is done in DMFC -void DMFCBase::OnSaveStatsToFile(void) { mprintf((0, "User requested stats to be saved!\n")); } +void DMFCBase::OnSaveStatsToFile(void) { mprintf(0, "User requested stats to be saved!\n"); } // DMFCBase::OnLevelEndSaveStatsToFile // @@ -785,7 +784,7 @@ void DMFCBase::OnInterval(void) { if (GetLocalRole() == LR_SERVER && IAmDedicatedServer() && m_bMakeClientsWait) { if (DedicatedLevelWait > 0 && DedicatedLevelWait <= (*Gametime)) { // time to stop waiting! - mprintf((0, "Telling clients that they can play!\n")); + mprintf(0, "Telling clients that they can play!\n"); DPrintf("Allowing Clients To Play\n"); PauseRealGameTime(false); MakeClientsWait(false); @@ -867,7 +866,7 @@ void DMFCBase::OnKeypress(int key) { void DMFCBase::OnInputString(char *input_string) { if (!InputCommandHandle(input_string)) { // The input command wasn't handled! - mprintf((0, "DMFC Warning: Input Command '%s' wasn't handled\n", input_string)); + mprintf(0, "DMFC Warning: Input Command '%s' wasn't handled\n", input_string); } } @@ -914,7 +913,7 @@ void DMFCBase::OnPlayerReconnect(int player_num) { SendTeamAssignment(player_num, team, false); Players[player_num].team = team; CallOnPlayerChangeTeam(player_num, team, false, false); - mprintf((0, "Reassigning (%s) to %s team\n", Players[player_num].callsign, GetTeamString(team))); + mprintf(0, "Reassigning (%s) to %s team\n", Players[player_num].callsign, GetTeamString(team)); } } @@ -939,7 +938,7 @@ void DMFCBase::OnPlayerConnect(int player_num) { SendTeamAssignment(player_num, team, false); //@@Players[player_num].team = team; CallOnPlayerChangeTeam(player_num, team, false, false); - mprintf((0, "Assigning (%s) to %s team\n", Players[player_num].callsign, GetTeamString(team))); + mprintf(0, "Assigning (%s) to %s team\n", Players[player_num].callsign, GetTeamString(team)); } } } @@ -1092,7 +1091,7 @@ void DMFCBase::OnClientObjectDestroyed(object *obj) {} // // This event occurs when a player plays an audio taunt void DMFCBase::OnPlayAudioTaunt(int pnum) { - mprintf((0, "%s plays an audio taunt\n", Players[pnum].callsign)); + mprintf(0, "%s plays an audio taunt\n", Players[pnum].callsign); SetPlayerTauntIndicator(pnum); } diff --git a/netgames/dmfc/dmfchudmessages.cpp b/netgames/dmfc/dmfchudmessages.cpp index 3d460431..4a144b75 100644 --- a/netgames/dmfc/dmfchudmessages.cpp +++ b/netgames/dmfc/dmfchudmessages.cpp @@ -133,21 +133,21 @@ void DMFCBase::DoRandomDeathMessage(int killernum,int victimnum,uint32_t hash) if(me){ if(it) - mprintf((0,"[Killer: T=%d I=%d] [Victim: T=%d I=%d]\n",it->type,it->id,me->type,me->id)); + mprintf(0,"[Killer: T=%d I=%d] [Victim: T=%d I=%d]\n",it->type,it->id,me->type,me->id); else - mprintf((0,"[Killer: NOT KNOWN] [Victim: T=%d I=%d]\n",me->type,me->id)); + mprintf(0,"[Killer: NOT KNOWN] [Victim: T=%d I=%d]\n",me->type,me->id); }else{ if(it) - mprintf((0,"[Killer: T=%d I=%d] [Victim: NOT KNOWN]\n",it->type,it->id)); + mprintf(0,"[Killer: T=%d I=%d] [Victim: NOT KNOWN]\n",it->type,it->id); else - mprintf((0,"[Killer: NOT KNOWN] [Victim: NOT KNOWN]\n")); + mprintf(0,"[Killer: NOT KNOWN] [Victim: NOT KNOWN]\n"); } if(me){ if((hash!=0xFFFFFFFF)&&(me->type==OBJ_PLAYER)&& ( (me->id==GetPlayerNum()) || ((rand()%3)==1) ) ){ weapon_index = DLLMultiMatchWeapon(hash); if(weapon_index==-1){ - mprintf((0,"Server Weapon Doesn't Match!\n")); + mprintf(0,"Server Weapon Doesn't Match!\n"); } } } @@ -226,8 +226,8 @@ seedbuf[200]; memcpy(seedbuf,seeds1,31); DecryptData((uint8_t *)seedbuf,30); spr } }else{ //either me or it doesn't exist - mprintf((0,"**********************************************************************\n")); - mprintf((0,"Either me or it doesn't exist for death message\n")); + mprintf(0,"**********************************************************************\n"); + mprintf(0,"Either me or it doesn't exist for death message\n"); if(me){ //only the killer doesn't exist @@ -278,7 +278,7 @@ void DMFCBase::DoRandomDeathMessage(int killernum, int victimnum, uint32_t hash) if ((hash != 0xFFFFFFFF) && (me->type == OBJ_PLAYER) && ((me->id == GetPlayerNum()) || ((rand() % 3) == 1))) { weapon_index = DLLMultiMatchWeapon(hash); if (weapon_index == -1) { - mprintf((0, "Server Weapon Doesn't Match!\n")); + mprintf(0, "Server Weapon Doesn't Match!\n"); } } } @@ -373,8 +373,8 @@ void DMFCBase::DoRandomDeathMessage(int killernum, int victimnum, uint32_t hash) } } else { // either me or it doesn't exist - mprintf((0, "**********************************************************************\n")); - mprintf((0, "Either me or it doesn't exist for death message\n")); + mprintf(0, "**********************************************************************\n"); + mprintf(0, "Either me or it doesn't exist for death message\n"); if (me) { // only the killer doesn't exist diff --git a/netgames/dmfc/dmfcinputcommand.cpp b/netgames/dmfc/dmfcinputcommand.cpp index 747a1f72..212a915f 100644 --- a/netgames/dmfc/dmfcinputcommand.cpp +++ b/netgames/dmfc/dmfcinputcommand.cpp @@ -193,7 +193,7 @@ void DMFCInputCommand_Team(const char *input_string) { if ((t == -1) || (t == curr_team) || (curr_team == -1)) return; - mprintf((0, "Attempting to change teams to %s team\n", team)); + mprintf(0, "Attempting to change teams to %s team\n", team); DLLAddHUDMessage(DTXT_TEAMCHANGEATTEMPT, team); basethis->RequestTeamChange(t, basethis->GetPlayerNum(), true); } @@ -232,7 +232,7 @@ void DMFCInputCommand_ChangeTeam(const char *input_string) { if ((!basethis->CheckPlayerNum(p)) || (t == -1) || (t == curr_team) || (curr_team == -1)) return; - mprintf((0, "Attempting to change %s to %s team\n", basethis->Players[p].callsign, team)); + mprintf(0, "Attempting to change %s to %s team\n", basethis->Players[p].callsign, team); DLLAddHUDMessage(DTXT_STEAMCHANGEATTEMPT, basethis->Players[p].callsign, team); basethis->RequestTeamChange(t, p, true); } @@ -911,7 +911,7 @@ void DMFCInputCommand_Observer(const char *input_string) { return; } - mprintf((0, "SwitchObserverMode %s [%d]\n", (turn_on) ? "On" : "Off", pnum)); + mprintf(0, "SwitchObserverMode %s [%d]\n", (turn_on) ? "On" : "Off", pnum); DLLMultiSendRequestToObserve(OBSERVER_MODE_ROAM, (turn_on) ? 1 : 0, 0); } @@ -959,12 +959,12 @@ void DMFCInputCommand_Piggyback(const char *input_string) { DLLMultiSendRequestToObserve(OBSERVER_MODE_ROAM, 0, 0); } if (pnum == basethis->GetPlayerNum()) { - mprintf((0, "Returning to self\n")); + mprintf(0, "Returning to self\n"); return; } if (basethis->CallOnAllowObserverChange(true)) { - mprintf((0, "Switching to piggyback for player %d\n", topnum)); + mprintf(0, "Switching to piggyback for player %d\n", topnum); DLLMultiSendRequestToObserve(OBSERVER_MODE_PIGGYBACK, 1, basethis->Players[topnum].objnum); } } diff --git a/netgames/dmfc/dmfcinternal.h b/netgames/dmfc/dmfcinternal.h index 99e7247f..0f2fc448 100644 --- a/netgames/dmfc/dmfcinternal.h +++ b/netgames/dmfc/dmfcinternal.h @@ -272,7 +272,7 @@ class DMFCBase; #ifdef mprintf // undefine mprintf and redirect it to use DLLmprintf #undef mprintf #endif -#define mprintf DLLmprintf +#define mprintf(...) DLLmprintf(__VA_ARGS__) #define MAX_DBNAME_SIZE 32 #define MAX_DBLABEL_SIZE 128 diff --git a/netgames/dmfc/dmfcmenu.cpp b/netgames/dmfc/dmfcmenu.cpp index e9a34e38..e11d30d2 100644 --- a/netgames/dmfc/dmfcmenu.cpp +++ b/netgames/dmfc/dmfcmenu.cpp @@ -944,16 +944,16 @@ void RemoveBanByIndex(int index) { basethis->RemoveBan(index); } // Server Only. Kicks a player from the game void KickPlayer(int pnum) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "KickPlayer Error: You're Not The Server\n")); + mprintf(0, "KickPlayer Error: You're Not The Server\n"); return; } if (pnum == basethis->GetPlayerNum()) { - mprintf((0, "KickPlayer Error: Server can't kick themself\n")); + mprintf(0, "KickPlayer Error: Server can't kick themself\n"); DLLAddHUDMessage(DTXT_SERVERCANTKICK); return; } if (!basethis->CheckPlayerNum(pnum)) { - mprintf((0, "KickPlayer Error: Pnum %d not in game\n", pnum)); + mprintf(0, "KickPlayer Error: Pnum %d not in game\n", pnum); DLLAddHUDMessage(DTXT_INVALIDPNUM, pnum); return; } @@ -963,16 +963,16 @@ void KickPlayer(int pnum) { // Server Only. Temp bans a player from the game void BanPlayer(int pnum) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "BanPlayer Error: You're Not The Server\n")); + mprintf(0, "BanPlayer Error: You're Not The Server\n"); return; } if (pnum == basethis->GetPlayerNum()) { - mprintf((0, "BanPlayer Error: Server can't ban themself\n")); + mprintf(0, "BanPlayer Error: Server can't ban themself\n"); DLLAddHUDMessage(DTXT_SERVERCANTBAN); return; } if (!basethis->CheckPlayerNum(pnum)) { - mprintf((0, "BanPlayer Error: Pnum %d not in game\n", pnum)); + mprintf(0, "BanPlayer Error: Pnum %d not in game\n", pnum); DLLAddHUDMessage(DTXT_INVALIDPNUM, pnum); return; } @@ -983,7 +983,7 @@ void BanPlayer(int pnum) { // Server Only. Ends the current level void EndMultiLevel(int i) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "You're Not The Server\n")); + mprintf(0, "You're Not The Server\n"); return; } DLLMultiEndLevel(); @@ -992,11 +992,11 @@ void EndMultiLevel(int i) { // Server Only. Automatically balances the teams void BalanceTeams(int i) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "You're Not The Server\n")); + mprintf(0, "You're Not The Server\n"); return; } - mprintf((0, "Balancing Teams\n")); + mprintf(0, "Balancing Teams\n"); DPrintf(DTXT_BALANCINGTEAMS); // First we need to get a count of how many are on each team @@ -1038,8 +1038,10 @@ void BalanceTeams(int i) { ShouldHave[i]++; for (i = 0; i < MAX_TEAMS; i++) { - mprintf((0, "%s team should have %d players and has %d now\n", basethis->GetTeamString(i), ShouldHave[i], - TeamCount[i])); + mprintf(0, "%s team should have %d players and has %d now\n", + basethis->GetTeamString(i), + ShouldHave[i], + TeamCount[i]); } // Now move the players around until the teams are of the right size @@ -1087,7 +1089,7 @@ void BalanceTeams(int i) { // Server Only. Switches AutoTeamSelect On/Off void SwitchAutoTeamSelect(int i) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "You're Not The Server\n")); + mprintf(0, "You're Not The Server\n"); return; } bool on = (i == 1) ? true : false; @@ -1097,7 +1099,7 @@ void SwitchAutoTeamSelect(int i) { // Server Only. Switches allowing Team Changing on/off void SwitchTeamChange(int i) { if (basethis->GetLocalRole() != LR_SERVER) { - mprintf((0, "You're not the server\n")); + mprintf(0, "You're not the server\n"); return; } bool on = (i == 1) ? true : false; @@ -1120,7 +1122,7 @@ void SwitchPlayerInfo(int pnum) { } if (!basethis->CheckPlayerNum(pnum)) { - mprintf((0, "%d is invalid for playerinfo\n", pnum)); + mprintf(0, "%d is invalid for playerinfo\n", pnum); return; } @@ -1149,19 +1151,19 @@ void SwitchServerHudPlayerName(int i) { // Change teams (or more specifically request to change teams) void ChangeTeams(int team) { if ((team < 0) || (team > 3)) { - mprintf((0, "Invalid team requested (%d)\n", team)); + mprintf(0, "Invalid team requested (%d)\n", team); return; } int curr_team = basethis->Players[basethis->GetPlayerNum()].team; if (curr_team == -1) { - mprintf((0, "Dedicated Server Can't Change Teams\n")); + mprintf(0, "Dedicated Server Can't Change Teams\n"); DPrintf(DTXT_NODEDICATEDTEAM); return; } if (team == curr_team) { - mprintf((0, "You're already on the %s team\n", basethis->GetTeamString(team))); + mprintf(0, "You're already on the %s team\n", basethis->GetTeamString(team)); DPrintf(DTXT_SAMETEAMCHANGE, basethis->GetTeamString(team)); return; } @@ -1181,7 +1183,7 @@ void SwitchObserverMode(int i) { pobj = &basethis->Objects[basethis->Players[pnum].objnum]; - mprintf((0, "SwitchObserverMode %s [%d]\n", (i == 1) ? "On" : "Off", pnum)); + mprintf(0, "SwitchObserverMode %s [%d]\n", (i == 1) ? "On" : "Off", pnum); if (pobj->type == OBJ_OBSERVER) { if ((i == 0) && (basethis->CallOnAllowObserverChange(false))) @@ -1206,12 +1208,12 @@ void SwitchPiggyBack(int pnum) { DLLMultiSendRequestToObserve(OBSERVER_MODE_ROAM, 0, 0); } if (pnum == basethis->GetPlayerNum()) { - mprintf((0, "Returning to self\n")); + mprintf(0, "Returning to self\n"); return; } if (basethis->CallOnAllowObserverChange(true)) { - mprintf((0, "Switching to piggyback for player %d\n", pnum)); + mprintf(0, "Switching to piggyback for player %d\n", pnum); DLLMultiSendRequestToObserve(OBSERVER_MODE_PIGGYBACK, 1, basethis->Players[pnum].objnum); } } diff --git a/netgames/dmfc/dmfcprecord.cpp b/netgames/dmfc/dmfcprecord.cpp index 5c8c8f8e..9bfbde4e 100644 --- a/netgames/dmfc/dmfcprecord.cpp +++ b/netgames/dmfc/dmfcprecord.cpp @@ -160,7 +160,7 @@ int PRec_SetupUserPRec(int sizeof_user_stats, int (*pack_callback)(void *user_in int size = MAX_GAME_DATA_SIZE - (104 + 5 * MAX_PLAYER_RECORDS); if (sizeof_user_stats > size) { // the user mod specified too big of a size - mprintf((0, "DMFC Warning: In PRec_SetupUserPRec(), the size given is too large for a packet\n")); + mprintf(0, "DMFC Warning: In PRec_SetupUserPRec(), the size given is too large for a packet\n"); Int3(); goto user_stats_err; } @@ -360,7 +360,7 @@ bool PRec_AssignPlayerToSlot(int pnum, int slot, player *players_array, netplaye if (basethis->IsMasterTrackerGame() && (basethis->Players[pnum].tracker_id)) { // we are in a master tracker game, so save the tracker ID - mprintf((0, "PREC: Got a PXO Player ID of %s\n", basethis->Players[pnum].tracker_id)); + mprintf(0, "PREC: Got a PXO Player ID of %s\n", basethis->Players[pnum].tracker_id); Player_records[slot].tracker_id = strdup(basethis->Players[pnum].tracker_id); } else { // either it's not a tracker game or the tracker_id member of players is void @@ -568,8 +568,10 @@ void PRec_SendPRecToPlayer(int pnum) { } } - mprintf((0, "*Player Record: Send out %d packets of total %d bytes to %s\n", totalcount, totalsize, - basethis->Players[pnum].callsign)); + mprintf(0, "*Player Record: Send out %d packets of total %d bytes to %s\n", + totalcount, + totalsize, + basethis->Players[pnum].callsign); } // Receives the Player records info from the server @@ -603,7 +605,7 @@ void PRec_ReceivePRecFromServer(uint8_t *data) { memcpy(pr->tracker_id, &data[count], len); pr->tracker_id[len] = '\0'; } else { - mprintf((0, "PREC: UH OH!!! OUT OF MEMORY\n")); + mprintf(0, "PREC: UH OH!!! OUT OF MEMORY\n"); } count += len; } else { diff --git a/netgames/dmfc/dmfcremote.cpp b/netgames/dmfc/dmfcremote.cpp index fa4407fe..920671fd 100644 --- a/netgames/dmfc/dmfcremote.cpp +++ b/netgames/dmfc/dmfcremote.cpp @@ -156,7 +156,7 @@ void Remote_ProcessFrame(void) { // make sure they are in the game if (!pr || pr->state != STATE_INGAME) { // the player is no longer in the game - mprintf((0, "REMOTE: Removing authorization for %s\n", (pr->callsign) ? (pr->callsign) : "")); + mprintf(0, "REMOTE: Removing authorization for %s\n", (pr->callsign) ? (pr->callsign) : ""); Remote_Logout(p); // change the key for the slot @@ -189,7 +189,7 @@ void Remote_Enable(bool enable) { Use_remote_admin = false; } - mprintf((0, "Remote Administration: %s\n", (Use_remote_admin) ? "On" : "Off")); + mprintf(0, "Remote Administration: %s\n", (Use_remote_admin) ? "On" : "Off"); if (!Use_remote_admin) { // log out all the logged in players @@ -307,7 +307,7 @@ void Remote_SetMyKey(uint8_t key[8]) { pr = PRec_GetPRecordByPnum(basethis->GetPlayerNum()); int prec = translate_precptr_to_index(pr); if (prec == -1) { - mprintf((0, "INVALID PREC!\n")); + mprintf(0, "INVALID PREC!\n"); Int3(); return; } @@ -322,7 +322,7 @@ void Remote_ClientProcess(const char *command) { if (!IAmAnAdmin) { // only let "login" go through if (!strnicmp(command, "login", strlen("login"))) { - mprintf((0, "Sending login attempt for remote administration\n")); + mprintf(0, "Sending login attempt for remote administration\n"); } else { return; } @@ -467,7 +467,7 @@ void Remote_SendStringToServer(const char *string) { pr = PRec_GetPRecordByPnum(basethis->GetPlayerNum()); int prec = translate_precptr_to_index(pr); if (prec == -1) { - mprintf((0, "INVALID PREC!\n")); + mprintf(0, "INVALID PREC!\n"); Int3(); return; } @@ -475,7 +475,7 @@ void Remote_SendStringToServer(const char *string) { Remote_encrypt(Authorized_players[prec].curr_key, slen, (uint8_t *)string, &new_strlen, &packet_data); if (new_strlen == 0) { - mprintf((0, "COULDN'T ENCRYPT\n")); + mprintf(0, "COULDN'T ENCRYPT\n"); Int3(); return; } @@ -517,7 +517,7 @@ void Remote_RecieveStringFromServer(uint8_t *data, char *buffer, int size) { pr = PRec_GetPRecordByPnum(basethis->GetPlayerNum()); int prec = translate_precptr_to_index(pr); if (prec == -1) { - mprintf((0, "INVALID PREC!\n")); + mprintf(0, "INVALID PREC!\n"); Int3(); return; } @@ -561,7 +561,7 @@ void Remote_SendStringToClient(int client, const char *string) { pr = PRec_GetPRecordByPnum(client); int prec = translate_precptr_to_index(pr); if (prec == -1) { - mprintf((0, "INVALID PREC!\n")); + mprintf(0, "INVALID PREC!\n"); Int3(); return; } @@ -575,7 +575,7 @@ void Remote_SendStringToClient(int client, const char *string) { Remote_encrypt(Authorized_players[prec].curr_key, slen, (uint8_t *)string, &new_strlen, &packet_data); if (new_strlen == 0) { - mprintf((0, "COULDN'T ENCRYPT\n")); + mprintf(0, "COULDN'T ENCRYPT\n"); Int3(); return; } diff --git a/netgames/dmfc/dmfcserver.cpp b/netgames/dmfc/dmfcserver.cpp index cce144d9..19618db9 100644 --- a/netgames/dmfc/dmfcserver.cpp +++ b/netgames/dmfc/dmfcserver.cpp @@ -122,7 +122,7 @@ void DMFCBase::OnServerPlayerKilled(object *killer_obj, int victim_pnum) { else { Data->iParam = (int)DLLMultiGetMatchChecksum(OBJ_WEAPON, Data->iParam); if (Data->iParam == -1) { - mprintf((0, "Unable to generate checksum for weapon id\n")); + mprintf(0, "Unable to generate checksum for weapon id\n"); } } @@ -239,7 +239,7 @@ void DMFCBase::OnServerLevelStart(void) { if (GetLocalRole() == LR_SERVER && IAmDedicatedServer()) { if (DedicatedLevelWait > 0) { // time to stop waiting! - mprintf((0, "Telling clients to wait\n")); + mprintf(0, "Telling clients to wait\n"); DPrintf("\nMaking Clients Wait %.2f seconds\n", DedicatedLevelWait); PauseRealGameTime(true); MakeClientsWait(true); diff --git a/netgames/dmfc/dmfcui.cpp b/netgames/dmfc/dmfcui.cpp index 85936d99..68c29208 100644 --- a/netgames/dmfc/dmfcui.cpp +++ b/netgames/dmfc/dmfcui.cpp @@ -197,9 +197,9 @@ void UpdateTeamPlacementDialog(void) { tpdi.trans[team][curr_lb_count[team]] = i; // update the translator curr_lb_count[team]++; } else - mprintf((0, "Couldn't create text item\n")); + mprintf(0, "Couldn't create text item\n"); } else { - mprintf((0, "Listbox not valid!\n")); + mprintf(0, "Listbox not valid!\n"); } } else { TeamDlgInitialTeamSettings[i] = TeamDlgFinalTeamSettings[i] = TS_NOTINGAME; @@ -829,7 +829,7 @@ void DMFCBase::DoDMFCUIWaitForPlayers(bool clients_wait) { UpdateWaitForPlayersDialog(); - mprintf((0, "1:Entering UI Loop\n")); + mprintf(0, "1:Entering UI Loop\n"); while (!exit_menu) { int res; @@ -840,11 +840,11 @@ void DMFCBase::DoDMFCUIWaitForPlayers(bool clients_wait) { } switch (res) { case NEWUIRES_FORCEQUIT: - mprintf((0, "1:Got a force quit\n")); + mprintf(0, "1:Got a force quit\n"); exit_menu = true; break; case UID_OK: // exit menu - mprintf((0, "1:Got a regular quit\n")); + mprintf(0, "1:Got a regular quit\n"); exit_menu = true; break; case 10: // kick player @@ -879,7 +879,7 @@ void DMFCBase::DoDMFCUIWaitForPlayers(bool clients_wait) { }; } - mprintf((0, "1:Out of UI Loop\n")); + mprintf(0, "1:Out of UI Loop\n"); // the wait is over, let them in if (clients_wait) { diff --git a/netgames/dmfc/dmfcvirtual.cpp b/netgames/dmfc/dmfcvirtual.cpp index ece7010c..657f6918 100644 --- a/netgames/dmfc/dmfcvirtual.cpp +++ b/netgames/dmfc/dmfcvirtual.cpp @@ -991,7 +991,7 @@ void DMFCBase::TranslateEvent(int eventnum, dllinfo *data) { TranslateTextMacro(src_string, dest_string, dest_size); } break; default: - DLLmprintf((0, "DMFC Warning: Unhandled Event #%X\n", eventnum)); + DLLmprintf(0, "DMFC Warning: Unhandled Event #%X\n", eventnum); break; } } diff --git a/netgames/entropy/EntropyBase.cpp b/netgames/entropy/EntropyBase.cpp index 7b30e00f..992ecd02 100644 --- a/netgames/entropy/EntropyBase.cpp +++ b/netgames/entropy/EntropyBase.cpp @@ -298,7 +298,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->GameInit(NUM_TEAMS); DLLCreateStringTable("entropy.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -804,7 +804,7 @@ void OnServerCollide(object *me_obj, object *it_obj) { } if (virus_team == -1) { // hey! we hit a virus that doesn't belong to any team!! - DLLmprintf((0, "Virus (%d) doesn't belong to any team, removing...\n", virus_objnum)); + DLLmprintf(0, "Virus (%d) doesn't belong to any team, removing...\n", virus_objnum); DMFCBase->OnServerCollide(me_obj, it_obj); DLLSetObjectDeadFlag(it_obj, true, false); return; @@ -944,13 +944,13 @@ void TakeOverRoom(int newteam, int oldteam, int roomnum, int victor) { } if (!success) { - DLLmprintf((0, "Invalid Takeover!!!!!!!\n")); + DLLmprintf(0, "Invalid Takeover!!!!!!!\n"); return; } // print out hud message (and sound?) char buffer[256]; - DLLmprintf((0, "old=%d new=%d\n", oldteam, newteam)); + DLLmprintf(0, "old=%d new=%d\n", oldteam, newteam); snprintf(buffer, sizeof(buffer), TXT_TAKEOVER, (victor != -1) ? dPlayers[victor].callsign : TXT_NONAME, DMFCBase->GetTeamString(oldteam), room_buf); DLLAddHUDMessage(buffer); @@ -1398,7 +1398,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } diff --git a/netgames/entropy/EntropyRoom.cpp b/netgames/entropy/EntropyRoom.cpp index 9d3ad53b..87f09411 100644 --- a/netgames/entropy/EntropyRoom.cpp +++ b/netgames/entropy/EntropyRoom.cpp @@ -168,7 +168,7 @@ void DoServerConfigureDialog(void) { exit_menu = true; DLLEditGetText(virus_pk_edit, tempbuffer, 20); int newpk = atoi(tempbuffer); - DLLmprintf((0, "New Virus/Kill = %d\n", newpk)); + DLLmprintf(0, "New Virus/Kill = %d\n", newpk); break; }; } diff --git a/netgames/hoard/hoard.cpp b/netgames/hoard/hoard.cpp index dc906ce7..3e9d305c 100644 --- a/netgames/hoard/hoard.cpp +++ b/netgames/hoard/hoard.cpp @@ -309,7 +309,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us dPlayers = DMFCBase->GetPlayers(); DLLCreateStringTable("Hoard.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -321,7 +321,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us if (DMFCBase->AddInputCommand("mincount", "[Dedicated Server Only]\nSets the minimum number of hoard orbs needed to score.\n", DMFCInputCommand_MinCount, true) < 1) - mprintf((0, "Hoard Warning: Error Adding Input Command\n")); + mprintf(0, "Hoard Warning: Error Adding Input Command\n"); HoardGameInit(1); @@ -346,7 +346,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us HoardID = DLLFindObjectIDName("Hoardorb"); if (HoardID == -1) { - DLLmprintf((0, "HOARD: BIG WARNING, COULDN'T FIND HOARD ORB ID...YOUR GAME IS IN JEOPARDY!\n")); + DLLmprintf(0, "HOARD: BIG WARNING, COULDN'T FIND HOARD ORB ID...YOUR GAME IS IN JEOPARDY!\n"); *all_ok = 0; return; } @@ -786,7 +786,7 @@ void OnClientPlayerChangeSegment(int player_num, int newseg, int oldseg) { // check the score to see if we hit the limit if (DMFCBase->GetScoreLimit(&score)) { if (score <= ((stat) ? stat->Score[DSTAT_LEVEL] : 0)) { - DLLmprintf((0, "Score limit reached\n")); + DLLmprintf(0, "Score limit reached\n"); DMFCBase->EndLevel(); } } @@ -857,7 +857,7 @@ void OnClientCollide(object *me_obj, object *it_obj) { DLLSetObjectDeadFlag(it_obj, true, false); } } else - DLLmprintf((0, "HOARD BIG WARNING: TRYING TO ADD NONPOWERUP TO INVENTORY! (%d)\n", it_obj->type)); + DLLmprintf(0, "HOARD BIG WARNING: TRYING TO ADD NONPOWERUP TO INVENTORY! (%d)\n", it_obj->type); // add rotating balls if necessary DoBallsEffect(playernum, count + 1); @@ -1029,7 +1029,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } diff --git a/netgames/hyperanarchy/hyperanarchy.cpp b/netgames/hyperanarchy/hyperanarchy.cpp index 46cbdb81..a865c4ba 100644 --- a/netgames/hyperanarchy/hyperanarchy.cpp +++ b/netgames/hyperanarchy/hyperanarchy.cpp @@ -232,7 +232,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->Set_OnClientPlayerEntersGame(OnClientPlayerEntersGame); DLLCreateStringTable("hyper.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -261,7 +261,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us HyperOrbID = DLLFindObjectIDName("Hyperorb"); if (HyperOrbID == -1) { - DLLmprintf((0, "Hyper Anarchy: BIG WARNING, COULDN'T FIND HyperOrb ID...YOUR GAME IS IN JEOPARDY!\n")); + DLLmprintf(0, "Hyper Anarchy: BIG WARNING, COULDN'T FIND HyperOrb ID...YOUR GAME IS IN JEOPARDY!\n"); *all_ok = 0; return; } @@ -470,9 +470,9 @@ void OnServerGameCreated(void) { void OnServerLevelStart(void) { // Now create a hyper orb in a random room -eek if (HyperOrbID != -1) { - DLLmprintf((0, "Attempting to create HyperOrb in a random room\n")); + DLLmprintf(0, "Attempting to create HyperOrb in a random room\n"); int room = GetRandomValidRoom(); - DLLmprintf((0, "Room %d selected\n", room)); + DLLmprintf(0, "Room %d selected\n", room); // We got a good room // Safe to create the flag CreateHyperOrbInRoom(room); @@ -754,7 +754,7 @@ void OnServerCollide(object *me_obj, object *it_obj) { if ((me_obj->type == OBJ_PLAYER) && (DLLInvCheckItem(it_obj->id, OBJ_POWERUP, HyperOrbID))) { /* //Two Players collided...one had orb - DLLmprintf((0,"Player2Player\n")); + DLLmprintf(0,"Player2Player\n"); DMFCBase->CallClientEvent(EVT_CLIENT_GAMECOLLIDE,DMFCBase->GetMeObjNum(),DMFCBase->GetItObjNum(),-1); DMFCBase->CallOnClientCollide(me_obj,it_obj); */ @@ -875,7 +875,7 @@ void OnClientPlayerKilled(object *killer_obj, int victim_pnum) { // check the score to see if we hit the limit if ((DMFCBase->GetScoreLimit(&score))) { if (score <= stat->Score[DSTAT_LEVEL]) { - DLLmprintf((0, "Score limit reached\n")); + DLLmprintf(0, "Score limit reached\n"); DMFCBase->EndLevel(); } } @@ -907,7 +907,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } @@ -1108,7 +1108,7 @@ void ReceiveHyperGameState(uint8_t *data) { KillCount = MultiGetInt(data, &count); if (WhoHasOrb != -1) { - DLLmprintf((0, "%s has the score orb!\n", dPlayers[WhoHasOrb].callsign)); + DLLmprintf(0, "%s has the score orb!\n", dPlayers[WhoHasOrb].callsign); DLLInvAddTypeID(WhoHasOrb, OBJ_POWERUP, HyperOrbID, -1, -1, 0, NULL); } UpdateEffect(); @@ -1384,7 +1384,7 @@ int GetRandomValidRoom(void) { room = rand() % (DMFCBase->GetHighestRoomIndex() + 1); if ((!ROOMNUM_OUTSIDE(room)) && ((DMFCBase->GetRooms())[room].used)) { if (!((DMFCBase->GetRooms())[room].flags & RF_EXTERNAL)) { - DLLmprintf((0, "Room %d selected\n", room)); + DLLmprintf(0, "Room %d selected\n", room); return room; } } diff --git a/netgames/includes/DMFC.h b/netgames/includes/DMFC.h index fe6f4775..ffd7729b 100644 --- a/netgames/includes/DMFC.h +++ b/netgames/includes/DMFC.h @@ -317,7 +317,7 @@ do { \ DLLassert(x, #x, __FILE__, __LINE__); \ } while (0) -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #ifdef ASSERT #undef ASSERT #endif @@ -331,7 +331,7 @@ #endif #define Int3() \ do { \ - mprintf((0, "Int3 at %s line %d.\n", __FILE__, __LINE__)); \ + mprintf(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \ if (DLLDebugBreak_callback_stop) \ DLLDebugBreak_callback_stop(); \ debug_break(); \ @@ -340,7 +340,7 @@ } while (0) #elif defined(__LINUX__) // For some reason Linux doesn't like the \ continuation character, so I have to uglify this -#define DLLmprintf(args) DLLDebug_ConsolePrintf args +#define DLLmprintf(...) DLLDebug_ConsolePrintf(__VA_ARGS__) #ifdef DEBUG_BREAK #undef DEBUG_BREAK #endif @@ -377,7 +377,7 @@ #endif #define Int3() \ do { \ - mprintf((0, "Int3 at %s line %d.\n", __FILE__, __LINE__)); \ + mprintf(0, "Int3 at %s line %d.\n", __FILE__, __LINE__); \ DEBUG_BREAK(); \ } while (0) #define HEAPCHECK() @@ -387,7 +387,7 @@ #define DEBUG_BREAK() #endif #define DLLASSERT(x) -#define DLLmprintf(args) +#define DLLmprintf(...) #ifdef Int3 #undef Int3 #define Int3() @@ -405,7 +405,7 @@ #define DEBUG_BREAK() #endif #define DLLASSERT(x) -#define DLLmprintf(args) +#define DLLmprintf(...) #ifdef Int3 #undef Int3 #define Int3() diff --git a/netgames/monsterball/monsterball.cpp b/netgames/monsterball/monsterball.cpp index 8ae57df0..6fbdfd14 100644 --- a/netgames/monsterball/monsterball.cpp +++ b/netgames/monsterball/monsterball.cpp @@ -417,7 +417,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->GameInit(NumOfTeams); DLLCreateStringTable("monster.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); // add the death and suicide messages DMFCBase->AddDeathMessage(TXT_KILLEDA, true); @@ -792,7 +792,7 @@ void HandlePickupPowerball(object *owner) { bool ret = DLLAttachObject(owner, 0, bobj, 0, true); if (!ret) { // blah! - mprintf((0, "COULDN'T ATTACH MONSTERBALL TO PLAYER!!!!!!\n")); + mprintf(0, "COULDN'T ATTACH MONSTERBALL TO PLAYER!!!!!!\n"); } } @@ -1064,7 +1064,7 @@ void OnClientLevelStart(void) { DLLMultiPaintGoalRooms(NULL); - DLLmprintf((0, "Getting Monsterball info\n")); + DLLmprintf(0, "Getting Monsterball info\n"); if (!GetMonsterballInfo(DLLFindObjectIDName(IGNORE_TABLE(MONSTERBALL_ID_NAME)))) { FatalError("Error finding Monsterball room\n"); } @@ -1432,7 +1432,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } @@ -1779,7 +1779,7 @@ void GetGameStartPacket(uint8_t *data) { NumOfTeams = temp; // we need to find the objnum of the Monsterball...its there somewhere - DLLmprintf((0, "Looking for Monsterball in level\n")); + DLLmprintf(0, "Looking for Monsterball in level\n"); int objnum = -1; for (i = 0; i < MAX_OBJECTS; i++) { @@ -1789,7 +1789,7 @@ void GetGameStartPacket(uint8_t *data) { break; } } - DLLmprintf((0, "Monsterball %s\n", (objnum == -1) ? "Not Found" : "Found")); + DLLmprintf(0, "Monsterball %s\n", (objnum == -1) ? "Not Found" : "Found"); if (objnum == -1) { FatalError("Couldn't Find Monsterball when it should be there"); } @@ -1824,7 +1824,7 @@ void SendGameStartPacket(int pnum) { MultiAddByte(temp, data, &count); // we're done - DLLmprintf((0, "Sending Game State to %s\n", dPlayers[pnum].callsign)); + DLLmprintf(0, "Sending Game State to %s\n", dPlayers[pnum].callsign); DMFCBase->SendPacket(data, count, pnum); } diff --git a/netgames/roboanarchy/roboanarchy.cpp b/netgames/roboanarchy/roboanarchy.cpp index d960c2a0..f0de2bae 100644 --- a/netgames/roboanarchy/roboanarchy.cpp +++ b/netgames/roboanarchy/roboanarchy.cpp @@ -155,7 +155,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->Set_OnPrintScores(OnPrintScores); DLLCreateStringTable("Anarchy.str", &StringTable, &StringTableSize); - mprintf((0, "%d strings loaded from string table\n", StringTableSize)); + mprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -545,7 +545,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - mprintf((0, "Unable to open output file\n")); + mprintf(0, "Unable to open output file\n"); return; } diff --git a/netgames/tanarchy/tanarchy.cpp b/netgames/tanarchy/tanarchy.cpp index 35f1a4cb..7dc41165 100644 --- a/netgames/tanarchy/tanarchy.cpp +++ b/netgames/tanarchy/tanarchy.cpp @@ -185,7 +185,7 @@ void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_us DMFCBase->GameInit(NUM_TEAMS); DLLCreateStringTable("tanarchy.str", &StringTable, &StringTableSize); - DLLmprintf((0, "%d strings loaded from string table\n", StringTableSize)); + DLLmprintf(0, "%d strings loaded from string table\n", StringTableSize); if (!StringTableSize) { *all_ok = 0; return; @@ -622,7 +622,7 @@ void SaveStatsToFile(char *filename) { CFILE *file; DLLOpenCFILE(&file, filename, "wt"); if (!file) { - DLLmprintf((0, "Unable to open output file\n")); + DLLmprintf(0, "Unable to open output file\n"); return; } @@ -839,7 +839,7 @@ void OnDisconnectSaveStatsToFile(void) { // Handles when we get a new player packet void GetGameStartPacket(uint8_t *data) { // get the team scores - DLLmprintf((0, "Receiving Team Scores from server\n")); + DLLmprintf(0, "Receiving Team Scores from server\n"); int count = 0, i; for (i = 0; i < NUM_TEAMS; i++) { TeamScore[i] = MultiGetInt(data, &count); @@ -860,7 +860,7 @@ void SendGameStartPacket(int pnum) { } // we're done - DLLmprintf((0, "Sending Team Scores to %s\n", dPlayers[pnum].callsign)); + DLLmprintf(0, "Sending Team Scores to %s\n", dPlayers[pnum].callsign); DMFCBase->SendPacket(data, count, pnum); } diff --git a/networking/directplay.cpp b/networking/directplay.cpp index b9f80753..d7cee73a 100644 --- a/networking/directplay.cpp +++ b/networking/directplay.cpp @@ -121,7 +121,7 @@ dpconnections dpconns[MAX_DIRECTPLAY_CONNECTIONS]; BOOL FAR PASCAL DirectPlayEnumConnectionsCallback(LPCGUID lpguidSP, LPVOID lpConnection, DWORD dwConnectionSize, LPCDPNAME lpName, DWORD dwFlags, LPVOID lpContext) { - mprintf((0, "Directplay connection found: %s\n", lpName->lpszShortNameA)); + mprintf(0, "Directplay connection found: %s\n", lpName->lpszShortNameA); // Do something with the list of connections for (int i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) { if (dpconns[i].conn == NULL) { @@ -131,7 +131,7 @@ BOOL FAR PASCAL DirectPlayEnumConnectionsCallback(LPCGUID lpguidSP, LPVOID lpCon return (TRUE); } } - mprintf((0, "No space for Directplay entry.\n")); + mprintf(0, "No space for Directplay entry.\n"); return (TRUE); } @@ -142,12 +142,15 @@ BOOL FAR PASCAL EnumSessionsCallback(LPCDPSESSIONDESC2 lpSessionDesc, LPDWORD lp return (FALSE); if (Num_directplay_games < MAX_DP_GAMES) { - mprintf((0, "Found Directplay game[%d]: %s\n", Num_directplay_games, lpSessionDesc->lpszSessionNameA)); + mprintf(0, "Found Directplay game[%d]: %s\n", Num_directplay_games, lpSessionDesc->lpszSessionNameA); memcpy(&Directplay_sessions[Num_directplay_games], lpSessionDesc, sizeof(DPSESSIONDESC2)); strcpy(Directplay_session_desc[Num_directplay_games], lpSessionDesc->lpszSessionNameA); Directplay_sessions[Num_directplay_games].lpszSessionNameA = Directplay_session_desc[Num_directplay_games]; - // mprintf((0,"Found Directplay game[%d]: - // %s\n",Num_directplay_games,Directplay_sessions[Num_directplay_games].lpszSessionNameA)); +/* + mprintf(0,"Found Directplay game[%d]: %s\n", + Num_directplay_games, + Directplay_sessions[Num_directplay_games].lpszSessionNameA); +*/ Num_directplay_games++; } else return FALSE; @@ -167,13 +170,13 @@ int dp_SelectDirectPlayConnection(char *name) { lpAddress = NULL; for (i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) { if (stricmp(dpconns[i].name, name) == 0) { - mprintf((0, "Found DirectPlay connection: %s\n", name)); + mprintf(0, "Found DirectPlay connection: %s\n", name); connection = dpconns[i].conn; break; } } if (!connection) { - mprintf((0, "Unable to find DirectPlay connection: %s\n", name)); + mprintf(0, "Unable to find DirectPlay connection: %s\n", name); return 0; } } else @@ -192,22 +195,22 @@ int dp_SelectDirectPlayConnection(char *name) { } if (FAILED(hr)) { - mprintf((0, "lpDirectPlay4A->InitializeConnection() failed.\n")); + mprintf(0, "lpDirectPlay4A->InitializeConnection() failed.\n"); switch (hr) { case DPERR_ALREADYINITIALIZED: - mprintf((0, "Error: DPERR_ALREADYINITIALIZED\n")); + mprintf(0, "Error: DPERR_ALREADYINITIALIZED\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Error: DPERR_INVALIDFLAGS\n")); + mprintf(0, "Error: DPERR_INVALIDFLAGS\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Error: DPERR_INVALIDPARAMS\n")); + mprintf(0, "Error: DPERR_INVALIDPARAMS\n"); break; case DPERR_UNAVAILABLE: - mprintf((0, "Error: DPERR_UNAVAILABLE\n")); + mprintf(0, "Error: DPERR_UNAVAILABLE\n"); break; default: - mprintf((0, "Error: Unknown\n")); + mprintf(0, "Error: Unknown\n"); } return 0; @@ -249,20 +252,19 @@ int dp_InitDirectPlay(char *conn_name, void *parms, int num_elements) { hr = lpDirectPlayLobby3A->CreateCompoundAddress((LPDPCOMPOUNDADDRESSELEMENT)parms, num_elements, lpAddress, &dwAddressSize); if (FAILED(hr)) { - mprintf((0, "lpDirectPlayLobby3A->CreateCompoundAddress() failed. DirectPlay *NOT* initialized!\n")); + mprintf(0, "lpDirectPlayLobby3A->CreateCompoundAddress() failed. DirectPlay *NOT* initialized!\n"); return 0; } else { - mprintf((0, "lpDirectPlayLobby3A->CreateCompoundAddress() succeeded!\n")); + mprintf(0, "lpDirectPlayLobby3A->CreateCompoundAddress() succeeded!\n"); } } else { - mprintf((0, "lpDirectPlayLobby3A->CreateCompoundAddress() buffer size request failed. DirectPlay *NOT* " - "initialized!\n")); + mprintf(0, "lpDirectPlayLobby3A->CreateCompoundAddress() buffer size request failed. DirectPlay *NOT* initialized!\n"); } } } if (dp_SelectDirectPlayConnection(conn)) { DP_active = TRUE; - mprintf((0, "DirectPlay Initialized\n")); + mprintf(0, "DirectPlay Initialized\n"); return 1; } return 0; @@ -270,7 +272,7 @@ int dp_InitDirectPlay(char *conn_name, void *parms, int num_elements) { // Everyone should call this when leaving the game. void dp_EndGame() { - mprintf((0, "Ending DirectPlay game.\n")); + mprintf(0, "Ending DirectPlay game.\n"); if ((!DP_active) || (!lpDirectPlay4A)) return; lpDirectPlay4A->Close(); @@ -284,10 +286,10 @@ int dp_StartGame(char *gamename) { DPNAME server_player; DPSESSIONDESC2 sessionDesc; - mprintf((0, "Starting DirectPlay game: %s\n", gamename)); + mprintf(0, "Starting DirectPlay game: %s\n", gamename); if ((!DP_active) || (!lpDirectPlay4A)) { - mprintf((0, "Can't start game because DirectPlay isn't initialized!\n")); + mprintf(0, "Can't start game because DirectPlay isn't initialized!\n"); return 0; } // Host a new session. @@ -320,7 +322,7 @@ int dp_StartGame(char *gamename) { FALSE, // initial event reset NULL); // no name if (NetPlayers[Player_num].hPlayerEvent == NULL) { - mprintf((0, "Failed to create directplay notification event!\n")); + mprintf(0, "Failed to create directplay notification event!\n"); dp_EndGame(); DP_active = false; return 0; @@ -328,28 +330,28 @@ int dp_StartGame(char *gamename) { hres = lpDirectPlay4A->CreatePlayer(&NetPlayers[Player_num].dpidPlayer, &server_player, NetPlayers[Player_num].hPlayerEvent, NULL, 0, DPPLAYER_SERVERPLAYER); if (FAILED(hres)) { - mprintf((0, "Failed to create directplay player in dp_StartGame()\n")); + mprintf(0, "Failed to create directplay player in dp_StartGame()\n"); switch (hres) { case DPERR_CANTADDPLAYER: - mprintf((0, "Unable to create player. Error code: DPERR_CANTADDPLAYER\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CANTADDPLAYER\n"); break; case DPERR_CANTCREATEPLAYER: - mprintf((0, "Unable to create player. Error code: DPERR_CANTCREATEPLAYER\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CANTCREATEPLAYER\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "Unable to create player. Error code: DPERR_CONNECTIONLOST\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CONNECTIONLOST\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Unable to create player. Error code: DPERR_INVALIDFLAGS\n")); + mprintf(0, "Unable to create player. Error code: DPERR_INVALIDFLAGS\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Unable to create player. Error code: DPERR_INVALIDPARAMS\n")); + mprintf(0, "Unable to create player. Error code: DPERR_INVALIDPARAMS\n"); break; case DPERR_NOCONNECTION: - mprintf((0, "Unable to create player. Error code: DPERR_NOCONNECTION\n")); + mprintf(0, "Unable to create player. Error code: DPERR_NOCONNECTION\n"); break; default: - mprintf((0, "Unable to create player. Error code: Unknown\n")); + mprintf(0, "Unable to create player. Error code: Unknown\n"); break; } return 0; @@ -360,73 +362,73 @@ int dp_StartGame(char *gamename) { switch (hres) { case DPERR_ACCESSDENIED: - mprintf((0, "Failed to create Directplay session (DPERR_ACCESSDENIED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ACCESSDENIED)!\n"); break; case DPERR_ALREADYINITIALIZED: - mprintf((0, "Failed to create Directplay session (DPERR_ALREADYINITIALIZED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ALREADYINITIALIZED)!\n"); break; case DPERR_AUTHENTICATIONFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_AUTHENTICATIONFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_AUTHENTICATIONFAILED)!\n"); break; case DPERR_CANNOTCREATESERVER: - mprintf((0, "Failed to create Directplay session (DPERR_CANNOTCREATESERVER)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANNOTCREATESERVER)!\n"); break; case DPERR_CANTLOADCAPI: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADCAPI)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADCAPI)!\n"); break; case DPERR_CANTLOADSECURITYPACKAGE: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADSECURITYPACKAGE)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADSECURITYPACKAGE)!\n"); break; case DPERR_CANTLOADSSPI: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADSSPI)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADSSPI)!\n"); break; case DPERR_CONNECTING: - mprintf((0, "Failed to create Directplay session (DPERR_CONNECTING)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CONNECTING)!\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "Failed to create Directplay session (DPERR_CONNECTIONLOST)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CONNECTIONLOST)!\n"); break; case DPERR_ENCRYPTIONFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_ENCRYPTIONFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ENCRYPTIONFAILED)!\n"); break; case DPERR_ENCRYPTIONNOTSUPPORTED: - mprintf((0, "Failed to create Directplay session (DPERR_ENCRYPTIONNOTSUPPORTED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ENCRYPTIONNOTSUPPORTED)!\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDFLAGS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDFLAGS)!\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDPARAMS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDPARAMS)!\n"); break; case DPERR_INVALIDPASSWORD: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDPASSWORD)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDPASSWORD)!\n"); break; case DPERR_LOGONDENIED: - mprintf((0, "Failed to create Directplay session (DPERR_LOGONDENIED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_LOGONDENIED)!\n"); break; case DPERR_NOCONNECTION: - mprintf((0, "Failed to create Directplay session (DPERR_NOCONNECTION)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NOCONNECTION)!\n"); break; case DPERR_NONEWPLAYERS: - mprintf((0, "Failed to create Directplay session (DPERR_NONEWPLAYERS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NONEWPLAYERS)!\n"); break; case DPERR_NOSESSIONS: - mprintf((0, "Failed to create Directplay session (DPERR_NOSESSIONS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NOSESSIONS)!\n"); break; case DPERR_SIGNFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_SIGNFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_SIGNFAILED)!\n"); break; case DPERR_TIMEOUT: - mprintf((0, "Failed to create Directplay session (DPERR_TIMEOUT)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_TIMEOUT)!\n"); break; case DPERR_UNINITIALIZED: - mprintf((0, "Failed to create Directplay session (DPERR_UNINITIALIZED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_UNINITIALIZED)!\n"); break; case DPERR_USERCANCEL: - mprintf((0, "Failed to create Directplay session (DPERR_USERCANCEL)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_USERCANCEL)!\n"); break; default: - mprintf((0, "Failed to create Directplay session (unknown)!\n")); + mprintf(0, "Failed to create Directplay session (unknown)!\n"); } } return 0; @@ -449,47 +451,47 @@ int dp_ListDirectPlayGames() { hr = lpDirectPlay4A->EnumSessions(&sessionDesc, 0, EnumSessionsCallback, 0, DPENUMSESSIONS_AVAILABLE | DPENUMSESSIONS_RETURNSTATUS | DPENUMSESSIONS_ASYNC); if (hr == DPERR_CONNECTING) { - mprintf((0, "Waiting for EnumSessions() to connect.\n")); + mprintf(0, "Waiting for EnumSessions() to connect.\n"); return DPERR_CONNECTING; } if FAILED (hr) { - mprintf((0, "Unable to EnumSessions() for Directplay.\n")); + mprintf(0, "Unable to EnumSessions() for Directplay.\n"); switch (hr) { case DPERR_CONNECTING: - mprintf((0, "Error code: DPERR_CONNECTING\n")); + mprintf(0, "Error code: DPERR_CONNECTING\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "Error code: DPERR_CONNECTIONLOST\n")); + mprintf(0, "Error code: DPERR_CONNECTIONLOST\n"); break; case DPERR_EXCEPTION: - mprintf((0, "Error code: DPERR_EXCEPTION\n")); + mprintf(0, "Error code: DPERR_EXCEPTION\n"); break; case DPERR_GENERIC: - mprintf((0, "Error code: DPERR_GENERIC\n")); + mprintf(0, "Error code: DPERR_GENERIC\n"); break; case DPERR_INVALIDOBJECT: - mprintf((0, "Error code: DPERR_INVALIDOBJECT\n")); + mprintf(0, "Error code: DPERR_INVALIDOBJECT\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Error code: DPERR_INVALIDPARAMS\n")); + mprintf(0, "Error code: DPERR_INVALIDPARAMS\n"); break; case DPERR_NOCONNECTION: - mprintf((0, "Error code: DPERR_NOCONNECTION\n")); + mprintf(0, "Error code: DPERR_NOCONNECTION\n"); break; case DPERR_UNINITIALIZED: - mprintf((0, "Error code: DPERR_UNINITIALIZED\n")); + mprintf(0, "Error code: DPERR_UNINITIALIZED\n"); break; case DPERR_USERCANCEL: - mprintf((0, "Error code: DPERR_USERCANCEL\n")); + mprintf(0, "Error code: DPERR_USERCANCEL\n"); break; default: - mprintf((0, "Error code: Unknown\n")); + mprintf(0, "Error code: Unknown\n"); break; } return DPERR_NOCONNECTION; } else - mprintf((0, "EnumSessions() returned DP_OK\n")); + mprintf(0, "EnumSessions() returned DP_OK\n"); return DP_OK; } @@ -505,7 +507,7 @@ void dp_DirectPlayDispatch() { LPDPMSG_CREATEPLAYERORGROUP new_player_msg; // Put messages in the buffers if ((!DP_active) || (!lpDirectPlay4A)) { - mprintf((0, "Can't dispatch DirectPlay message because DirectPlay isn't active!\n")); + mprintf(0, "Can't dispatch DirectPlay message because DirectPlay isn't active!\n"); return; } @@ -513,26 +515,26 @@ void dp_DirectPlayDispatch() { if (FAILED(hr)) { switch (hr) { case DPERR_BUFFERTOOSMALL: - mprintf((0, "Error: lpDirectPlay4A->Receive() returned DPERR_BUFFERTOOSMALL -- needs %d\n", dwMsgBufferSize)); + mprintf(0, "Error: lpDirectPlay4A->Receive() returned DPERR_BUFFERTOOSMALL -- needs %d\n", dwMsgBufferSize); break; case DPERR_GENERIC: - mprintf((0, "Error: lpDirectPlay4A->Receive() returned DPERR_GENERIC\n")); + mprintf(0, "Error: lpDirectPlay4A->Receive() returned DPERR_GENERIC\n"); break; case DPERR_INVALIDOBJECT: - mprintf((0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDOBJECT\n")); + mprintf(0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDOBJECT\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDPARAMS\n")); + mprintf(0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDPARAMS\n"); break; case DPERR_INVALIDPLAYER: - mprintf((0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDPLAYER\n")); + mprintf(0, "Error: lpDirectPlay4A->Receive() returned DPERR_INVALIDPLAYER\n"); break; case DPERR_NOMESSAGES: // Not really an error.... - // mprintf((0,"Error: lpDirectPlay4A->Receive() returned DPERR_NOMESSAGES\n")); + // mprintf(0,"Error: lpDirectPlay4A->Receive() returned DPERR_NOMESSAGES\n"); break; default: - mprintf((0, "Unknown error code from DirectPlay::Receive() -- %x\n", hr)); + mprintf(0, "Unknown error code from DirectPlay::Receive() -- %x\n", hr); } } else { // Now we have actual data -- do something with it. @@ -543,7 +545,7 @@ void dp_DirectPlayDispatch() { case DPSYS_CREATEPLAYERORGROUP: // New player joined the game { - mprintf((0, "Got a DPSYS_CREATEPLAYERORGROUP packet!\n")); + mprintf(0, "Got a DPSYS_CREATEPLAYERORGROUP packet!\n"); new_player_msg = (LPDPMSG_CREATEPLAYERORGROUP)lpMsg; // Store this player's info for (int i = 0; i < MAX_PENDING_NEW_CONNECTIONS; i++) { @@ -568,11 +570,11 @@ void dp_DirectPlayDispatch() { break; default: Int3(); // Get Kevin - mprintf((0, "Unknown system message from DirectPlay! %d\n", lpMsg->dwType)); + mprintf(0, "Unknown system message from DirectPlay! %d\n", lpMsg->dwType); } } else { if (dwMsgBufferSize >= MAX_PACKET_SIZE) { - mprintf((0, "Error: Packet too large for D3 to handle! Discarding!!!!!\n")); + mprintf(0, "Error: Packet too large for D3 to handle! Discarding!!!!!\n"); } else { // Presumably this is from a player we know about... memset(&from_addr, 0, sizeof(network_address)); @@ -590,7 +592,7 @@ int dp_DirectPlaySend(network_address *who_to, uint8_t *data, int len, bool reli HRESULT hr; uint32_t send_flags; if ((!DP_active) || (!lpDirectPlay4A)) { - mprintf((0, "Can't send DirectPlay message because DirectPlay isn't active!\n")); + mprintf(0, "Can't send DirectPlay message because DirectPlay isn't active!\n"); return 0; } @@ -619,22 +621,22 @@ void dp_DirectPlayDestroyPlayer(DPID who) { if (FAILED(hr)) { switch (hr) { case DPERR_ACCESSDENIED: - mprintf((0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_ACCESSDENIED.\n")); + mprintf(0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_ACCESSDENIED.\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_CONNECTIONLOST.\n")); + mprintf(0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_CONNECTIONLOST.\n"); break; case DPERR_INVALIDOBJECT: - mprintf((0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_INVALIDOBJECT.\n")); + mprintf(0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_INVALIDOBJECT.\n"); break; case DPERR_INVALIDPLAYER: - mprintf((0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_INVALIDPLAYER.\n")); + mprintf(0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_INVALIDPLAYER.\n"); break; case DPERR_UNAVAILABLE: - mprintf((0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_UNAVAILABLE.\n")); + mprintf(0, "lpDirectPlay4A->DestroyPlayer() returned DPERR_UNAVAILABLE.\n"); break; default: - mprintf((0, "Unknown error returned by nw_DirectPlayDestroyPlayer() -- %x\n", hr)); + mprintf(0, "Unknown error returned by nw_DirectPlayDestroyPlayer() -- %x\n", hr); } } } @@ -646,7 +648,7 @@ int dp_DirectPlayJoinGame(LPDPSESSIONDESC2 session) { do { hr = lpDirectPlay4A->Open(session, DPOPEN_JOIN | DPOPEN_RETURNSTATUS); if (DPERR_CONNECTING == hr) { - mprintf((0, "Waiting for Directplay session to start(DPERR_CONNECTING)!\n")); + mprintf(0, "Waiting for Directplay session to start(DPERR_CONNECTING)!\n"); Sleep(50); } } while (DPERR_CONNECTING == hr); @@ -654,70 +656,70 @@ int dp_DirectPlayJoinGame(LPDPSESSIONDESC2 session) { switch (hr) { case DPERR_ACCESSDENIED: - mprintf((0, "Failed to create Directplay session (DPERR_ACCESSDENIED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ACCESSDENIED)!\n"); break; case DPERR_ALREADYINITIALIZED: - mprintf((0, "Failed to create Directplay session (DPERR_ALREADYINITIALIZED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ALREADYINITIALIZED)!\n"); break; case DPERR_AUTHENTICATIONFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_AUTHENTICATIONFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_AUTHENTICATIONFAILED)!\n"); break; case DPERR_CANNOTCREATESERVER: - mprintf((0, "Failed to create Directplay session (DPERR_CANNOTCREATESERVER)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANNOTCREATESERVER)!\n"); break; case DPERR_CANTLOADCAPI: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADCAPI)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADCAPI)!\n"); break; case DPERR_CANTLOADSECURITYPACKAGE: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADSECURITYPACKAGE)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADSECURITYPACKAGE)!\n"); break; case DPERR_CANTLOADSSPI: - mprintf((0, "Failed to create Directplay session (DPERR_CANTLOADSSPI)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CANTLOADSSPI)!\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "Failed to create Directplay session (DPERR_CONNECTIONLOST)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_CONNECTIONLOST)!\n"); break; case DPERR_ENCRYPTIONFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_ENCRYPTIONFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ENCRYPTIONFAILED)!\n"); break; case DPERR_ENCRYPTIONNOTSUPPORTED: - mprintf((0, "Failed to create Directplay session (DPERR_ENCRYPTIONNOTSUPPORTED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_ENCRYPTIONNOTSUPPORTED)!\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDFLAGS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDFLAGS)!\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDPARAMS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDPARAMS)!\n"); break; case DPERR_INVALIDPASSWORD: - mprintf((0, "Failed to create Directplay session (DPERR_INVALIDPASSWORD)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_INVALIDPASSWORD)!\n"); break; case DPERR_LOGONDENIED: - mprintf((0, "Failed to create Directplay session (DPERR_LOGONDENIED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_LOGONDENIED)!\n"); break; case DPERR_NOCONNECTION: - mprintf((0, "Failed to create Directplay session (DPERR_NOCONNECTION)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NOCONNECTION)!\n"); break; case DPERR_NONEWPLAYERS: - mprintf((0, "Failed to create Directplay session (DPERR_NONEWPLAYERS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NONEWPLAYERS)!\n"); break; case DPERR_NOSESSIONS: - mprintf((0, "Failed to create Directplay session (DPERR_NOSESSIONS)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_NOSESSIONS)!\n"); break; case DPERR_SIGNFAILED: - mprintf((0, "Failed to create Directplay session (DPERR_SIGNFAILED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_SIGNFAILED)!\n"); break; case DPERR_TIMEOUT: - mprintf((0, "Failed to create Directplay session (DPERR_TIMEOUT)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_TIMEOUT)!\n"); break; case DPERR_UNINITIALIZED: - mprintf((0, "Failed to create Directplay session (DPERR_UNINITIALIZED)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_UNINITIALIZED)!\n"); break; case DPERR_USERCANCEL: - mprintf((0, "Failed to create Directplay session (DPERR_USERCANCEL)!\n")); + mprintf(0, "Failed to create Directplay session (DPERR_USERCANCEL)!\n"); break; default: - mprintf((0, "Failed to create Directplay session (unknown)!\n")); + mprintf(0, "Failed to create Directplay session (unknown)!\n"); } // return 0; } else { @@ -728,13 +730,13 @@ int dp_DirectPlayJoinGame(LPDPSESSIONDESC2 session) { client_player.lpszShortNameA = Players[Player_num].callsign; client_player.lpszLongNameA = NULL; - mprintf((0, "Creating local player...\n")); + mprintf(0, "Creating local player...\n"); NetPlayers[Player_num].hPlayerEvent = CreateEvent(NULL, // no security FALSE, // auto reset FALSE, // initial event reset NULL); // no name if (NetPlayers[Player_num].hPlayerEvent == NULL) { - mprintf((0, "Failed to create directplay notification event!\n")); + mprintf(0, "Failed to create directplay notification event!\n"); dp_EndGame(); DP_active = false; return 0; @@ -742,28 +744,28 @@ int dp_DirectPlayJoinGame(LPDPSESSIONDESC2 session) { hres = lpDirectPlay4A->CreatePlayer(&NetPlayers[Player_num].dpidPlayer, &client_player, NetPlayers[Player_num].hPlayerEvent, NULL, 0, 0); if (FAILED(hres)) { - mprintf((0, "Failed to create directplay player in dp_DirectPlayJoinGame()\n")); + mprintf(0, "Failed to create directplay player in dp_DirectPlayJoinGame()\n"); switch (hres) { case DPERR_CANTADDPLAYER: - mprintf((0, "Unable to create player. Error code: DPERR_CANTADDPLAYER\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CANTADDPLAYER\n"); break; case DPERR_CANTCREATEPLAYER: - mprintf((0, "Unable to create player. Error code: DPERR_CANTCREATEPLAYER\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CANTCREATEPLAYER\n"); break; case DPERR_CONNECTIONLOST: - mprintf((0, "Unable to create player. Error code: DPERR_CONNECTIONLOST\n")); + mprintf(0, "Unable to create player. Error code: DPERR_CONNECTIONLOST\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Unable to create player. Error code: DPERR_INVALIDFLAGS\n")); + mprintf(0, "Unable to create player. Error code: DPERR_INVALIDFLAGS\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Unable to create player. Error code: DPERR_INVALIDPARAMS\n")); + mprintf(0, "Unable to create player. Error code: DPERR_INVALIDPARAMS\n"); break; case DPERR_NOCONNECTION: - mprintf((0, "Unable to create player. Error code: DPERR_NOCONNECTION\n")); + mprintf(0, "Unable to create player. Error code: DPERR_NOCONNECTION\n"); break; default: - mprintf((0, "Unable to create player. Error code: Unknown\n")); + mprintf(0, "Unable to create player. Error code: Unknown\n"); break; } return 0; @@ -775,7 +777,7 @@ int dp_DirectPlayJoinGame(LPDPSESSIONDESC2 session) { void dp_ShutdownDirectPlay() { int i; - mprintf((0, "Freeing DirectPlay memory\n")); + mprintf(0, "Freeing DirectPlay memory\n"); for (i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) { if (dpconns[i].conn != NULL) { mem_free(dpconns[i].conn); @@ -790,11 +792,11 @@ void dp_ShutdownDirectPlay() { lpAddress = NULL; lpdplconnection = NULL; // Delete any previous directplay instance - mprintf((0, "Releasing DirectPlay COM object (lpDirectPlay4A)\n")); + mprintf(0, "Releasing DirectPlay COM object (lpDirectPlay4A)\n"); // if(lpDirectPlay4A) // lpDirectPlay4A->Release(); // lpDirectPlay4A = NULL; - mprintf((0, "Done shutting down DirectPlay.\n")); + mprintf(0, "Done shutting down DirectPlay.\n"); } // --------------------------------------------------------------------------- @@ -818,7 +820,7 @@ BOOL FAR PASCAL EnumModemAddress(REFGUID lpguidDataType, DWORD dwDataSize, LPCVO if (IsEqualGUID(lpguidDataType, DPAID_Modem)) { // loop over all strings in list while (strlen(lpszStr)) { - mprintf((0, "Found modem: %s\n", lpszStr)); + mprintf(0, "Found modem: %s\n", lpszStr); if (Num_modems_found < MAX_MODEMS) { // store modem name strcpy(Modems_found[Num_modems_found].name, lpszStr); @@ -852,13 +854,13 @@ int dp_GetModemChoices(char *buffer, LPDWORD size) { for (i = 0; i < MAX_DIRECTPLAY_CONNECTIONS; i++) { if (stricmp(dpconns[i].name, "Modem Connection For DirectPlay") == 0) { - // mprintf((0,"Found DirectPlay connection: %s\n",name)); + // mprintf(0,"Found DirectPlay connection: %s\n",name); connection = dpconns[i].conn; break; } } if (!connection) { - mprintf((0, "Unable to find DirectPlay Modem connection.\n")); + mprintf(0, "Unable to find DirectPlay Modem connection.\n"); return 0; } @@ -875,22 +877,22 @@ int dp_GetModemChoices(char *buffer, LPDWORD size) { } if (FAILED(hr)) { - mprintf((0, "lpTempDP4->InitializeConnection() failed.\n")); + mprintf(0, "lpTempDP4->InitializeConnection() failed.\n"); switch (hr) { case DPERR_ALREADYINITIALIZED: - mprintf((0, "Error: DPERR_ALREADYINITIALIZED\n")); + mprintf(0, "Error: DPERR_ALREADYINITIALIZED\n"); break; case DPERR_INVALIDFLAGS: - mprintf((0, "Error: DPERR_INVALIDFLAGS\n")); + mprintf(0, "Error: DPERR_INVALIDFLAGS\n"); break; case DPERR_INVALIDPARAMS: - mprintf((0, "Error: DPERR_INVALIDPARAMS\n")); + mprintf(0, "Error: DPERR_INVALIDPARAMS\n"); break; case DPERR_UNAVAILABLE: - mprintf((0, "Error: DPERR_UNAVAILABLE\n")); + mprintf(0, "Error: DPERR_UNAVAILABLE\n"); break; default: - mprintf((0, "Error: Unknown\n")); + mprintf(0, "Error: Unknown\n"); } return 0; @@ -906,7 +908,7 @@ int dp_GetModemChoices(char *buffer, LPDWORD size) { if (SUCCEEDED(hr)) lpDirectPlayLobby3A->EnumAddress(EnumModemAddress, buffer, *size, 0); else - mprintf((0, "Couldn't create IID_IDirectPlayLobby3A COM Instance!\n")); + mprintf(0, "Couldn't create IID_IDirectPlayLobby3A COM Instance!\n"); } lpTempDP4->Release(); @@ -941,31 +943,31 @@ void dp_RegisterLobbyApplication(char *appname, char *exefile, char *exepath, ch HRESULT hr; - mprintf((0, "Registering DirectPlay Lobby application:\n")); - mprintf((0, "AppDesc.lpszApplicationNameA = %s\n", appname)); - mprintf((0, "AppDesc.lpszFilenameA = %s\n", exefile)); - mprintf((0, "AppDesc.lpszCommandLineA = %s\n", arguments)); - mprintf((0, "AppDesc.lpszPathA = %s\n", exepath)); - mprintf((0, "AppDesc.lpszCurrentDirectoryA = %s\n", workingdir)); - mprintf((0, "AppDesc.lpszDescriptionA = %s\n", description)); + mprintf(0, "Registering DirectPlay Lobby application:\n"); + mprintf(0, "AppDesc.lpszApplicationNameA = %s\n", appname); + mprintf(0, "AppDesc.lpszFilenameA = %s\n", exefile); + mprintf(0, "AppDesc.lpszCommandLineA = %s\n", arguments); + mprintf(0, "AppDesc.lpszPathA = %s\n", exepath); + mprintf(0, "AppDesc.lpszCurrentDirectoryA = %s\n", workingdir); + mprintf(0, "AppDesc.lpszDescriptionA = %s\n", description); hr = CoCreateInstance(CLSID_DirectPlayLobby, NULL, CLSCTX_INPROC_SERVER, IID_IDirectPlayLobby3A, (LPVOID *)&lpDirectPlayLobby3A); if (SUCCEEDED(hr)) { hr = lpDirectPlayLobby3A->RegisterApplication(0, &AppDesc); if (FAILED(hr)) { - mprintf((0, "IDirectPlayLobby3::RegisterApplication() failed.\n")); + mprintf(0, "IDirectPlayLobby3::RegisterApplication() failed.\n"); if (hr == DPERR_INVALIDFLAGS) - mprintf((0, "Error = DPERR_INVALIDFLAGS\n")); + mprintf(0, "Error = DPERR_INVALIDFLAGS\n"); else if (hr == DPERR_INVALIDPARAMS) - mprintf((0, "Error = DPERR_INVALIDPARAMS\n")); + mprintf(0, "Error = DPERR_INVALIDPARAMS\n"); else - mprintf((0, "Error = ??????????? %x\n", hr)); + mprintf(0, "Error = ??????????? %x\n", hr); } else { - mprintf((0, "IDirectPlayLobby3::RegisterApplication() succeded.\n")); + mprintf(0, "IDirectPlayLobby3::RegisterApplication() succeded.\n"); } } else { - mprintf((0, "IDirectPlayLobby3 CoCreateInstance() failed.\n")); + mprintf(0, "IDirectPlayLobby3 CoCreateInstance() failed.\n"); return; } @@ -989,12 +991,12 @@ bool dp_DidLobbyLaunchGame() { hr = lpDirectPlayLobby3A->GetConnectionSettings(0, NULL, &buffersize); if (FAILED(hr)) { if (hr == DPERR_NOTLOBBIED) { - mprintf((0, "Application not started from a lobby.\n")); + mprintf(0, "Application not started from a lobby.\n"); lpDirectPlayLobby3A->Release(); lpDirectPlayLobby3A = NULL; return false; } - mprintf((0, "Unable to determine DirectPlay lobby connection info buffer size!!!\n")); + mprintf(0, "Unable to determine DirectPlay lobby connection info buffer size!!!\n"); lpDirectPlayLobby3A->Release(); lpDirectPlayLobby3A = NULL; return false; @@ -1004,21 +1006,21 @@ bool dp_DidLobbyLaunchGame() { lpDirectPlayLobby3A->Release(); lpDirectPlayLobby3A = NULL; if (FAILED(hr)) { - mprintf((0, "IDirectPlayLobby3::GetConnectionSettings() failed.\n")); + mprintf(0, "IDirectPlayLobby3::GetConnectionSettings() failed.\n"); if (hr == DPERR_NOTLOBBIED) { - mprintf((0, "Application not started from a lobby.\n")); + mprintf(0, "Application not started from a lobby.\n"); return false; } else { - mprintf((0, "Unknown error from IDirectPlayLobby3::GetConnectionSettings().\n")); + mprintf(0, "Unknown error from IDirectPlayLobby3::GetConnectionSettings().\n"); return false; } } else { - mprintf((0, "Application was started from a lobby.\n")); + mprintf(0, "Application was started from a lobby.\n"); Directplay_lobby_launched_game = true; return true; } } else { - mprintf((0, "IDirectPlayLobby3 CoCreateInstance() failed.\n")); + mprintf(0, "IDirectPlayLobby3 CoCreateInstance() failed.\n"); } return false; } diff --git a/networking/networking.cpp b/networking/networking.cpp index d668cf02..46a79467 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -534,7 +534,7 @@ void CloseNetworking() { NetDebugFile = NULL; } - mprintf((0, "Shutting down networking...\n")); + mprintf(0, "Shutting down networking...\n"); #ifdef WIN32 WSACancelBlockingCall(); @@ -551,7 +551,7 @@ void CloseNetworking() { } #ifdef WIN32 if (WSACleanup()) { - mprintf((0, "Error closing wsock!\n")); + mprintf(0, "Error closing wsock!\n"); } #endif @@ -614,7 +614,7 @@ void nw_InitNetworking(int iReadBufSizeOverride) { if (!dp_DidLobbyLaunchGame()) { // Tell direct play about this game char *p = GetCommandLine(); - mprintf((0, "Command line: %s\n", p)); + mprintf(0, "Command line: %s\n", p); parmlen = strlen(p); int a; @@ -650,10 +650,10 @@ void nw_InitNetworking(int iReadBufSizeOverride) { int error = 0; #endif if (error != 0) { - mprintf((0, "There was an error initializing networking! Error=%d\n", error)); + mprintf(0, "There was an error initializing networking! Error=%d\n", error); return; } else { - mprintf((0, "Network initted successfully!\n")); + mprintf(0, "Network initted successfully!\n"); Network_initted = 1; atexit(CloseNetworking); } @@ -681,7 +681,7 @@ void nw_SetSocketOptions(SOCKET sock) { error = ioctl(sock, FIONBIO, &arg); #endif if (error == SOCKET_ERROR) { - mprintf((0, "Unable to make socket non-blocking -- %d", WSAGetLastError())); + mprintf(0, "Unable to make socket non-blocking -- %d", WSAGetLastError()); } // try and increase the size of my receive buffer @@ -703,7 +703,7 @@ void nw_SetSocketOptions(SOCKET sock) { break; } getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (LPSTR)&cursize, &cursizesize); - mprintf((0, "Receive buffer set to %d\n", cursize)); + mprintf(0, "Receive buffer set to %d\n", cursize); /* // set the current size of the send buffer bufsize = MAX_RECEIVE_BUFSIZE/4; @@ -724,7 +724,7 @@ void nw_SetSocketOptions(SOCKET sock) { break; } getsockopt(sock, SOL_SOCKET, SO_SNDBUF, (LPSTR)&cursize, &cursizesize); - mprintf((0, "Send buffer set to %d\n", cursize)); + mprintf(0, "Send buffer set to %d\n", cursize); */ } @@ -762,14 +762,14 @@ void nw_InitSockets(uint16_t port) { sock_addr.sin_port = htons(port); if (bind(TCP_socket, (SOCKADDR *)&sock_addr, sizeof(sock_addr)) == SOCKET_ERROR) { - mprintf((0, "Couldn't bind TCP socket (%d)! Invalidating TCP\n", WSAGetLastError())); + mprintf(0, "Couldn't bind TCP socket (%d)! Invalidating TCP\n", WSAGetLastError()); goto tcp_done; } nw_SetSocketOptions(TCP_socket); TCP_active = 1; } else { - mprintf((0, "Cannot create TCP socket (%d)!\n", WSAGetLastError())); + mprintf(0, "Cannot create TCP socket (%d)!\n", WSAGetLastError()); } tcp_done: @@ -782,7 +782,7 @@ tcp_done: int wserr; wserr = WSAGetLastError(); if ((wserr == WSAENOPROTOOPT) || (wserr == WSAEINVAL)) { - mprintf((0, "Unable to make socket broadcastable!")); + mprintf(0, "Unable to make socket broadcastable!"); Int3(); // Get Kevin } @@ -791,7 +791,7 @@ tcp_done: Sockets_initted = 1; if (TCP_active) - mprintf((0, "TCP Initialized\n")); + mprintf(0, "TCP Initialized\n"); nw_psnet_buffer_init(); nw_RegisterCallback((NetworkReceiveCallback)nw_HandleUnreliableData, NWT_UNRELIABLE); @@ -812,7 +812,7 @@ void nw_GetMyAddress(network_address *addr) { // get the socket name for the TCP_socket, and put it into My_addr len = sizeof(SOCKADDR_IN); if (getsockname(*Unreliable_socket, (SOCKADDR *)&in_addr, &len) == SOCKET_ERROR) { - mprintf((0, "Unable to get sock name for TCP unreliable socket (%s)\n", WSAGetLastError())); + mprintf(0, "Unable to get sock name for TCP unreliable socket (%s)\n", WSAGetLastError()); return; } @@ -911,7 +911,7 @@ uint16_t nw_CalculateChecksum(void *vptr, int len) { // Sends data on an unreliable socket int nw_Send(network_address *who_to, void *data, int len, int flags) { if (len == 0) { - mprintf((0, "Attempting to send 0 byte network packet in nw_Send()\n")); + mprintf(0, "Attempting to send 0 byte network packet in nw_Send()\n"); Int3(); } if (NetDebugFile) { @@ -985,12 +985,12 @@ int nw_ReceiveReliable(SOCKET socketid, uint8_t *buffer, int max_len) { // nw_WorkReliable(); nw_DoReceiveCallbacks(); if (socketid >= MAXRELIABLESOCKETS) { - mprintf((0, "Invalid socket id passed to nw_NewReceiveReliable() -- %d\n", socketid)); + mprintf(0, "Invalid socket id passed to nw_NewReceiveReliable() -- %d\n", socketid); return -1; } rsocket = &reliable_sockets[socketid]; if ((RNF_CONNECTED != rsocket->status) && (RNF_LIMBO != rsocket->status)) { - mprintf((0, "Can't receive packet because it isn't connected in nw_ReceiveReliable(). socket = %d\n", socketid)); + mprintf(0, "Can't receive packet because it isn't connected in nw_ReceiveReliable(). socket = %d\n", socketid); return 0; } // If the buffer position is the position we are waiting for, fill in @@ -1002,8 +1002,11 @@ int nw_ReceiveReliable(SOCKET socketid, uint8_t *buffer, int max_len) { mem_free(rsocket->rbuffers[i]); rsocket->rbuffers[i] = NULL; rsocket->rsequence[i] = 0; - // mprintf((0,"Found packet for upper layer in nw_ReceiveReliable() %d bytes. - // seq:%d.\n",rsocket->recv_len[i],rsocket->oursequence)); +/* + mprintf(0,"Found packet for upper layer in nw_ReceiveReliable() %d bytes. seq:%d.\n", + rsocket->recv_len[i], + rsocket->oursequence); +*/ rsocket->oursequence++; return rsocket->recv_len[i]; } @@ -1033,7 +1036,7 @@ int nw_CheckListenSocket(network_address *from_addr) { from_addr->connection_type = NP_DIRECTPLAY; id = Pending_dp_conn[i]; Pending_dp_conn[i] = DPID_UNKNOWN; - mprintf((0, "New DirectPlay connection in nw_CheckListenSocket().\n")); + mprintf(0, "New DirectPlay connection in nw_CheckListenSocket().\n"); return id; } } @@ -1048,7 +1051,7 @@ int nw_CheckListenSocket(network_address *from_addr) { if (reliable_sockets[i].status == RNF_CONNECTING) { reliable_sockets[i].status = RNF_CONNECTED; // memcpy(from_addr,&reliable_sockets[i].addr,sizeof(SOCKADDR)); - mprintf((0, "New reliable connection in nw_CheckListenSocket().\n")); + mprintf(0, "New reliable connection in nw_CheckListenSocket().\n"); switch (reliable_sockets[i].connection_type) { case NP_TCP: @@ -1069,7 +1072,7 @@ int nw_CheckListenSocket(network_address *from_addr) { } char dbg_output[50]; nw_GetNumbersFromHostAddress(from_addr, dbg_output); - mprintf((0, "Got address from: %s\n", dbg_output)); + mprintf(0, "Got address from: %s\n", dbg_output); return i; } } @@ -1085,10 +1088,10 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { int send_this_packet = 1; if (length == 0) { - mprintf((0, "Attempting to send 0 byte network packet in nw_SendReliable()\n")); + mprintf(0, "Attempting to send 0 byte network packet in nw_SendReliable()\n"); Int3(); } - // mprintf((0,"Socket id passed to nw_NewSendReliable() -- %d\n",socketid)); + // mprintf(0,"Socket id passed to nw_NewSendReliable() -- %d\n",socketid); if (NetDebugFile) { cfprintf(NetDebugFile, "nw_SendReliable packet of type %d at %f seconds.\n", data[0], timer_GetTime()); @@ -1108,15 +1111,14 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { nw_DoReceiveCallbacks(); if (socketid >= MAXRELIABLESOCKETS) { - mprintf((0, "Invalid socket id passed to nw_NewSendReliable() -- %d\n", socketid)); + mprintf(0, "Invalid socket id passed to nw_NewSendReliable() -- %d\n", socketid); return -1; } rsocket = &reliable_sockets[socketid]; if (rsocket->status != RNF_CONNECTED) { // We can't send because this isn't a connected reliable socket. - mprintf( - (0, "Can't send packet because of status %d in nw_SendReliable(). socket = %d\n", rsocket->status, socketid)); + mprintf(0, "Can't send packet because of status %d in nw_SendReliable(). socket = %d\n", rsocket->status, socketid); return -1; } if (urgent) @@ -1128,7 +1130,7 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { // See if there's room for this data if (sizeof(reliable_net_sendbuffer) < (rsocket->send_len[pnum] + length)) { // Send the previous packet, then use the normal code to generate a new packet - mprintf((0, "Pending reliable packet buffer full, sending packet now.\n")); + mprintf(0, "Pending reliable packet buffer full, sending packet now.\n"); rsocket->waiting_packet_number = -1; use_buffer = pnum; @@ -1149,7 +1151,7 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { send_address.connection_type = NP_TCP; } - // mprintf((0,"Sending reliable packet! Sequence %d\n",send_header.seq)); + // mprintf(0,"Sending reliable packet! Sequence %d\n",send_header.seq); bytesout = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + rsocket->send_len[use_buffer], &send_address); @@ -1161,7 +1163,7 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { } } else { // tack this data on the end of the previous packet - // mprintf((0,"Appending to delayed packet...\n")); + // mprintf(0,"Appending to delayed packet...\n"); ASSERT(rsocket->sbuffers[pnum]); memcpy(rsocket->sbuffers[pnum]->buffer + rsocket->send_len[pnum], data, length); // int msize = mem_size(rsocket->sbuffers[pnum]); @@ -1174,7 +1176,7 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { for (i = 0; i < MAXNETBUFFERS; i++) { use_buffer = -1; if (NULL == rsocket->sbuffers[i]) { - // mprintf((0,"Sending in nw_SendReliable() %d bytes seq=%d.\n",length,rsocket->theirsequence)); + // mprintf(0,"Sending in nw_SendReliable() %d bytes seq=%d.\n",length,rsocket->theirsequence); rsocket->send_len[i] = length; rsocket->sbuffers[i] = (reliable_net_sendbuffer *)mem_malloc(sizeof(reliable_net_sendbuffer)); @@ -1191,14 +1193,19 @@ int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { return length; } } - mprintf((0, "Can't send packet because a buffer overflow nw_SendReliable(). socket = %d\n", socketid)); + mprintf(0, "Can't send packet because a buffer overflow nw_SendReliable(). socket = %d\n", socketid); rsocket->status = RNF_BROKEN; for (i = 0; i < MAXNETBUFFERS; i++) { if (rsocket->sbuffers[i]) { - mprintf((0, "Buffer %d: %d,%d,%d,%d,%d,%d\n", i, rsocket->sbuffers[i]->buffer[0], rsocket->sbuffers[i]->buffer[1], - rsocket->sbuffers[i]->buffer[2], rsocket->sbuffers[i]->buffer[3], rsocket->sbuffers[i]->buffer[4], - rsocket->sbuffers[i]->buffer[5])); + mprintf(0, "Buffer %d: %d,%d,%d,%d,%d,%d\n", + i, + rsocket->sbuffers[i]->buffer[0], + rsocket->sbuffers[i]->buffer[1], + rsocket->sbuffers[i]->buffer[2], + rsocket->sbuffers[i]->buffer[3], + rsocket->sbuffers[i]->buffer[4], + rsocket->sbuffers[i]->buffer[5]); } } @@ -1218,7 +1225,7 @@ void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_typ int ret; reliable_header ack_header; ack_header.type = RNT_ACK; - // mprintf((0,"Sending ACK for sig %d.\n",sig)); + // mprintf(0,"Sending ACK for sig %d.\n",sig); ack_header.data_len = INTEL_SHORT((int16_t)sizeof(uint32_t)); ack_header.send_time = INTEL_FLOAT(time_sent); sig = INTEL_INT(sig); @@ -1319,7 +1326,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { // d3_rcv_addr { // We already have a reliable link to this user, so we will ignore it... - mprintf((0, "Received duplicate connection request. %d\n", i)); + mprintf(0, "Received duplicate connection request. %d\n", i); // reliable_sockets[i].last_packet_received = timer_GetTime(); nw_SendReliableAck(&reliable_sockets[i].addr, INTEL_SHORT(rcv_buff.seq), link_type, INTEL_FLOAT(rcv_buff.send_time)); @@ -1345,13 +1352,13 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { rsocket = &reliable_sockets[i]; rcvaddr = (SOCKADDR_IN *)&rcv_addr; // Int3(); - mprintf((0, "Connect from %s:%d\n", inet_ntoa(rcvaddr->sin_addr), htons(rcvaddr->sin_port))); + mprintf(0, "Connect from %s:%d\n", inet_ntoa(rcvaddr->sin_addr), htons(rcvaddr->sin_port)); break; } } if (i == MAXRELIABLESOCKETS) { // No more connections! - mprintf((0, "Out of incoming reliable connection sockets\n")); + mprintf(0, "Out of incoming reliable connection sockets\n"); // Int3();//See Kevin continue; } @@ -1370,10 +1377,10 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { } } if (NULL == rsocket) { - mprintf((0, "Received reliable data from unconnected client.\n")); + mprintf(0, "Received reliable data from unconnected client.\n"); char addrstr[200]; nw_GetNumbersFromHostAddress(&d3_rcv_addr, addrstr); - mprintf((0, "Received from %s\n", addrstr)); + mprintf(0, "Received from %s\n", addrstr); continue; } rsocket->last_packet_received = timer_GetTime(); @@ -1388,21 +1395,21 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { *acknum = INTEL_INT(*acknum); if (*acknum == (~CONNECTSEQ & 0xffff)) { rsocket->status = RNF_CONNECTED; - mprintf((0, "Got ACK for IAMHERE!\n")); + mprintf(0, "Got ACK for IAMHERE!\n"); } continue; } } else if (rcv_buff.type == RNT_I_AM_HERE) { rsocket->status = RNF_CONNECTING; nw_SendReliableAck(&rsocket->addr, INTEL_SHORT(rcv_buff.seq), link_type, INTEL_FLOAT(rcv_buff.send_time)); - mprintf((0, "Got IAMHERE!\n")); + mprintf(0, "Got IAMHERE!\n"); continue; } } if ((rcv_buff.type == RNT_DATA) && (serverconn != -1)) { rsocket->status = RNF_CONNECTED; } else { - // mprintf((0,"Packet from nonconnected socket -- seq: %d status: %d\n",rcv_buff.seq,rsocket->status)); + // mprintf(0,"Packet from nonconnected socket -- seq: %d status: %d\n",rcv_buff.seq,rsocket->status); rsocket->last_packet_received = timer_GetTime(); continue; } @@ -1418,7 +1425,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { rsocket->num_ping_samples++; rsocket->pings[rsocket->ping_pos] = rsocket->last_packet_received - INTEL_FLOAT(rcv_buff.send_time); - // mprintf((0,"ping time: %f\n",rsocket->pings[rsocket->ping_pos])); + // mprintf(0,"ping time: %f\n",rsocket->pings[rsocket->ping_pos]); if (rsocket->num_ping_samples >= MAX_PING_HISTORY) { float sort_ping[MAX_PING_HISTORY]; for (int a = 0; a < MAX_PING_HISTORY; a++) @@ -1426,7 +1433,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { qsort(sort_ping, MAX_PING_HISTORY, sizeof(float), nw_PingCompare); rsocket->mean_ping = ((sort_ping[MAX_PING_HISTORY / 2] + sort_ping[(MAX_PING_HISTORY / 2) + 1])) / 2; - // mprintf_at((2,i+1,0,"Ping: %f ",rsocket->mean_ping)); + // mprintf_at(2,i+1,0,"Ping: %f ",rsocket->mean_ping); } rsocket->ping_pos++; if (rsocket->ping_pos >= MAX_PING_HISTORY) { @@ -1438,7 +1445,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { if (rsocket) if (rsocket->sbuffers[i]) if (rsocket->ssequence[i] == *acksig) { - // mprintf((0,"Received ACK %d\n",*acksig)); + // mprintf(0,"Received ACK %d\n",*acksig); mem_free(rsocket->sbuffers[i]); rsocket->sbuffers[i] = NULL; rsocket->ssequence[i] = 0; @@ -1462,7 +1469,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { if (seqdelta < 0) seqdelta = seqdelta * -1; if (seqdelta >= MAXNETBUFFERS - 1) { - mprintf((0, "Received reliable packet out of order!\n")); + mprintf(0, "Received reliable packet out of order!\n"); // It's out of order, so we won't ack it, which will mean we will get it again soon. continue; } @@ -1471,14 +1478,14 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { if (rsocket->oursequence < (0xffff - (MAXNETBUFFERS - 1))) { if (rsocket->oursequence > INTEL_SHORT(rcv_buff.seq)) { - mprintf((0, "Received old packet with seq of %d\n", INTEL_SHORT(rcv_buff.seq))); + mprintf(0, "Received old packet with seq of %d\n", INTEL_SHORT(rcv_buff.seq)); savepacket = 0; } } else { // Sequence is high, so prepare for wrap around if (((uint16_t)(INTEL_SHORT(rcv_buff.seq) + rsocket->oursequence)) > (MAXNETBUFFERS - 1)) { - mprintf((0, "Received old packet with seq of %d\n", INTEL_SHORT(rcv_buff.seq))); + mprintf(0, "Received old packet with seq of %d\n", INTEL_SHORT(rcv_buff.seq)); savepacket = 0; } } @@ -1486,14 +1493,14 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { for (i = 0; i < MAXNETBUFFERS; i++) { if ((NULL != rsocket->rbuffers[i]) && (rsocket->rsequence[i] == INTEL_SHORT(rcv_buff.seq))) { // Received duplicate packet! - mprintf((0, "Received duplicate packet!\n")); + mprintf(0, "Received duplicate packet!\n"); savepacket = 0; } } if (savepacket) { for (i = 0; i < MAXNETBUFFERS; i++) { if (NULL == rsocket->rbuffers[i]) { - // mprintf((0,"Got good data seq: %d\n",rcv_buff.seq)); + // mprintf(0,"Got good data seq: %d\n",rcv_buff.seq); if (INTEL_SHORT(rcv_buff.data_len) > max_len) rsocket->recv_len[i] = max_len; // INTEL_SHORT(rcv_buff.data_len); else @@ -1501,7 +1508,7 @@ void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { rsocket->rbuffers[i] = (reliable_net_rcvbuffer *)mem_malloc(sizeof(reliable_net_rcvbuffer)); memcpy(rsocket->rbuffers[i]->buffer, rcv_buff.data, rsocket->recv_len[i]); rsocket->rsequence[i] = INTEL_SHORT(rcv_buff.seq); - // mprintf((0,"Adding packet to receive buffer in nw_ReceiveReliable().\n")); + // mprintf(0,"Adding packet to receive buffer in nw_ReceiveReliable().\n"); break; } } @@ -1528,7 +1535,7 @@ void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_ad inaddr->sin_port = htons(server_addr->port); } - mprintf((0, "Got a connect response!\n")); + mprintf(0, "Got a connect response!\n"); if (ack_header.type == RNT_ACK) { int *acknum = (int *)&ack_header.data; if (INTEL_INT(*acknum) == CONNECTSEQ) { @@ -1546,7 +1553,7 @@ void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_ad Net_connect_socket_id = i; reliable_sockets[i].last_sent = timer_GetTime(); reliable_sockets[i].waiting_packet_number = -1; - mprintf((0, "Succesfully connected to server in nw_ConnectToServer().\n")); + mprintf(0, "Succesfully connected to server in nw_ConnectToServer().\n"); // Now send I_AM_HERE packet conn_header.type = RNT_I_AM_HERE; conn_header.seq = INTEL_SHORT((int16_t)(~CONNECTSEQ)); @@ -1563,7 +1570,7 @@ void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_ad Net_connect_socket_id = INVALID_SOCKET; reliable_sockets[i].status = RNF_UNUSED; memset(&reliable_sockets[i], 0, sizeof(reliable_socket)); - mprintf((0, "Unable to send packet in nw_ConnectToServer()\n")); + mprintf(0, "Unable to send packet in nw_ConnectToServer()\n"); Net_connect_sequence = R_NET_SEQUENCE_FAILED; return; @@ -1582,19 +1589,19 @@ void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_ad return; } } - mprintf((0, "Out of reliable socket space in nw_ConnectToServer().\n")); + mprintf(0, "Out of reliable socket space in nw_ConnectToServer().\n"); Net_connect_sequence = R_NET_SEQUENCE_FAILED; return; } // else //{ - // mprintf((0,"Received a reliable packet from a server other than the current server\n")); + // mprintf(0,"Received a reliable packet from a server other than the current server\n"); //} } else { - mprintf((0, "Received out of sequence ACK in nw_ConnectToServer().\n")); + mprintf(0, "Received out of sequence ACK in nw_ConnectToServer().\n"); } } else { - mprintf((0, "Received something that isn't an ACK in nw_ConnectToServer().\n")); + mprintf(0, "Received something that isn't an ACK in nw_ConnectToServer().\n"); } } @@ -1636,7 +1643,7 @@ void nw_ConnectToServer(SOCKET *socket, network_address *server_addr) { int ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); if (SOCKET_ERROR == ret) { - mprintf((0, "Unable to send packet in nw_ConnectToServer()! -- %d\n", WSAGetLastError())); + mprintf(0, "Unable to send packet in nw_ConnectToServer()! -- %d\n", WSAGetLastError()); return; } @@ -1653,12 +1660,12 @@ void nw_ConnectToServer(SOCKET *socket, network_address *server_addr) { return; } if ((timer_GetTime() - time_sent_req) > 2) { - mprintf((0, "Resending connect request.\n")); + mprintf(0, "Resending connect request.\n"); int ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); if (ret != SOCKET_ERROR) { time_sent_req = timer_GetTime(); } else { - mprintf((0, "Error sending connection request! -- %d\n", WSAGetLastError())); + mprintf(0, "Error sending connection request! -- %d\n", WSAGetLastError()); } } @@ -1676,14 +1683,14 @@ void nw_CloseSocket(SOCKET *sockp) { #endif if (*sockp >= MAXRELIABLESOCKETS) { - mprintf((0, "Invalid socket id passed to nw_NewCloseSocket() -- %d\n", *sockp)); + mprintf(0, "Invalid socket id passed to nw_NewCloseSocket() -- %d\n", *sockp); return; } if (reliable_sockets[*sockp].status == RNF_UNUSED) { - mprintf((0, "Trying to close an unused socket (%d) -- ignoring request.\n", *sockp)); + mprintf(0, "Trying to close an unused socket (%d) -- ignoring request.\n", *sockp); } - mprintf((0, "Closing socket %d\n", *sockp)); + mprintf(0, "Closing socket %d\n", *sockp); // Go through every buffer and "free it up(tm)" int i; for (i = 0; i < MAXNETBUFFERS; i++) { @@ -1727,7 +1734,7 @@ int nw_CheckReliableSocket(int socknum) { return true; } if (socknum >= MAXRELIABLESOCKETS) { - mprintf((0, "Invalid socket id passed to nw_CheckReliableSocket() -- %d\n", socknum)); + mprintf(0, "Invalid socket id passed to nw_CheckReliableSocket() -- %d\n", socknum); return 0; } switch (reliable_sockets[socknum].status) { @@ -1859,7 +1866,7 @@ void nw_psnet_buffer_packet(uint8_t *data, int length, network_address *from) { // if we didn't find the buffer, report an overrun if (!found_buf) { - mprintf((0, "WARNING - Buffer overrun in psnet\n")); + mprintf(0, "WARNING - Buffer overrun in psnet\n"); } else { // copy in the data memcpy(Psnet_buffers[idx].data, data, length); @@ -2003,21 +2010,21 @@ uint32_t psnet_ras_status() { // JAS: My computer gets to this point, but I have no RAS connections, // so just exit if (num_connections < 1) { - mprintf((0, "Found no RAS connections\n")); + mprintf(0, "Found no RAS connections\n"); FreeLibrary(ras_handle); return INADDR_ANY; } - mprintf((0, "Found %d connections\n", num_connections)); + mprintf(0, "Found %d connections\n", num_connections); for (i = 0; i < num_connections; i++) { RASCONNSTATUS status; DWORD size; - mprintf((0, "Connection %d:\n", i)); - mprintf((0, "Entry Name: %s\n", rasbuffer[i].szEntryName)); - mprintf((0, "Device Type: %s\n", rasbuffer[i].szDeviceType)); - mprintf((0, "Device Name: %s\n", rasbuffer[i].szDeviceName)); + mprintf(0, "Connection %d:\n", i); + mprintf(0, "Entry Name: %s\n", rasbuffer[i].szEntryName); + mprintf(0, "Device Type: %s\n", rasbuffer[i].szDeviceType); + mprintf(0, "Device Name: %s\n", rasbuffer[i].szDeviceName); // get the connection status status.dwSize = sizeof(RASCONNSTATUS); @@ -2027,7 +2034,7 @@ uint32_t psnet_ras_status() { return INADDR_ANY; } - mprintf((0, "\tStatus: %s\n", (status.rasconnstate == RASCS_Connected) ? "Connected" : "Not Connected")); + mprintf(0, "\tStatus: %s\n", (status.rasconnstate == RASCS_Connected) ? "Connected" : "Not Connected"); // get the projection informatiom size = sizeof(projection); @@ -2038,7 +2045,7 @@ uint32_t psnet_ras_status() { return INADDR_ANY; } - mprintf((0, "\tIP Address: %s\n", projection.szIpAddress)); + mprintf(0, "\tIP Address: %s\n", projection.szIpAddress); } Ras_connected = 1; @@ -2235,9 +2242,9 @@ void CDECLCALL gethostbynameworker(void *parm) async_dns_lookup *lookup = (async_dns_lookup *)parm; - mprintf((0, "IPLOOKUP: Starting threaded lookup ...")); + mprintf(0, "IPLOOKUP: Starting threaded lookup ..."); HOSTENT *he = gethostbyname(lookup->host); - mprintf((0, "IPLOOKUP: Threaded lookup complete.")); + mprintf(0, "IPLOOKUP: Threaded lookup complete."); if (he == NULL) { lookup->error = true; @@ -2248,8 +2255,12 @@ void CDECLCALL gethostbynameworker(void *parm) #endif } else if (!lookup->abort) { memcpy(&lookup->ip, he->h_addr_list[0], sizeof(uint32_t)); - mprintf((0, "IPLOOKUP: [%s] is %d.%d.%d.%d ...", lookup->host, (lookup->ip & 0x000000FF), - (lookup->ip & 0x0000FF00) >> 8, (lookup->ip & 0x00FF0000) >> 16, (lookup->ip & 0xFF000000) >> 24)); + mprintf(0, "IPLOOKUP: [%s] is %d.%d.%d.%d ...", + lookup->host, + (lookup->ip & 0x000000FF), + (lookup->ip & 0x0000FF00) >> 8, + (lookup->ip & 0x00FF0000) >> 16, + (lookup->ip & 0xFF000000) >> 24); // memcpy(&aslu,lookup,sizeof(async_dns_lookup)); lookup->done = true; } @@ -2294,7 +2305,7 @@ int nw_RegisterCallback(NetworkReceiveCallback nfp, uint8_t id) { // rcg06212000 this happens all the time; let it slide. // if(Netcallbacks[id]) //{ - // mprintf((0,"Trying to reregister a callback!\n")); + // mprintf(0,"Trying to reregister a callback!\n"); // Int3(); // Get Kevin! //} @@ -2335,13 +2346,13 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { // cfprintf (NetDebugFile,"nw_SendWithID packet of id=%d type %d at %f // seconds.\n",id,data[0],timer_GetTime()); -// mprintf((0,"Sending packet for id %d.\n",id)); +// mprintf(0,"Sending packet for id %d.\n",id); #ifdef WIN32 if (Use_DirectPlay) return dp_DirectPlaySend(who_to, (uint8_t *)data, len, false); #endif - // mprintf((1, "network: type %d\n", who_to->connection_type)); + // mprintf(1, "network: type %d\n", who_to->connection_type); // send_sock = *Unreliable_socket; switch (who_to->connection_type) { case NP_TCP: @@ -2358,7 +2369,7 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { return 0; break; default: - mprintf((2, "Unknown protocol type in nw_Send()\n")); + mprintf(2, "Unknown protocol type in nw_Send()\n"); Int3(); return 0; } @@ -2379,10 +2390,10 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { int my_comp_ratio = (float) ((float)Uncompressed_outgoing_data_len/(float)Compressed_outgoing_data_len); - mprintf_at((2,1,0,"Compression: %d%% ",my_comp_ratio)); + mprintf_at(2,1,0,"Compression: %d%% ",my_comp_ratio); */ if (!Sockets_initted) { - mprintf((0, "Network ==> Socket not inited in nw_Send\n")); + mprintf(0, "Network ==> Socket not inited in nw_Send\n"); return 0; } @@ -2392,7 +2403,7 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { port = who_to->port; if (port == 0) { - mprintf((0, "Network ==> destination port %d invalid in psnet_send\n", port)); + mprintf(0, "Network ==> destination port %d invalid in psnet_send\n", port); Int3(); return 0; } @@ -2405,7 +2416,7 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { int sock_writable = select(send_sock + 1, NULL, &wfds, NULL, &timeout); if (sock_writable == SOCKET_ERROR) { - mprintf((0, "Error on blocking select for write %d\n", WSAGetLastError())); + mprintf(0, "Error on blocking select for write %d\n", WSAGetLastError()); return 0; } @@ -2439,7 +2450,7 @@ int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { return 0; } - mprintf((0, "Couldn't send data (%d)!\n", lasterr)); + mprintf(0, "Couldn't send data (%d)!\n", lasterr); return 0; } @@ -2466,7 +2477,7 @@ int nw_DoReceiveCallbacks(void) { timeval timeout; if ( select( TCP_socket+1, &rfds, NULL, NULL, &timeout) == SOCKET_ERROR) { - mprintf((0, "Error %d doing a socket select on IP read\n", WSAGetLastError())); + mprintf(0, "Error %d doing a socket select on IP read\n", WSAGetLastError()); break; } @@ -2481,7 +2492,7 @@ int nw_DoReceiveCallbacks(void) { if (read_len == SOCKET_ERROR) { int x = WSAGetLastError(); if (x != WSAEWOULDBLOCK) { - mprintf((0, "Read error on IP socket. Winsock error %d \n", x)); + mprintf(0, "Read error on IP socket. Winsock error %d \n", x); } break; } @@ -2496,7 +2507,7 @@ int nw_DoReceiveCallbacks(void) { #endif uint8_t packet_id = (packet_data[0] & 0x0f); if (Netcallbacks[packet_id]) { - // mprintf((0,"Calling network callback for id %d.\n",packet_id)); + // mprintf(0,"Calling network callback for id %d.\n",packet_id); int rlen = read_len - 1; if (packet_id == NWT_UNRELIABLE) { NetStatistics.udp_total_packets_rec++; @@ -2531,14 +2542,14 @@ void nw_ReliableResend(void) { if (serverconn == -1) { if (rsocket->status == RNF_LIMBO) if ((timer_GetTime() - rsocket->last_packet_received) > NETTIMEOUT) { - mprintf((0, "Reliable (but in limbo) socket (%d) timed out in nw_WorkReliable().\n", j)); + mprintf(0, "Reliable (but in limbo) socket (%d) timed out in nw_WorkReliable().\n", j); memset(rsocket, 0, sizeof(reliable_socket)); rsocket->status = RNF_UNUSED; // Won't work if this is an outgoing connection. } } else { if ((rsocket->status == RNF_LIMBO) && ((timer_GetTime() - first_sent_iamhere) > NETTIMEOUT)) { rsocket->status = RNF_BROKEN; - mprintf((0, "Reliable socket (%d) timed out in nw_WorkReliable().\n", j)); + mprintf(0, "Reliable socket (%d) timed out in nw_WorkReliable().\n", j); } } @@ -2549,10 +2560,10 @@ void nw_ReliableResend(void) { } else { if (rsocket->mean_ping < MIN_NET_RETRYTIME) { retry_packet_time = (float)MIN_NET_RETRYTIME; - // mprintf((0,"Using retransmission time of %f\n",retry_packet_time)); + // mprintf(0,"Using retransmission time of %f\n",retry_packet_time); } else { retry_packet_time = ((float)(float)rsocket->mean_ping * (float)1.25); - // mprintf((0,"Using retransmission time of %f\n",retry_packet_time)); + // mprintf(0,"Using retransmission time of %f\n",retry_packet_time); } } // Iterate through send buffers. @@ -2566,10 +2577,10 @@ void nw_ReliableResend(void) { if (i == rsocket->waiting_packet_number) { rsocket->waiting_packet_number = -1; rsocket->last_sent = timer_GetTime(); - // mprintf((0,"Sending delayed packet...\n")); + // mprintf(0,"Sending delayed packet...\n"); } reliable_header send_header; - // mprintf((0,"Resending reliable packet in nw_WorkReliable().\n")); + // mprintf(0,"Resending reliable packet in nw_WorkReliable().\n"); send_header.send_time = INTEL_FLOAT(timer_GetTime()); send_header.seq = INTEL_SHORT(rsocket->ssequence[i]); memcpy(send_header.data, rsocket->sbuffers[i]->buffer, rsocket->send_len[i]); @@ -2595,7 +2606,7 @@ void nw_ReliableResend(void) { NetStatistics.tcp_total_bytes_resent += len; } - // mprintf((0,"Resending reliable packet! Sequence %d\n",send_header.seq)); + // mprintf(0,"Resending reliable packet! Sequence %d\n",send_header.seq); rcode = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + rsocket->send_len[i], &send_address); @@ -2612,7 +2623,7 @@ void nw_ReliableResend(void) { rsocket->send_urgent = 0; if ((rsocket->status == RNF_CONNECTED) && ((timer_GetTime() - rsocket->last_packet_sent) > NETHEARTBEATTIME)) { reliable_header send_header; - // mprintf((0,"Resending reliable packet in nw_WorkReliable().\n")); + // mprintf(0,"Resending reliable packet in nw_WorkReliable().\n"); send_header.send_time = INTEL_FLOAT(timer_GetTime()); send_header.seq = INTEL_SHORT((int16_t)0); send_header.data_len = INTEL_SHORT((int16_t)0); @@ -2648,7 +2659,7 @@ void nw_ReliableResend(void) { if ((rsocket->status == RNF_CONNECTED) && ((timer_GetTime() - rsocket->last_packet_received) > NETTIMEOUT)) { // This socket is hosed.....inform someone? - mprintf((0, "Reliable Socket (%d) timed out in nw_WorkReliable().\n", j)); + mprintf(0, "Reliable Socket (%d) timed out in nw_WorkReliable().\n", j); rsocket->status = RNF_BROKEN; } } diff --git a/physics/Collide.cpp b/physics/Collide.cpp index dbfa9e40..65fcb345 100644 --- a/physics/Collide.cpp +++ b/physics/Collide.cpp @@ -1157,7 +1157,7 @@ bool collide_weapon_and_wall(object *weapon, fix hitspeed, int hitseg, int hitwa float hit_dot) { bool f_forcefield; bool f_volatile, f_lava, f_water; - // mprintf((0, "Weapon hit wall, how nice.\n")); + // mprintf(0, "Weapon hit wall, how nice.\n"); // #ifndef RELEASE if ((stricmp(Weapons[weapon->id].name, "Yellow flare") == 0) && (weapon->parent_handle == Player_object->handle) && @@ -1548,7 +1548,7 @@ void scrape_object_on_wall(object *obj, int hitseg, int hitwall, vector *hitpt, if (obj->id==Player_num) { int type; - //mprintf((0, "Scraped segment #%3i, side #%i\n", hitseg, hitside)); + //mprintf(0, "Scraped segment #%3i, side #%i\n", hitseg, hitside); if ((type=check_volatile_wall(obj,hitseg,hitside,hitpt))!=0) { vector hit_dir, rand_vec; @@ -1663,8 +1663,8 @@ destroy_primary_weapon(MAX_PRIMARY_WEAPONS); // This means to destroy quad laser // -- removed, 09/06/95, MK -- } else // -- removed, 09/06/95, MK -- destroy_primary_weapon(Primary_weapon); // -- removed, 09/06/95, MK -- } else -// -- removed, 09/06/95, MK -- ; // mprintf((0, "%8x > %8x, so don't lose weapon.\n", -floatmul(Players[Player_num].shields, randnum), damage/4)); +// -- removed, 09/06/95, MK -- ; // mprintf(0, "%8x > %8x, so don't lose weapon.\n", +floatmul(Players[Player_num].shields, randnum), damage/4); // -- removed, 09/06/95, MK -- } playerobj->shields = Players[Player_num].shields; //mirror @@ -1747,14 +1747,14 @@ void ConvertEulerToAxisAmount(vector *e, vector *n, float *w) { // vector f; CollideAnglesToMatrix(&rotmat, e_n.x, e_n.y, e_n.z); - // mprintf((0, "F %f, %f, %f\n", XYZ(&rotmat.fvec))); - // mprintf((0, "R %f, %f, %f\n", XYZ(&rotmat.rvec))); - // mprintf((0, "U %f, %f, %f\n", XYZ(&rotmat.uvec))); + // mprintf(0, "F %f, %f, %f\n", XYZ(&rotmat.fvec)); + // mprintf(0, "R %f, %f, %f\n", XYZ(&rotmat.rvec)); + // mprintf(0, "U %f, %f, %f\n", XYZ(&rotmat.uvec)); // CollideExtractAnglesFromMatrix(&f, &rotmat); - // mprintf((0, "Before %f, %f, %f\n", XYZ(&e_n))); - // mprintf((0, "After %f, %f, %f\n", XYZ(&f))); + // mprintf(0, "Before %f, %f, %f\n", XYZ(&e_n)); + // mprintf(0, "After %f, %f, %f\n", XYZ(&f)); // This is from Graphics Gems 1 p.467 I am converting from a angle vector // to the normal of that rotation (you can also get the angle about that normal, but @@ -2413,7 +2413,7 @@ void collide_generic_and_player(object *robotobj, object *playerobj, vector *col } } - // mprintf((0, "We hit a robot\n")); + // mprintf(0, "We hit a robot\n"); if (robotobj->control_type == CT_AI) { AINotify(robotobj, AIN_BUMPED_OBJ, (void *)playerobj); } @@ -2997,7 +2997,7 @@ bool collide_object_with_wall(object *A, float hitspeed, int hitseg, int hitwall break; default: - mprintf((0, "Unhandled collision of object type %d and wall\n", A->type)); + mprintf(0, "Unhandled collision of object type %d and wall\n", A->type); // Error( "Unhandled object type hit wall in collide.c\n" ); } diff --git a/physics/FindIntersection.cpp b/physics/FindIntersection.cpp index bbbaf0e2..a111b8d0 100644 --- a/physics/FindIntersection.cpp +++ b/physics/FindIntersection.cpp @@ -1220,8 +1220,12 @@ int check_vector_to_sphere_1(vector *intp, float *col_dist, const vector *p0, co // Is the initial p0 position an intersection? If so, warn us and collide immediately. if (point_to_center_vec * point_to_center_vec < sphere_rad * sphere_rad) { if (f_correcting) { - // chrishack mprintf((0, "FVI WARNING: Start point is inside of a checked sphere %f %f\n", - // point_to_center_vec*point_to_center_vec, sphere_rad*sphere_rad)); +/* + // chrishack + mprintf(0, "FVI WARNING: Start point is inside of a checked sphere %f %f\n", + point_to_center_vec * point_to_center_vec, + sphere_rad * sphere_rad); +*/ // chrishack this movement intersection fix is a hack... How do we do correct cylinder/vector interestion? vector n_ptc = point_to_center_vec; vm_NormalizeVector(&n_ptc); @@ -1368,7 +1372,7 @@ int check_vector_to_cylinder(vector *colp, vector *intp, float *col_dist, vector cole_dist[i] = vector_len3d * t[i]; inte[i] = *ep0 + ((ivertex[i] - *ep0) * edgevec) * edgevec; valid_hit = 1; - /// mprintf((0, "%f,%f,%f to %f,%f, %f\n", XYZ(p0), XYZ(p1))); + /// mprintf(0, "%f,%f,%f to %f,%f, %f\n", XYZ(p0), XYZ(p1)); } else { valid_t[i] = 0; } @@ -1381,7 +1385,7 @@ int check_vector_to_cylinder(vector *colp, vector *intp, float *col_dist, vector t[2] = cole_dist[2] / vector_len3d; valid_t[2] = 1; valid_hit = 1; - // mprintf((0, "Sphere %f,%f,%f to %f,%f, %f\n", XYZ(p0), XYZ(p1))); + // mprintf(0, "Sphere %f,%f,%f to %f,%f, %f\n", XYZ(p0), XYZ(p1)); d_vec = *ep1 - ivertex[2]; vm_NormalizeVector(&d_vec); inte[2] = ivertex[2] + rad * (d_vec); @@ -1420,7 +1424,7 @@ int check_vector_to_cylinder(vector *colp, vector *intp, float *col_dist, vector *wall_norm = *intp - *colp; vm_NormalizeVector(wall_norm); - // mprintf((0, "We hit at %f,%f,%f \nwith %f,%f,%f on face\n", XYZ(intp), XYZ(colp))); + // mprintf(0, "We hit at %f,%f,%f \nwith %f,%f,%f on face\n", XYZ(intp), XYZ(colp)); return 1; } else { @@ -1612,7 +1616,7 @@ int check_sphere_to_face(vector *colp, vector *intp, float *col_dist, vector *wa // If we are inside edgemask is 0, we hit the face. if (edgemask == 0) { - // mprintf((0, "CSTF Hit Face\n")); + // mprintf(0, "CSTF Hit Face\n"); *col_dist = vm_VectorDistance(p0, intp); *wall_norm = *face_normal; return IT_FACE; @@ -1661,7 +1665,7 @@ int check_sphere_to_face(vector *colp, vector *intp, float *col_dist, vector *wa cur_dist = edgevec * checkvec; if(cur_dist >= 0 && cur_dist <= edgelen) { -// mprintf((0, "Hit edge\n")); +// mprintf(0, "Hit edge\n"); *wall_norm = *intp - closest_point; vm_NormalizeVector(wall_norm); @@ -1675,7 +1679,7 @@ int check_sphere_to_face(vector *colp, vector *intp, float *col_dist, vector *wa else closest_point = *v1; if(!check_vector_to_sphere_1(intp, col_dist, p0, p1, &closest_point, rad, 1)) return IT_NONE; -// mprintf((0, "Hit point\n")); +// mprintf(0, "Hit point\n"); *wall_norm = *intp - closest_point; vm_NormalizeVector(wall_norm); @@ -1718,7 +1722,7 @@ int check_line_to_face(vector *newp, vector *colp, float *col_dist, vector *wall // if (rad != 0.0) // *colp += *face_normal*(-rad); - // mprintf((0, "Check line to face: segment %d, side %d\n", seg - Segments, side)); + // mprintf(0, "Check line to face: segment %d, side %d\n", seg - Segments, side); // We know that we hit the plane, but did we hit the face (in bounds) return check_sphere_to_face(colp, newp, col_dist, wall_norm, p0, p1, face_normal, nv, rad, vertex_ptr_list); @@ -1787,7 +1791,7 @@ int check_vector_to_object(vector *intp, float *col_dist, vector *p0, vector *p1 #ifdef _DEBUG if (Physics_player_verbose) { if (Player_object == &Objects[fvi_objnum]) { - mprintf((0, "FVI: Earily exit on %d\n", OBJNUM(still_obj))); + mprintf(0, "FVI: Earily exit on %d\n", OBJNUM(still_obj)); } } #endif @@ -1803,9 +1807,9 @@ int check_vector_to_object(vector *intp, float *col_dist, vector *p0, vector *p1 if (total_size <= 0.0f) { #ifdef _DEBUG if (fvi_objnum >= 0) - mprintf((0, "Get Chris: type %d and type %d are zero radius\n", still_obj->type, Objects[fvi_objnum].type)); + mprintf(0, "Get Chris: type %d and type %d are zero radius\n", still_obj->type, Objects[fvi_objnum].type); else - mprintf((0, "Get Chris: A non-object tried to hit a zero radii object of type %d\n", still_obj->type)); + mprintf(0, "Get Chris: A non-object tried to hit a zero radii object of type %d\n", still_obj->type); #endif return 0; } @@ -2345,7 +2349,7 @@ internal_try_again: new_pos.x -= 10000000.0f; min_xyz.x -= 10000000.0f; } - // mprintf((0, "Checking room %d ", ROOMNUM(cur_room))); + // mprintf(0, "Checking room %d ", ROOMNUM(cur_room)); // sort shit uint8_t msector = 0; @@ -2445,7 +2449,7 @@ internal_try_again: if (closest_hit_type != HIT_WALL) { f_in_room = false; - // mprintf((0, " in room bool = %d, hit_type = %d\n", (int) f_in_room, closest_hit_type)); + // mprintf(0, " in room bool = %d, hit_type = %d\n", (int) f_in_room, closest_hit_type); } if (!f_in_room && !try_again) { @@ -2553,9 +2557,12 @@ void make_trigger_face_list(int last_sim_faces) { for (count = 0; count < cur_room->faces[i].num_verts; count++) vertex_ptr_list[count] = &cur_room->verts[cur_room->faces[i].face_verts[count]]; - - // mprintf((0, "FVI:In trigger %f to %f crossed %f\n", fvi_query_ptr->p0->z, fvi_hit_data_ptr->hit_pnt.z, - // vertex_ptr_list[0]->z)); +/* + mprintf(0, "FVI:In trigger %f to %f crossed %f\n", + fvi_query_ptr->p0->z, + fvi_hit_data_ptr->hit_pnt.z, + vertex_ptr_list[0]->z); +*/ face_normal = cur_room->faces[i].normal; @@ -2564,7 +2571,7 @@ void make_trigger_face_list(int last_sim_faces) { &face_normal, vertex_ptr_list, cur_room->faces[i].num_verts, 0.0f); if (face_hit_type) { - // mprintf((0, "FVI:hit trigger\n")); + // mprintf(0, "FVI:hit trigger\n"); Fvi_recorded_faces[num_real_collisions].face_index = i; Fvi_recorded_faces[num_real_collisions++].room_index = Fvi_recorded_faces[x].room_index; } @@ -2622,8 +2629,11 @@ int fvi_FindIntersection(fvi_query *fq, fvi_info *hit_data, bool no_subdivision) #ifndef NED_PHYSICS if (Tracking_FVI) { - mprintf((0, "Track FVI - Ray %d, thisobjnum=%d, startroom=%d, rad=%f\n", FVI_counter, fq->thisobjnum, fq->startroom, - fq->rad)); + mprintf(0, "Track FVI - Ray %d, thisobjnum=%d, startroom=%d, rad=%f\n", + FVI_counter, + fq->thisobjnum, + fq->startroom, + fq->rad); } #endif @@ -2662,8 +2672,8 @@ int fvi_FindIntersection(fvi_query *fq, fvi_info *hit_data, bool no_subdivision) fvi_movement_delta = *fq->p1 - *fq->p0; - // mprintf((0, "FVI:----New search----\n")); - // mprintf((0, "FVI: P0 is %f, %f, %f\n", XYZ(fq->p0))); + // mprintf(0, "FVI:----New search----\n"); + // mprintf(0, "FVI: P0 is %f, %f, %f\n", XYZ(fq->p0)); if (fq->flags & FQ_NEW_RECORD_LIST) { Fvi_num_recorded_faces = 0; } @@ -2769,14 +2779,13 @@ int fvi_FindIntersection(fvi_query *fq, fvi_info *hit_data, bool no_subdivision) for (i = 0; i < num_subdivisions; i++) { fvi_new_query.startroom = GetTerrainRoomFromPos(&new_p0); - // mprintf((0, "S %d F %f,%f,%f to %f,%f,%f\n", i, XYZ(&new_p0), XYZ(&new_p1))); + // mprintf(0, "S %d F %f,%f,%f to %f,%f,%f\n", i, XYZ(&new_p0), XYZ(&new_p1)); s_hit_type = fvi_FindIntersection(&fvi_new_query, &fvi_new_hit_data, true); fvi_new_query.flags &= (~FQ_NEW_RECORD_LIST); if (s_hit_type != HIT_NONE) { - // mprintf((0, "Hit %d at %f, %f, %f\n", s_hit_type, - // XYZ(&fvi_new_hit_data.hit_pnt))); + //mprintf(0, "Hit %d at %f, %f, %f\n", s_hit_type, XYZ(&fvi_new_hit_data.hit_pnt)); break; } @@ -2858,7 +2867,7 @@ int fvi_FindIntersection(fvi_query *fq, fvi_info *hit_data, bool no_subdivision) hit_data->hit_type[0] = HIT_OUT_OF_TERRAIN_BOUNDS; } } else if (!f_found_room) { - // mprintf((0, "Attempting to patch\n")); + // mprintf(0, "Attempting to patch\n"); for (i = 0; i < fvi_num_rooms_visited && !f_found_room; i++) { if (!(Rooms[fvi_rooms_visited[i]].flags & RF_EXTERNAL)) if (fvi_QuickRoomCheck(&hit_data->hit_pnt, &Rooms[fvi_rooms_visited[i]]), true) { @@ -3038,13 +3047,13 @@ bool BBoxPlaneIntersection(bool fast_exit, vector *collision_point, vector *coll (obj->orient.fvec * pm->maxs.z); -// mprintf((0, "START\n")); +// mprintf(0, "START\n"); for(i = 0; i < 8; i++) { verts[i] += *new_pos; -// mprintf((0, "%f %f %f\n", XYZ(&verts[i]))); +// mprintf(0, "%f %f %f\n", XYZ(&verts[i])); } -// mprintf((0, "END\n")); +// mprintf(0, "END\n"); norms[0] = obj->orient.rvec; norms[1] = obj->orient.fvec; @@ -3096,7 +3105,7 @@ bool BBoxPlaneIntersection(bool fast_exit, vector *collision_point, vector *coll if((found) && (!check_point_to_face(&plane_pnt, face_normal, nv, vertex_ptr_list))) { // we hit it -// mprintf((0, "BBOX Collided with a plane\n")); +// mprintf(0, "BBOX Collided with a plane\n"); if(fast_exit) return true; @@ -3158,7 +3167,7 @@ bool BBoxPlaneIntersection(bool fast_exit, vector *collision_point, vector *coll if (!check_point_to_face(&plane_pnt, &norms[j], 4, bbox_vertex_ptr_list)) { // we hit it - // mprintf((0, "BBOX Collided with a plane\n")); + // mprintf(0, "BBOX Collided with a plane\n"); if(fast_exit) return true; int_faces |= (0x01 << j); @@ -3310,7 +3319,7 @@ bool BBoxPlaneIntersection(bool fast_exit, vector *collision_point, vector *coll *collision_point /= (float)(num_int_box); *collision_normal = xxx_normal; - // mprintf((0, "BBox %d hits\n", num_int_box)); + // mprintf(0, "BBox %d hits\n", num_int_box); return true; } @@ -3357,9 +3366,9 @@ void check_hit_obj(int objnum) { #ifdef _DEBUG if (Physics_player_verbose) { if (OBJNUM(Player_object) == objnum && m_obj_index != -1) { - mprintf((0, "FVI: %d AABB with player\n", m_obj_index)); + mprintf(0, "FVI: %d AABB with player\n", m_obj_index); } else if (Player_object == m_obj) { - mprintf((0, "FVI: Player AABB with %d\n", objnum)); + mprintf(0, "FVI: Player AABB with %d\n", objnum); } } #endif @@ -3598,7 +3607,7 @@ void check_hit_obj(int objnum) { } break; default: { - mprintf((0, "Collision of type %d is not programmed yet", collision_type)); + mprintf(0, "Collision of type %d is not programmed yet", collision_type); } break; } } else { @@ -3606,7 +3615,7 @@ void check_hit_obj(int objnum) { #ifdef _DEBUG if (Physics_player_verbose) { if (OBJNUM(Player_object) == objnum || Player_object == m_obj) { - mprintf((0, "Related\n")); + mprintf(0, "Related\n"); } } #endif @@ -3617,7 +3626,7 @@ void check_hit_obj(int objnum) { #ifdef _DEBUG if (Physics_player_verbose) { if (OBJNUM(Player_object) == objnum || Player_object == m_obj) { - mprintf((0, "Ignore list\n")); + mprintf(0, "Ignore list\n"); } } #endif @@ -3631,7 +3640,7 @@ void check_hit_obj(int objnum) { if (Physics_player_verbose) { if (objnum != m_obj_index) { if (OBJNUM(Player_object) == objnum || Player_object == m_obj) { - mprintf((0, "Result nothing %d %d\n", objnum, m_obj_index)); + mprintf(0, "Result nothing %d %d\n", objnum, m_obj_index); } } } @@ -3643,7 +3652,7 @@ void check_hit_obj(int objnum) { #ifdef _DEBUG if (Physics_player_verbose) { if (OBJNUM(Player_object) == objnum || Player_object == m_obj) { - mprintf((0, "Dead %d %d\n", objnum, m_obj_index)); + mprintf(0, "Dead %d %d\n", objnum, m_obj_index); } } #endif @@ -3950,77 +3959,76 @@ inline void check_terrain_node(int cur_node, bool f_check_local_nodes, bool f_ch check_line_to_face(&hit_point, &colp, &cur_dist, &wall_norm, fvi_query_ptr->p0, &fvi_hit_data_ptr->hit_pnt, &face_normal, vertex_ptr_list, 3, fvi_query_ptr->rad); } +/* + if(Objects[fvi_query_ptr->thisobjnum].type == OBJ_CLUTTER) { + mprintf(0, "Y = %f\n", Objects[fvi_query_ptr->thisobjnum].pos.y); + } +*/ - // if(Objects[fvi_query_ptr->thisobjnum].type == OBJ_CLUTTER) mprintf((0, "Y = - //%f\n", Objects[fvi_query_ptr->thisobjnum].pos.y)); - // // chrisnote - closest hit should be tracked... So, we can call BBPI once with // false and all other times with true for fast exit. - /* if(this_obj && this_obj->type == OBJ_CLUTTER) - { - if(!BBoxPlaneIntersection(true, &fvi_hit_data_ptr->hit_face_pnt[0], - &fvi_hit_data_ptr->hit_wallnorm[0], &Objects[fvi_query_ptr->thisobjnum], fvi_query_ptr->p0, 3, vertex_ptr_list, - &face_normal, fvi_query_ptr->o_orient, fvi_query_ptr->o_rotvel, fvi_query_ptr->o_velocity)) ASSERT(1); +#if 0 + if (this_obj && this_obj->type == OBJ_CLUTTER) { + if (!BBoxPlaneIntersection(true, &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], + &Objects[fvi_query_ptr->thisobjnum], fvi_query_ptr->p0, 3, vertex_ptr_list, + &face_normal, fvi_query_ptr->o_orient, fvi_query_ptr->o_rotvel, + fvi_query_ptr->o_velocity)) + ASSERT(1); - if(fvi_hit_data_ptr->hit_type[0] == HIT_NONE && - BBoxPlaneIntersection(false, &fvi_hit_data_ptr->hit_face_pnt[0], - &fvi_hit_data_ptr->hit_wallnorm[0], &Objects[fvi_query_ptr->thisobjnum], &fvi_hit_data_ptr->hit_pnt, 3, - vertex_ptr_list, &face_normal, &fvi_hit_data_ptr->hit_orient, &fvi_hit_data_ptr->hit_rotvel, - &fvi_hit_data_ptr->hit_velocity)) - { - float hit_dist = 0.0; - float hit_interval; - vector movement_dir; + if (fvi_hit_data_ptr->hit_type[0] == HIT_NONE && + BBoxPlaneIntersection(false, &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], + &Objects[fvi_query_ptr->thisobjnum], &fvi_hit_data_ptr->hit_pnt, 3, vertex_ptr_list, + &face_normal, &fvi_hit_data_ptr->hit_orient, &fvi_hit_data_ptr->hit_rotvel, + &fvi_hit_data_ptr->hit_velocity)) { + float hit_dist = 0.0; + float hit_interval; + vector movement_dir; - if(!BBoxPlaneIntersection(false, - &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], &Objects[fvi_query_ptr->thisobjnum], - fvi_query_ptr->p0, 3, vertex_ptr_list, &face_normal, fvi_query_ptr->o_orient, fvi_query_ptr->o_rotvel, - fvi_query_ptr->o_velocity)) - { - movement_dir = fvi_hit_data_ptr->hit_pnt - - *fvi_query_ptr->p0; hit_interval = vm_NormalizeVector(&movement_dir); + if (!BBoxPlaneIntersection(false, &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], + &Objects[fvi_query_ptr->thisobjnum], fvi_query_ptr->p0, 3, vertex_ptr_list, + &face_normal, fvi_query_ptr->o_orient, fvi_query_ptr->o_rotvel, + fvi_query_ptr->o_velocity)) { + movement_dir = fvi_hit_data_ptr->hit_pnt - *fvi_query_ptr->p0; + hit_interval = vm_NormalizeVector(&movement_dir); - DoLinearApprox(&fvi_hit_data_ptr->hit_face_pnt[0], - &fvi_hit_data_ptr->hit_wallnorm[0], &hit_dist, &hit_interval, &movement_dir, fvi_query_ptr->p0, - &Objects[fvi_query_ptr->thisobjnum], 3, vertex_ptr_list, &face_normal); + DoLinearApprox(&fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], &hit_dist, + &hit_interval, &movement_dir, fvi_query_ptr->p0, &Objects[fvi_query_ptr->thisobjnum], 3, + vertex_ptr_list, &face_normal); - fvi_collision_dist = hit_dist; - } - else - { - fvi_hit_data_ptr->hit_orient = *fvi_query_ptr->o_orient; - fvi_hit_data_ptr->hit_rotvel = *fvi_query_ptr->o_rotvel; - fvi_hit_data_ptr->hit_turnroll = - *fvi_query_ptr->o_turnroll; fvi_hit_data_ptr->hit_pnt = *fvi_query_ptr->p0; + fvi_collision_dist = hit_dist; + } else { + fvi_hit_data_ptr->hit_orient = *fvi_query_ptr->o_orient; + fvi_hit_data_ptr->hit_rotvel = *fvi_query_ptr->o_rotvel; + fvi_hit_data_ptr->hit_turnroll = *fvi_query_ptr->o_turnroll; + fvi_hit_data_ptr->hit_pnt = *fvi_query_ptr->p0; - fvi_collision_dist = 0.0; - movement_dir = Zero_vector; - hit_dist = 0.0f; - } + fvi_collision_dist = 0.0; + movement_dir = Zero_vector; + hit_dist = 0.0f; + } - fvi_hit_data_ptr->hit_type[0] = HIT_TERRAIN; - fvi_hit_data_ptr->hit_wallnorm[0].x = 0.0; - fvi_hit_data_ptr->hit_wallnorm[0].y = 1.0; - fvi_hit_data_ptr->hit_wallnorm[0].z = 0.0; - // fvi_hit_data_ptr->hit_seg = -1; -- set in the - fvi_FindIntersection function - // fvi_hit_data_ptr->hit_pnt = *fvi_query_ptr->p0 + - hit_dist*movement_dir; fvi_hit_data_ptr->hit_face[0] = i; fvi_hit_data_ptr->hit_face_room[0] = cur_node; - // fvi_hit_data_ptr->hit_side_pnt = fvi_hit_data_ptr->hit_pnt; - // fvi_hit_data_ptr->hit_side_pnt.y = fvi_query_ptr->p0->y - - Objects[fvi_query_ptr->thisobjnum].size; - - // if(!BBoxPlaneIntersection(true, - &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], &Objects[fvi_query_ptr->thisobjnum], - &fvi_hit_data_ptr->hit_pnt, 3, vertex_ptr_list, &face_normal, &fvi_hit_data_ptr->hit_orient, - &fvi_hit_data_ptr->hit_rotvel, &fvi_hit_data_ptr->hit_rotvel)) - // ASSERT(1); - - goto ignore_hit; - } - } - */ + fvi_hit_data_ptr->hit_type[0] = HIT_TERRAIN; + fvi_hit_data_ptr->hit_wallnorm[0].x = 0.0; + fvi_hit_data_ptr->hit_wallnorm[0].y = 1.0; + fvi_hit_data_ptr->hit_wallnorm[0].z = 0.0; + // fvi_hit_data_ptr->hit_seg = -1; -- set in the fvi_FindIntersection function + // fvi_hit_data_ptr->hit_pnt = *fvi_query_ptr->p0 + hit_dist *movement_dir; + fvi_hit_data_ptr->hit_face[0] = i; + fvi_hit_data_ptr->hit_face_room[0] = cur_node; + // fvi_hit_data_ptr->hit_side_pnt = fvi_hit_data_ptr->hit_pnt; + // fvi_hit_data_ptr->hit_side_pnt.y = fvi_query_ptr->p0->y - Objects[fvi_query_ptr->thisobjnum].size; +/* + if(!BBoxPlaneIntersection(true, + &fvi_hit_data_ptr->hit_face_pnt[0], &fvi_hit_data_ptr->hit_wallnorm[0], &Objects[fvi_query_ptr->thisobjnum], + &fvi_hit_data_ptr->hit_pnt, 3, vertex_ptr_list, &face_normal, &fvi_hit_data_ptr->hit_orient, + &fvi_hit_data_ptr->hit_rotvel, &fvi_hit_data_ptr->hit_rotvel)) + ASSERT(1); +*/ + goto ignore_hit; + } + } +#endif // If we hit the face... if (face_hit_type) { if (cur_dist <= fvi_collision_dist) { @@ -4368,14 +4376,14 @@ check_big_objs: // Check Big objects for (i = 0; i < Num_big_objects; i++) { ASSERT(BigObjectList[i] >= 0); check_hit_obj(BigObjectList[i]); - // mprintf((0, "CHecking BIG %d\n", i)); + // mprintf(0, "CHecking BIG %d\n", i); } } else { if (!(fvi_query_ptr->flags & FQ_IGNORE_EXTERNAL_ROOMS)) for (i = 0; i < Num_big_objects; i++) { if (Objects[BigObjectList[i]].type == OBJ_ROOM) check_hit_obj(BigObjectList[i]); - // mprintf((0, "CHecking BIG %d\n", i)); + // mprintf(0, "CHecking BIG %d\n", i); } } @@ -4779,7 +4787,7 @@ int fvi_room(int room_index, int from_portal, int room_obj) { if(len == 0.0f) { - mprintf((0, "PHYSICS WARNING: Normals cancal out\n")); + mprintf(0, "PHYSICS WARNING: Normals cancal out\n"); new_normal = col_normal[0]; } @@ -4819,8 +4827,13 @@ int fvi_room(int room_index, int from_portal, int room_obj) { if (!(Rooms[connect_room].flags & RF_EXTERNAL)) { if ((fvi_visit_list[connect_room >> 3] & (0x01 << ((connect_room) % 8))) == 0) { - // mprintf((0, "A portal %d to room %d,from room %d,with %d cportal\n", portal_num, - // cur_room->portals[portal_num].croom, room_index, cur_room->portals[portal_num].cportal)); + /* + mprintf(0, "A portal %d to room %d,from room %d,with %d cportal\n", + portal_num, + cur_room->portals[portal_num].croom, + room_index, + cur_room->portals[portal_num].cportal); + */ fvi_room(connect_room, cur_room->portals[portal_num].cportal); } } else if (f_check_terrain) { @@ -4834,7 +4847,7 @@ int fvi_room(int room_index, int from_portal, int room_obj) { query_terrain.startroom = GetTerrainRoomFromPos(query_terrain.p0); - // mprintf((0, "We might go outside\n")); + // mprintf(0, "We might go outside\n"); // This is quick, so do it here. hit_data_terrain.hit_room = GetTerrainRoomFromPos(&hit_data_terrain.hit_pnt); diff --git a/physics/newstyle_fi.cpp b/physics/newstyle_fi.cpp index 3f0e568b..f716b835 100644 --- a/physics/newstyle_fi.cpp +++ b/physics/newstyle_fi.cpp @@ -210,7 +210,7 @@ static void CollideSubmodelFacesUnsorted(poly_model *pm, bsp_info *sm) { fvi_hit_param = (newp - *fvi_query_ptr->p0) * x; if (!(fvi_hit_param > -10000000.0 && fvi_hit_param < 10000000.0)) { - mprintf((0, "FVI Warning: fvi_hit_param seems yucky!\n")); + mprintf(0, "FVI Warning: fvi_hit_param seems yucky!\n"); } fvi_collision_dist = col_dist; diff --git a/physics/physics.cpp b/physics/physics.cpp index 12e6dbc2..03d03469 100644 --- a/physics/physics.cpp +++ b/physics/physics.cpp @@ -117,7 +117,7 @@ void DoPhysLinkedFrame(object *obj) { mn = obj->mtype.obj_link_info.sobj_index; if (mn < 0 || mn >= pm->n_models) { - mprintf((0, "Caught physics link bug!\n")); + mprintf(0, "Caught physics link bug!\n"); SetObjectDeadFlag(obj); return; } @@ -166,7 +166,7 @@ bool PhysCalcGround(vector *ground_point, vector *ground_normal, object *obj, in bool f_good_gp = true; if (obj->render_type != RT_POLYOBJ && obj->type != OBJ_PLAYER) { - // mprintf ((0,"Object type %d is not a polyobj!\n",obj->type)); + // mprintf(0,"Object type %d is not a polyobj!\n",obj->type); if (ground_point) *ground_point = obj->pos; @@ -179,7 +179,7 @@ bool PhysCalcGround(vector *ground_point, vector *ground_normal, object *obj, in pm = &Poly_models[obj->rtype.pobj_info.model_num]; if (pm->n_ground == 0) { - mprintf((0, "WARNING: Object with no weapons is firing.\n", ground_num)); + mprintf(0, "WARNING: Object with no weapons is firing.\n", ground_num); if (ground_point) *ground_point = obj->pos; @@ -194,7 +194,7 @@ bool PhysCalcGround(vector *ground_point, vector *ground_normal, object *obj, in SetModelAnglesAndPos(pm, normalized_time); if (ground_num < 0 || ground_num >= pm->n_ground) { - mprintf((0, "WARNING: Bashing ground num %d to 0.\n", ground_num)); + mprintf(0, "WARNING: Bashing ground num %d to 0.\n", ground_num); ground_num = 0; f_good_gp = false; } @@ -467,7 +467,7 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott scale = abs(49152 - (int)ang.p) / 16384.0f; } - // mprintf((0, "scale %f, ", scale)); + // mprintf(0, "scale %f, ", scale); if (ang.b < 32768) { float al_rate = scale * MAX_LEVEL_ANGLES_PER_SEC * (1.0f - (abs(16834 - (int)ang.b) / 16384.0f)); @@ -481,7 +481,7 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott if (al_rate > ang.b) al_rate = ang.b; - // mprintf((0, "L al_rate %f\n", al_rate)); + // mprintf(0, "L al_rate %f\n", al_rate); ang.b -= al_rate; @@ -497,7 +497,7 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott if (al_rate > 65535 - ang.b) al_rate = 65535 - ang.b; - // mprintf((0, "G al_rate %f\n", al_rate)); + // mprintf(0, "G al_rate %f\n", al_rate); ang.b += al_rate; } @@ -556,22 +556,22 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott // float temp_scale = (1.04f - ((16834 - ang.p)/16834.0f)); // scale = temp_scale * temp_scale; rotthrust->x -= scale * obj->mtype.phys_info.full_rotthrust; - // mprintf((0, "1 scale %f\n", scale)); + // mprintf(0, "1 scale %f\n", scale); } else if (ang.p < 32768) { // float temp_scale = (1.04f - ((ang.p - 16834)/16834.0f)); // scale = temp_scale * temp_scale; rotthrust->x += scale * obj->mtype.phys_info.full_rotthrust; - // mprintf((0, "2 scale %f\n", scale)); + // mprintf(0, "2 scale %f\n", scale); } else if (ang.p < 49152) { // float temp_scale = (1.04f - ((49152 - ang.p)/16834.0f)); // scale = temp_scale * temp_scale; rotthrust->x -= scale * obj->mtype.phys_info.full_rotthrust; - // mprintf((0, "3 scale %f\n", scale)); + // mprintf(0, "3 scale %f\n", scale); } else { // float temp_scale = (1.04f - ((ang.p - 49152)/16834.0f)); // scale = temp_scale * temp_scale; rotthrust->x += scale * obj->mtype.phys_info.full_rotthrust; - // mprintf((0, "4 scale %f\n", scale)); + // mprintf(0, "4 scale %f\n", scale); } } } @@ -613,7 +613,7 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott scale = (abs(49152 - (int)ang.p) - max_tilt_angle) / (16384.0f - max_tilt_angle); } - // mprintf((0, "scale %f, ", scale)); + // mprintf(0, "scale %f, ", scale); if (ang.b < 32768) { float temp_scale; @@ -684,10 +684,12 @@ bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rott vm_AnglesToMatrix(&rotmat, tangles.p, tangles.h, tangles.b); *orient = *orient * rotmat; // ObjSetOrient is below } - - // mprintf((0, " a %f, %f, %f,\n%f, %f, %f,\n%f %f %f\n\n", XYZ(&obj->orient.fvec), XYZ(&obj->orient.rvec), - // XYZ(&obj->orient.uvec))); - +/* + mprintf(0, " a %f, %f, %f,\n%f, %f, %f,\n%f %f %f\n\n", + XYZ(&obj->orient.fvec), + XYZ(&obj->orient.rvec), + XYZ(&obj->orient.uvec)); +*/ // Make sure the new orientation is valid vm_Orthogonalize(orient); @@ -721,7 +723,7 @@ void PhysicsDoSimLinear(const object &obj, const vector &pos, const vector &forc #ifdef _DEBUG if (Physics_player_verbose && obj.type == OBJ_PLAYER) { - mprintf((0, "Player Velocity = %f(%f)\n", vm_GetMagnitude(&velocity), vm_GetMagnitude(&movementVec) / simTime)); + mprintf(0, "Player Velocity = %f(%f)\n", vm_GetMagnitude(&velocity), vm_GetMagnitude(&movementVec) / simTime); } #endif } @@ -807,7 +809,7 @@ void do_physics_sim(object *obj) { Players[obj->id].last_thrust_time = Gametime; } - // mprintf((0, "%d Over terrain = %d\n", obj - Objects, obj->flags & OF_OVER_TERRAIN)); + // mprintf(0, "%d Over terrain = %d\n", obj - Objects, obj->flags & OF_OVER_TERRAIN); // If the object wiggles if ((obj->mtype.phys_info.flags & PF_WIGGLE) && (Demo_flags != DF_PLAYBACK)) { @@ -914,9 +916,9 @@ void do_physics_sim(object *obj) { } } - // mprintf((0, "PHYSICS: Current obj: %d, %9.2fx %9.2fy %9.2fz\n", OBJNUM(obj), XYZ(&obj->pos))); - // mprintf((2,1,0,"x %9.2f\ny %9.2f\nz %9.2f", XYZ(&obj->mtype.phys_info.velocity))); - // mprintf((0, "PHYSICS: Current velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity))); + // mprintf(0, "PHYSICS: Current obj: %d, %9.2fx %9.2fy %9.2fz\n", OBJNUM(obj), XYZ(&obj->pos)); + // mprintf(2,1,0,"x %9.2f\ny %9.2f\nz %9.2f", XYZ(&obj->mtype.phys_info.velocity)); + // mprintf(0, "PHYSICS: Current velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity)); Physics_normal_counter++; @@ -1051,11 +1053,11 @@ void do_physics_sim(object *obj) { // if(vm_GetMagnitude(&start_rotvel) < .0001) // if(vm_GetMagnitude(&end_rotvel) < .0001) // { - // mprintf((0, "At rest\n")); + // mprintf(0, "At rest\n"); // goto end_of_sim; // } - // mprintf((0, "PHYSICS: Try to move to (%f, %f, %f)\n", movement_pos.x, movement_pos.y, movement_pos.z)); + // mprintf(0, "PHYSICS: Try to move to (%f, %f, %f)\n", movement_pos.x, movement_pos.y, movement_pos.z); Physics_normal_looping_counter++; @@ -1129,17 +1131,16 @@ void do_physics_sim(object *obj) { } vm_NormalizeVector(&hit_info.hit_wallnorm[0]); } - - /* if(obj == Player_object && fate != HIT_NONE) - { - mprintf((0, "Hit type %d, obj %d\n", fate, hit_info.hit_object[0])); - if(fate == HIT_OBJECT || fate == HIT_SPHERE_2_POLY_OBJECT) - { - mprintf((0, "Hit object type %d, id %d\n", Objects[hit_info.hit_object[0]].type, - Objects[hit_info.hit_object[0]].id)); - } - } - */ +/* + if (obj == Player_object && fate != HIT_NONE) { + mprintf(0, "Hit type %d, obj %d\n", fate, hit_info.hit_object[0]); + if (fate == HIT_OBJECT || fate == HIT_SPHERE_2_POLY_OBJECT) { + mprintf(0, "Hit object type %d, id %d\n", + Objects[hit_info.hit_object[0]].type, + Objects[hit_info.hit_object[0]].id); + } + } +*/ obj->mtype.phys_info.velocity = temp_vel; // Accounts for precomputed hit rays @@ -1195,15 +1196,15 @@ void do_physics_sim(object *obj) { Objects[objnum].lifetime = 10.0f; } if (obj == Player_object) { - mprintf((0, "Fate = %d for player - ", fate)); + mprintf(0, "Fate = %d for player - ", fate); if (fate == HIT_OBJECT || fate == HIT_SPHERE_2_POLY_OBJECT) { if (Objects[hit_info.hit_object[0]].flags & OF_BIG_OBJECT) { - mprintf((0, "Big object\n")); + mprintf(0, "Big object\n"); } else { - mprintf((0, "Small object\n")); + mprintf(0, "Small object\n"); } } else { - mprintf((0, "non-object\n")); + mprintf(0, "non-object\n"); } } } @@ -1265,11 +1266,12 @@ void do_physics_sim(object *obj) { // We where sitting in a wall -- invalid starting point // moved backwards if (fate == HIT_WALL && moved_vec_n * movement_vec < -0.000001 && actual_dist != 0.0) { - - // mprintf((0, "Obj %d Flew backwards!\n", OBJNUM(obj))); - // mprintf((0, "PHYSICS NOTE: (%f, %f, %f) to (%f, %f, %f)\n", XYZ(&start_pos), - // XYZ(&obj->pos))); don't change position or sim_time_remaining - +/* + mprintf(0, "Obj %d Flew backwards!\n", OBJNUM(obj)); + mprintf(0, "PHYSICS NOTE: (%f, %f, %f) to (%f, %f, %f)\n", + XYZ(&start_pos), + XYZ(&obj->pos)); // don't change position or sim_time_remaining +*/ ObjSetPos(obj, &start_pos, start_room, NULL, false); moved_time = 0.0; @@ -1288,10 +1290,15 @@ void do_physics_sim(object *obj) { // chrishack -- negative simulation time pasted for this sim frame if (sim_time_remaining > old_sim_time_remaining) { - // mprintf((0,"PHYSICS WARNING: Bogus sim_time_remaining = %15.13f, old = - //%15.13f\nAttempted d = %15.13f, actual = %15.13f\n",sim_time_remaining,old_sim_time_remaining, - // attempted_dist, actual_dist)); - // Int3(); +/* + mprintf(0,"PHYSICS WARNING: Bogus sim_time_remaining = %15.13f, old = %15.13f\n"" + "Attempted d = %15.13f, actual = %15.13f\n", + sim_time_remaining, + old_sim_time_remaining, + attempted_dist, + actual_dist); + Int3(); +*/ sim_time_remaining = old_sim_time_remaining; moved_time = 0.0; f_continue_sim = false; @@ -1306,7 +1313,7 @@ void do_physics_sim(object *obj) { if (moved_time > 0.0001f) { obj->mtype.phys_info.velocity = (hit_info.hit_pnt - start_pos) / moved_time; } else { - // mprintf((0, "Moved time is ZERO\n")); -- Add this back -- chrishack + // mprintf(0, "Moved time is ZERO\n"); -- Add this back -- chrishack ASSERT(old_sim_time_remaining > 0.0f); obj->mtype.phys_info.velocity = start_vel; } @@ -1447,7 +1454,7 @@ void do_physics_sim(object *obj) { if (obj->type != OBJ_PLAYER) SetObjectDeadFlag(obj); else - mprintf((0, "Got a ship that was set for bounce!!! BAD!!!\n")); + mprintf(0, "Got a ship that was set for bounce!!! BAD!!!\n"); } } obj->mtype.phys_info.num_bounces--; @@ -1496,14 +1503,14 @@ void do_physics_sim(object *obj) { //(vm_GetMagnitude(&obj->mtype.phys_info.velocity) < .001f //|| obj->mtype.phys_info.velocity * hit_info.hit_wallnorm[0] <= 0.0f)) // { - // mprintf((0, "At Rest!\n")); + // mprintf(0, "At Rest!\n"); // obj->movement_type = MT_NONE; // obj->mtype.phys_info.velocity = Zero_vector; // f_continue_sim = false; // } - // mprintf((0, "(%f, %f, %f) after bounce\n", XYZ(&obj->mtype.phys_info.velocity))); - // mprintf((0, "p (%f, %f, %f) after bounce\n", XYZ(&obj->pos))); + // mprintf(0, "(%f, %f, %f) after bounce\n", XYZ(&obj->mtype.phys_info.velocity)); + // mprintf(0, "p (%f, %f, %f) after bounce\n", XYZ(&obj->pos)); } else { slide_sim: @@ -1559,8 +1566,8 @@ void do_physics_sim(object *obj) { skip_sim: - // mprintf((0, "PHYSICS: Wall normal (%f, %f, %f)\n", XYZ(&hit_info.hit_wallnorm[0]))); - // mprintf((0, "PHYSICS: Bounded velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity))); + // mprintf(0, "PHYSICS: Wall normal (%f, %f, %f)\n", XYZ(&hit_info.hit_wallnorm[0])); + // mprintf(0, "PHYSICS: Bounded velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity)); // This only happens if the new velocity is set from hitting a forcefield. if (!(fabs(obj->mtype.phys_info.velocity.x) < MAX_OBJECT_VEL && @@ -1568,7 +1575,7 @@ void do_physics_sim(object *obj) { fabs(obj->mtype.phys_info.velocity.z) < MAX_OBJECT_VEL)) { float mag = vm_NormalizeVector(&obj->mtype.phys_info.velocity); - mprintf((0, "PHYSICS: Bashing vel for Obj %d of type %d with %f velocity", objnum, obj->type, mag)); + mprintf(0, "PHYSICS: Bashing vel for Obj %d of type %d with %f velocity", objnum, obj->type, mag); obj->mtype.phys_info.velocity *= MAX_OBJECT_VEL * 0.1f; } @@ -1608,9 +1615,9 @@ void do_physics_sim(object *obj) { if(p1.y < 0.0) { // if(p1.y == 0.0) - // mprintf((0, "AT REST: p1 (%f, %f, %f)\n", XYZ(&p1))); + // mprintf(0, "AT REST: p1 (%f, %f, %f)\n", XYZ(&p1)); // else - // mprintf((0, "SHIT: p1 (%f, %f, %f)\n", XYZ(&p1))); + // mprintf(0, "SHIT: p1 (%f, %f, %f)\n", XYZ(&p1)); // // p1.y = -.0001f; // } @@ -1740,7 +1747,7 @@ void do_physics_sim(object *obj) { // hit_info.hit_wallnorm[0] *= -1.0f; - // mprintf((0, "hit dist %f\n", hit_info.hit_dist)); + // mprintf(0, "hit dist %f\n", hit_info.hit_dist); collide_two_objects(obj, &Objects[hit_info.hit_object[0]], &hit_info.hit_face_pnt[0], &hit_info.hit_wallnorm[0], &hit_info); @@ -1761,7 +1768,7 @@ void do_physics_sim(object *obj) { obj->mtype.phys_info.velocity += hit_info.hit_wallnorm[0]; } - // mprintf((0, "OBJ %d t %d hit %d\n", OBJNUM(obj), obj->type, hit_info.hit_object[0])); + // mprintf(0, "OBJ %d t %d hit %d\n", OBJNUM(obj), obj->type, hit_info.hit_object[0]); // Let object continue its movement if collide_two_objects does not mark it as dead // if ( !(obj->flags&OF_DEAD) ) @@ -1815,12 +1822,12 @@ void do_physics_sim(object *obj) { } break; case HIT_BAD_P0: - mprintf((0, "PHYSICS ERROR: Bad p0 in physics!!!\n")); + mprintf(0, "PHYSICS ERROR: Bad p0 in physics!!!\n"); Int3(); // Unexpected collision type: start point not in specified segment. break; default: - mprintf((0, "PHYSICS ERROR: Unknown and unhandled hit type returned from FVI\n")); + mprintf(0, "PHYSICS ERROR: Unknown and unhandled hit type returned from FVI\n"); Int3(); break; } @@ -1835,14 +1842,18 @@ void do_physics_sim(object *obj) { // NOTE: These numbers limit the max collisions an object can have in a single frame if (count >= sim_loop_limit) { if (obj->type == OBJ_PLAYER) { - mprintf((0, "PHYSICS NOTE: Too many collisions for player!\n")); + mprintf(0, "PHYSICS NOTE: Too many collisions for player!\n"); obj->mtype.phys_info.velocity = Zero_vector; } else { - // mprintf((0, "PHYSICS NOTE: Too many collisions for non-player object %d (%d to %d)!\n", - // objnum, init_room, obj->roomnum)); obj->flags |= OF_DEAD; - - // obj->mtype.phys_info.velocity /= 2.0f; - // obj->mtype.phys_info.rotvel /= 2.0f; +/* + mprintf(0, "PHYSICS NOTE: Too many collisions for non-player object %d (%d to %d)!\n", + objnum, + init_room, + obj->roomnum); + obj->flags |= OF_DEAD; + obj->mtype.phys_info.velocity /= 2.0f; + obj->mtype.phys_info.rotvel /= 2.0f; +*/ } // ObjSetPos(obj,&init_pos, init_room); @@ -2077,7 +2088,7 @@ bool PhysComputeWalkerPosOrient(object *obj, vector *pos, matrix *orient) { fate = PhysCastWalkRay(obj, &obj->pos, &foot_pnt, &hp); if (fate == HIT_NONE) { - mprintf((0, "Walking object %d should be falling\n", OBJNUM(obj))); + mprintf(0, "Walking object %d should be falling\n", OBJNUM(obj)); // SetObjectDeadFlag(obj); f_ok = false; } else { @@ -2346,9 +2357,9 @@ void do_walking_sim(object *obj) { } } - // mprintf((0, "PHYSICS: Current obj: %d, %9.2fx %9.2fy %9.2fz\n", OBJNUM(obj), XYZ(&obj->pos))); - // mprintf((2,1,0,"x %9.2f\ny %9.2f\nz %9.2f", XYZ(&obj->mtype.phys_info.velocity))); - // mprintf((0, "PHYSICS: Current velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity))); + // mprintf(0, "PHYSICS: Current obj: %d, %9.2fx %9.2fy %9.2fz\n", OBJNUM(obj), XYZ(&obj->pos)); + // mprintf(2,1,0,"x %9.2f\ny %9.2f\nz %9.2f", XYZ(&obj->mtype.phys_info.velocity)); + // mprintf(0, "PHYSICS: Current velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity)); Physics_normal_counter++; @@ -2465,7 +2476,7 @@ void do_walking_sim(object *obj) { goto end_of_sim; } else if (fate == HIT_OUT_OF_TERRAIN_BOUNDS) { - mprintf((0, "PHYSICS NOTE: Walker exited terrain\n")); + mprintf(0, "PHYSICS NOTE: Walker exited terrain\n"); SetObjectDeadFlag(obj); obj->last_pos = init_pos; @@ -2495,9 +2506,12 @@ void do_walking_sim(object *obj) { // moved backwards if (fate == HIT_WALL && moved_vec_n * movement_vec < -0.000001 && actual_dist != 0.0) { - mprintf((0, "Obj %d Walked backwards!\n", OBJNUM(obj))); - // mprintf((0, "PHYSICS NOTE: (%f, %f, %f) to (%f, %f, %f)\n", XYZ(&start_pos), - // XYZ(&obj->pos))); don't change position or sim_time_remaining + mprintf(0, "Obj %d Walked backwards!\n", OBJNUM(obj)); +/* + mprintf(0, "PHYSICS NOTE: (%f, %f, %f) to (%f, %f, %f)\n", + XYZ(&start_pos), + XYZ(&obj->pos))); // don't change position or sim_time_remaining +*/ ObjSetPos(obj, &start_pos, start_room, NULL, false); @@ -2517,10 +2531,10 @@ void do_walking_sim(object *obj) { // chrishack -- negative simulation time pasted for this sim frame if (sim_time_remaining > old_sim_time_remaining) { - mprintf((0, + mprintf(0, "PHYSICS WARNING: Bogus sim_time_remaining = %15.13f, old = %15.13f\nAttempted d = %15.13f, actual " "= %15.13f\n", - sim_time_remaining, old_sim_time_remaining, attempted_dist, actual_dist)); + sim_time_remaining, old_sim_time_remaining, attempted_dist, actual_dist); // Int3(); sim_time_remaining = old_sim_time_remaining; moved_time = 0.0; @@ -2601,16 +2615,15 @@ void do_walking_sim(object *obj) { } bounced = 1; // this object bounced - // mprintf((0, "(%f, %f, %f) before bounce\n", - // XYZ(&obj->mtype.phys_info.velocity))); + // mprintf(0, "(%f, %f, %f) before bounce\n", XYZ(&obj->mtype.phys_info.velocity)); obj->mtype.phys_info.velocity += hit_info.hit_wallnorm[0] * (wall_part * -1.0f); if (obj->mtype.phys_info.coeff_restitution != 1.0f) obj->mtype.phys_info.velocity -= (obj->mtype.phys_info.velocity * (1.0f - obj->mtype.phys_info.coeff_restitution)); - // mprintf((0, "(%f, %f, %f) after bounce\n", XYZ(&obj->mtype.phys_info.velocity))); - // mprintf((0, "p (%f, %f, %f) after bounce\n", XYZ(&obj->pos))); + // mprintf(0, "(%f, %f, %f) after bounce\n", XYZ(&obj->mtype.phys_info.velocity)); + // mprintf(0, "p (%f, %f, %f) after bounce\n", XYZ(&obj->pos)); } else { float wall_force; @@ -2637,8 +2650,8 @@ void do_walking_sim(object *obj) { } } - // mprintf((0, "PHYSICS: Wall normal (%f, %f, %f)\n", XYZ(&hit_info.hit_wallnorm[0]))); - // mprintf((0, "PHYSICS: Bounded velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity))); + // mprintf(0, "PHYSICS: Wall normal (%f, %f, %f)\n", XYZ(&hit_info.hit_wallnorm[0])); + // mprintf(0, "PHYSICS: Bounded velocity (%f, %f, %f)\n", XYZ(&obj->mtype.phys_info.velocity)); // This only happens if the new velocity is set from hitting a forcefield. if (!(fabs(obj->mtype.phys_info.velocity.x) < MAX_OBJECT_VEL && @@ -2646,7 +2659,7 @@ void do_walking_sim(object *obj) { fabs(obj->mtype.phys_info.velocity.z) < MAX_OBJECT_VEL)) { float mag = vm_NormalizeVector(&obj->mtype.phys_info.velocity); - mprintf((0, "PHYSICS: Bashing vel for Obj %d of type %d with %f velocity", objnum, obj->type, mag)); + mprintf(0, "PHYSICS: Bashing vel for Obj %d of type %d with %f velocity", objnum, obj->type, mag); obj->mtype.phys_info.velocity *= MAX_OBJECT_VEL * 0.1f; } @@ -2686,9 +2699,9 @@ void do_walking_sim(object *obj) { if(p1.y < 0.0) { // if(p1.y == 0.0) - // mprintf((0, "AT REST: p1 (%f, %f, %f)\n", XYZ(&p1))); + // mprintf(0, "AT REST: p1 (%f, %f, %f)\n", XYZ(&p1)); // else - // mprintf((0, "SHIT: p1 (%f, %f, %f)\n", XYZ(&p1))); + // mprintf(0, "SHIT: p1 (%f, %f, %f)\n", XYZ(&p1)); // // p1.y = -.0001f; // } @@ -2778,7 +2791,7 @@ void do_walking_sim(object *obj) { obj->mtype.phys_info.velocity += hit_info.hit_wallnorm[0]; } - // mprintf((0, "OBJ %d t %d hit %d\n", OBJNUM(obj), obj->type, hit_info.hit_object[0])); + // mprintf(0, "OBJ %d t %d hit %d\n", OBJNUM(obj), obj->type, hit_info.hit_object[0]); // Let object continue its movement if collide_two_objects does not mark it as dead // if ( !(obj->flags&OF_DEAD) ) @@ -2814,12 +2827,12 @@ void do_walking_sim(object *obj) { } break; case HIT_BAD_P0: - mprintf((0, "PHYSICS ERROR: Bad p0 in physics!!!\n")); + mprintf(0, "PHYSICS ERROR: Bad p0 in physics!!!\n"); Int3(); // Unexpected collision type: start point not in specified segment. break; default: - mprintf((0, "PHYSICS ERROR: Unknown and unhandled hit type returned from FVI\n")); + mprintf(0, "PHYSICS ERROR: Unknown and unhandled hit type returned from FVI\n"); Int3(); break; } @@ -2834,13 +2847,17 @@ void do_walking_sim(object *obj) { // NOTE: These numbers limit the max collisions an object can have in a single frame if (count >= sim_loop_limit) { if (obj->type == OBJ_PLAYER) { - mprintf((0, "PHYSICS NOTE: Too many collisions for player!\n")); + mprintf(0, "PHYSICS NOTE: Too many collisions for player!\n"); } else { - // mprintf((0, "PHYSICS NOTE: Too many collisions for non-player object %d (%d to %d)!\n", - // objnum, init_room, obj->roomnum)); obj->flags |= OF_DEAD; - - // obj->mtype.phys_info.velocity /= 2.0f; - // obj->mtype.phys_info.rotvel /= 2.0f; + /* + mprintf(0, "PHYSICS NOTE: Too many collisions for non-player object %d (%d to %d)!\n", + objnum, + init_room, + obj->roomnum)); + obj->flags |= OF_DEAD; + obj->mtype.phys_info.velocity /= 2.0f; + obj->mtype.phys_info.rotvel /= 2.0f; + */ } // ObjSetPos(obj,&init_pos, init_room); @@ -3026,10 +3043,10 @@ void phys_apply_force(object *obj, vector *force_vec, int16_t weapon_index) { } if (weapon_index != -1) { - mprintf((0, "Force from weapon\n")); + mprintf(0, "Force from weapon\n"); } - // mprintf((0,"Force: Magnitude = %f Scale = %1.3f\n",magnitude,scale)); + // mprintf(0,"Force: Magnitude = %f Scale = %1.3f\n",magnitude,scale); VIBE_DoForce(force_vec); } @@ -3048,13 +3065,13 @@ void physics_set_rotvel_and_saturate(float *dest, float delta) { if ((delta ^ *dest) < 0) { if (abs(delta) < F1_0/8) { - // mprintf((0, "D")); + // mprintf(0, "D"); *dest = delta/4; } else - // mprintf((0, "d")); + // mprintf(0, "d"); *dest = delta; } else { - // mprintf((0, "!")); + // mprintf(0, "!"); *dest = delta; } } @@ -3107,46 +3124,46 @@ void physics_turn_towards_vector(vector *goal_vector, object *obj, float rate) // change in orientation. void phys_apply_rot(object *obj, vector *force_vec) { - /* - float rate, vecmag; +/* + float rate, vecmag; if (obj->movement_type != MT_PHYSICS) - return; + return; vecmag = vm_VectorMagnitude(force_vec); - if (vecmag < F1_0/256) - rate = 4*F1_0; + if (vecmag < F1_0 / 256) + rate = 4 * F1_0; else if (vecmag < obj->mtype.phys_info.mass >> 14) - rate = 4*F1_0; + rate = 4 * F1_0; else { - rate = fixdiv(obj->mtype.phys_info.mass, vecmag); + rate = fixdiv(obj->mtype.phys_info.mass, vecmag); - if (obj->type == OBJ_ROBOT) { - if (rate < F1_0/4) - rate = F1_0/4; - // Changed by mk, 10/24/95, claw guys should not slow down when attacking! - if (!Robot_info[obj->id].thief && !Robot_info[obj->id].attack_type) { - if (obj->ctype.ai_info.SKIP_AI_COUNT * Frametime < 3*F1_0/4) { - float tval = fixdiv(F1_0, 8*Frametime); - int addval; - addval = f2i(tval); - if ( (rand() * 2) < (tval & 0xffff)) - addval++; - obj->ctype.ai_info.SKIP_AI_COUNT += addval; - // -- mk: too much stuff making hard to see my debug messages...mprintf((0, "Frametime - = %7.3f, addval = %i\n", f2fl(Frametime), addval)); - } - } - } else { - if (rate < F1_0/2) - rate = F1_0/2; - } + if (obj->type == OBJ_ROBOT) { + if (rate < F1_0 / 4) + rate = F1_0 / 4; + // Changed by mk, 10/24/95, claw guys should not slow down when attacking! + if (!Robot_info[obj->id].thief && !Robot_info[obj->id].attack_type) { + if (obj->ctype.ai_info.SKIP_AI_COUNT * Frametime < 3 * F1_0 / 4) { + float tval = fixdiv(F1_0, 8 * Frametime); + int addval; + addval = f2i(tval); + if ((rand() * 2) < (tval & 0xffff)) + addval++; + obj->ctype.ai_info.SKIP_AI_COUNT += addval; + // -- mk: too much stuff making hard to see my debug messages... + mprintf(0, "Frametime = %7.3f, addval = %i\n", f2fl(Frametime), addval); + } + } + } else { + if (rate < F1_0 / 2) + rate = F1_0 / 2; + } } - // Turn amount inversely proportional to mass. Third parameter is seconds to do 360 turn. + // Turn amount inversely proportional to mass. Third parameter is seconds to do 360 turn. physics_turn_towards_vector(force_vec, obj, rate); - */ +*/ } /* //this routine will set the thrust for an object to a value that will diff --git a/renderer/HardwareBaseGPU.cpp b/renderer/HardwareBaseGPU.cpp index be4305e0..3449dc54 100644 --- a/renderer/HardwareBaseGPU.cpp +++ b/renderer/HardwareBaseGPU.cpp @@ -131,7 +131,7 @@ void rend_SetFiltering(int8_t state) { void rend_SetZValues(float nearz, float farz) { gpu_state.cur_near_z = nearz; gpu_state.cur_far_z = farz; - // mprintf ((0,"OPENGL:Setting depth range to %f - %f\n",nearz,farz)); + // mprintf(0,"OPENGL:Setting depth range to %f - %f\n",nearz,farz); // JEFF: glDepthRange must take parameters [0,1] // It is set in init @@ -376,7 +376,7 @@ int rend_SetPreferredState(renderer_preferred_state *pref_state) { gpu_preferred_state = *pref_state; if (gpu_state.initted) { int reinit = 0; - mprintf((0, "Inside pref state!\n")); + mprintf(0, "Inside pref state!\n"); // Change gamma if needed if (pref_state->width != gpu_state.screen_width || pref_state->height != gpu_state.screen_height || diff --git a/renderer/HardwareClipper.cpp b/renderer/HardwareClipper.cpp index 7302e274..ec956c3c 100644 --- a/renderer/HardwareClipper.cpp +++ b/renderer/HardwareClipper.cpp @@ -44,7 +44,7 @@ g3Point *GetTempPoint(void) { void FreeTempPoint(g3Point *p) { if (free_point_num < 1) { - mprintf((1, "clipper: no temp points to free\n")); + mprintf(1, "clipper: no temp points to free\n"); free_point_num = 1; Int3(); } @@ -349,7 +349,7 @@ g3Point **g3_ClipPolygon(g3Point **pointlist, int *nv, g3Codes *cc) { //& ASSERT(free_point_num == 0); //DAJ UTB CMO if (free_point_num != 0) { - mprintf((1, "clipper: leftover temp point\n")); + mprintf(1, "clipper: leftover temp point\n"); free_point_num = 0; Int3(); } diff --git a/renderer/HardwareOpenGL.cpp b/renderer/HardwareOpenGL.cpp index 9addf203..f4e90b24 100644 --- a/renderer/HardwareOpenGL.cpp +++ b/renderer/HardwareOpenGL.cpp @@ -179,7 +179,7 @@ int checkForGLErrors( const char *file, int line ) */ const char *sdlp = SDL_GetError(); if(sdlp && *sdlp) - mprintf((0,"SDL: %s",sdlp)); + mprintf(0,"SDL: %s",sdlp); return 1; } #endif @@ -244,10 +244,10 @@ bool opengl_CheckExtension(const char *extName) { // Gets some specific information about this particular flavor of opengl void opengl_GetInformation() { - mprintf((0, "OpenGL Vendor: %s\n", dglGetString(GL_VENDOR))); - mprintf((0, "OpenGL Renderer: %s\n", dglGetString(GL_RENDERER))); - mprintf((0, "OpenGL Version: %s\n", dglGetString(GL_VERSION))); - mprintf((0, "OpenGL Extensions: %s\n", dglGetString(GL_EXTENSIONS))); + mprintf(0, "OpenGL Vendor: %s\n", dglGetString(GL_VENDOR)); + mprintf(0, "OpenGL Renderer: %s\n", dglGetString(GL_RENDERER)); + mprintf(0, "OpenGL Version: %s\n", dglGetString(GL_VERSION)); + mprintf(0, "OpenGL Extensions: %s\n", dglGetString(GL_EXTENSIONS)); } int opengl_MakeTextureObject(int tn) { @@ -324,7 +324,7 @@ int opengl_InitCache(void) { // Sets default states for our renderer void opengl_SetDefaults() { - mprintf((0, "Setting states\n")); + mprintf(0, "Setting states\n"); gpu_state.cur_color = 0x00FFFFFF; gpu_state.cur_bilinear_state = -1; @@ -440,7 +440,7 @@ int opengl_Setup(HDC glhdc) { return NULL; } - mprintf((0, "Choose pixel format successful!\n")); + mprintf(0, "Choose pixel format successful!\n"); // Try and set the new PFD if (SetPixelFormat(glhdc, pf, &pfd) == FALSE) { @@ -450,7 +450,7 @@ int opengl_Setup(HDC glhdc) { return NULL; } - mprintf((0, "SetPixelFormat successful!\n")); + mprintf(0, "SetPixelFormat successful!\n"); // Get a copy of the newly set PFD if (DescribePixelFormat(glhdc, pf, sizeof(PIXELFORMATDESCRIPTOR), &pfd_copy) == 0) { @@ -476,7 +476,7 @@ int opengl_Setup(HDC glhdc) { } ASSERT(ResourceContext != NULL); - mprintf((0, "Making context current\n")); + mprintf(0, "Making context current\n"); dwglMakeCurrent((HDC)glhdc, ResourceContext); Already_loaded = 1; @@ -528,7 +528,7 @@ int opengl_Setup(oeApplication *app, int *width, int *height) { gl_library[0] = 0; } - mprintf((0, "OpenGL: Attempting to use \"%s\" for OpenGL\n", gl_library[0] ? gl_library : "[system default library]")); + mprintf(0, "OpenGL: Attempting to use \"%s\" for OpenGL\n", gl_library[0] ? gl_library : "[system default library]"); // ryan's adds. 04/18/2000...SDL stuff on 04/25/2000 bool success = true; @@ -585,13 +585,13 @@ int opengl_Setup(oeApplication *app, int *width, int *height) { GSDLWindow = SDL_CreateWindow("Descent 3", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, *width, *height, flags); if (!GSDLWindow) { - mprintf((0, "OpenGL: SDL window creation failed: %s", SDL_GetError())); + mprintf(0, "OpenGL: SDL window creation failed: %s", SDL_GetError()); return 0; } GSDLGLContext = SDL_GL_CreateContext(GSDLWindow); if (!GSDLGLContext) { - mprintf((0, "OpenGL: OpenGL context creation failed: %s", SDL_GetError())); + mprintf(0, "OpenGL: OpenGL context creation failed: %s", SDL_GetError()); SDL_DestroyWindow(GSDLWindow); GSDLWindow = NULL; return 0; @@ -629,7 +629,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { int retval = 1; int i; - mprintf((0, "Setting up opengl mode!\n")); + mprintf(0, "Setting up opengl mode!\n"); if (pref_state) { gpu_preferred_state = *pref_state; @@ -669,7 +669,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { int retval = DISP_CHANGE_SUCCESSFUL; #endif if (retval != DISP_CHANGE_SUCCESSFUL) { - mprintf((0, "Display mode change failed (err=%d), trying default!\n", retval)); + mprintf(0, "Display mode change failed (err=%d), trying default!\n", retval); retval = -1; devmode.dmBitsPerPel = 16; devmode.dmPelsWidth = 640; @@ -678,7 +678,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { retval = ChangeDisplaySettings(&devmode, 0); if (retval != DISP_CHANGE_SUCCESSFUL) { - mprintf((0, "OpenGL_INIT:Change display setting failed failed!\n")); + mprintf(0, "OpenGL_INIT:Change display setting failed failed!\n"); rend_SetErrorMessage("OGL: ChangeDisplaySettings failed. Make sure your desktop is set to 16bit mode!"); ChangeDisplaySettings(NULL, 0); opengl_Close(); @@ -689,8 +689,8 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { gpu_preferred_state.height = 480; } } else { - mprintf((0, "Setdisplaymode to %d x %d (%d bits) is successful!\n", gpu_preferred_state.width, - gpu_preferred_state.height, gpu_preferred_state.bit_depth)); + mprintf(0, "Setdisplaymode to %d x %d (%d bits) is successful!\n", gpu_preferred_state.width, + gpu_preferred_state.height, gpu_preferred_state.bit_depth); } } @@ -723,7 +723,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { height = gpu_preferred_state.height; RECT rect; GetWindowRect((HWND)hOpenGLWnd, &rect); - mprintf((0, "rect=%d %d %d %d\n", rect.top, rect.right, rect.bottom, rect.left)); + mprintf(0, "rect=%d %d %d %d\n", rect.top, rect.right, rect.bottom, rect.left); } gpu_state.screen_width = width; @@ -761,7 +761,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { // Get some info opengl_GetInformation(); - mprintf((0, "Setting up multitexture...\n")); + mprintf(0, "Setting up multitexture...\n"); // Determine if Multitexture is supported bool supportsMultiTexture = opengl_CheckExtension("GL_ARB_multitexture"); @@ -787,9 +787,9 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { opengl_InitCache(); if (UseMultitexture) { - mprintf((0, "Using multitexture.")); + mprintf(0, "Using multitexture."); } else { - mprintf((0, "Not using multitexture.")); + mprintf(0, "Not using multitexture."); } if (OpenGL_packed_pixels) { @@ -801,7 +801,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { ASSERT(opengl_packed_Translate_table); ASSERT(opengl_packed_4444_translate_table); - mprintf((0, "Building packed OpenGL translate table...\n")); + mprintf(0, "Building packed OpenGL translate table...\n"); for (i = 0; i < 65536; i++) { int r = (i >> 10) & 0x1f; @@ -848,7 +848,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { ASSERT(opengl_Translate_table); ASSERT(opengl_4444_translate_table); - mprintf((0, "Building OpenGL translate table...\n")); + mprintf(0, "Building OpenGL translate table...\n"); for (i = 0; i < 65536; i++) { uint32_t pix; @@ -914,7 +914,7 @@ int opengl_Init(oeApplication *app, renderer_preferred_state *pref_state) { gpu_state.initted = 1; - mprintf((0, "OpenGL initialization at %d x %d was successful.\n", width, height)); + mprintf(0, "OpenGL initialization at %d x %d was successful.\n", width, height); return retval; } @@ -1190,7 +1190,7 @@ void opengl_TranslateBitmapToOpenGL(int texnum, int bm_handle, int map_type, int } } - // mprintf ((1,"Doing slow upload to opengl!\n")); + // mprintf(1,"Doing slow upload to opengl!\n"); if (map_type == MAP_TYPE_LIGHTMAP) { GameLightmaps[bm_handle].flags &= ~LF_LIMITS; @@ -1220,7 +1220,7 @@ int opengl_MakeBitmapCurrent(int handle, int map_type, int tn) { } if (w != h) { - mprintf((0, "Can't use non-square textures with OpenGL!\n")); + mprintf(0, "Can't use non-square textures with OpenGL!\n"); return 0; } @@ -1452,7 +1452,7 @@ void rend_SetGammaValue(float val) { // return; gpu_preferred_state.gamma = val; - mprintf((0, "Setting gamma to %f\n", val)); + mprintf(0, "Setting gamma to %f\n", val); #if defined(WIN32) WORD rampvals[3 * 256]; @@ -1606,7 +1606,7 @@ int rend_Init(renderer_type state, oeApplication *app, renderer_preferred_state OpenGL_window_initted = 0; } - mprintf((0, "Renderer init is set to %d\n", Renderer_initted)); + mprintf(0, "Renderer init is set to %d\n", Renderer_initted); #ifndef OEM_V3 int flags = app->flags(); @@ -1626,7 +1626,7 @@ int rend_Init(renderer_type state, oeApplication *app, renderer_preferred_state } void rend_Close(void) { - mprintf((0, "CLOSE:Renderer init is set to %d\n", Renderer_initted)); + mprintf(0, "CLOSE:Renderer init is set to %d\n", Renderer_initted); if (!Renderer_initted) return; @@ -1722,7 +1722,7 @@ void rend_SetFogBorders(float nearz, float farz) { void rend_SetRendererType(renderer_type state) { Renderer_type = state; - mprintf((0, "RendererType is set to %d.\n", state)); + mprintf(0, "RendererType is set to %d.\n", state); } void rend_SetLighting(light_state state) { @@ -1824,11 +1824,10 @@ void rend_Flip(void) { RTP_INCRVALUE(texture_uploads, OpenGL_uploads); RTP_INCRVALUE(polys_drawn, OpenGL_polys_drawn); - mprintf_at( - (1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", OpenGL_uploads, OpenGL_polys_drawn, OpenGL_verts_processed)); - mprintf_at((1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", OpenGL_sets_this_frame[0], OpenGL_sets_this_frame[1], - OpenGL_sets_this_frame[2], OpenGL_sets_this_frame[3])); - mprintf_at((1, 3, 0, "Sets= 4:%d 5:%d ", OpenGL_sets_this_frame[4], OpenGL_sets_this_frame[5])); + mprintf_at(1, 1, 0, "Uploads=%d Polys=%d Verts=%d ", OpenGL_uploads, OpenGL_polys_drawn, OpenGL_verts_processed); + mprintf_at(1, 2, 0, "Sets= 0:%d 1:%d 2:%d 3:%d ", OpenGL_sets_this_frame[0], OpenGL_sets_this_frame[1], + OpenGL_sets_this_frame[2], OpenGL_sets_this_frame[3]); + mprintf_at(1, 3, 0, "Sets= 4:%d 5:%d ", OpenGL_sets_this_frame[4], OpenGL_sets_this_frame[5]); for (i = 0; i < 10; i++) { OpenGL_sets_this_frame[i] = 0; } @@ -1865,7 +1864,7 @@ void rend_SetZBufferState(int8_t state) { OpenGL_sets_this_frame[5]++; gpu_state.cur_zbuffer_state = state; - // mprintf ((0,"OPENGL: Setting zbuffer state to %d.\n",state)); + // mprintf(0,"OPENGL: Setting zbuffer state to %d.\n",state); if (state) { dglEnable(GL_DEPTH_TEST); @@ -1893,7 +1892,7 @@ void rend_ClearZBuffer(void) { dglClear(GL_DEPTH_BUFFER_BIT); } // Clears the zbuffer for the screen void rend_ResetCache(void) { - mprintf((0, "Resetting texture cache!\n")); + mprintf(0, "Resetting texture cache!\n"); opengl_ResetCache(); } @@ -2244,7 +2243,7 @@ void rend_CloseOpenGLWindow(void) { opengl_Close(); WindowGL = 0; OpenGL_window_initted = 0; - mprintf((1, "SHUTTING DOWN WINDOWED OPENGL!")); + mprintf(1, "SHUTTING DOWN WINDOWED OPENGL!"); } // Sets the hardware bias level for coplanar polygons diff --git a/renderer/dyna_gl.h b/renderer/dyna_gl.h index 21940841..429e763e 100644 --- a/renderer/dyna_gl.h +++ b/renderer/dyna_gl.h @@ -200,14 +200,14 @@ static module OpenGLDLLInst; static void *__SDL_mod_GetSymbol(const char *funcStr) { void *retVal = NULL; - mprintf((0, "Looking up GL function [%s]...", funcStr)); + mprintf(0, "Looking up GL function [%s]...", funcStr); retVal = SDL_GL_GetProcAddress(funcStr); if (retVal == NULL) fprintf(stderr, " Could not find GL symbol [%s]!\n\n", funcStr); else { - mprintf((0, "Found at (%p).", retVal)); + mprintf(0, "Found at (%p).", retVal); } // else return (retVal); @@ -224,7 +224,7 @@ extern char *__orig_pwd; extern char loadedLibrary[_MAX_PATH]; #endif module *LoadOpenGLDLL(const char *dllname) { - mprintf((0, "Loading OpenGL dll...\n")); + mprintf(0, "Loading OpenGL dll...\n"); #ifdef __LINUX__ char *tmp = getcwd(NULL, 0); chdir(__orig_pwd); @@ -233,8 +233,8 @@ module *LoadOpenGLDLL(const char *dllname) { free(tmp); if (rc < 0) { const char *sdlErr = SDL_GetError(); - mprintf((0, "OpenGL: Couldn't open library [%s].\n", dllname[0] ? dllname : "system default")); - mprintf((0, "OpenGL: SDL error is [%s].", sdlErr)); + mprintf(0, "OpenGL: Couldn't open library [%s].\n", dllname[0] ? dllname : "system default"); + mprintf(0, "OpenGL: SDL error is [%s].", sdlErr); return NULL; } @@ -243,7 +243,7 @@ module *LoadOpenGLDLL(const char *dllname) { #else if (!mod_LoadModule(&OpenGLDLLInst, dllname, MODF_LAZY | MODF_GLOBAL)) { int err = mod_GetLastError(); - mprintf((0, "Couldn't open module called %s\n", dllname)); + mprintf(0, "Couldn't open module called %s\n", dllname); return NULL; } #endif @@ -536,12 +536,12 @@ module *LoadOpenGLDLL(const char *dllname) { #else #endif - mprintf((0, "OpenGL dll loading successful.\n")); + mprintf(0, "OpenGL dll loading successful.\n"); return &OpenGLDLLInst; dll_error: - mprintf((0, "Error loading opengl dll!\n")); + mprintf(0, "Error loading opengl dll!\n"); mod_FreeModule(&OpenGLDLLInst); return NULL; } diff --git a/renderer/lnxscreenmode.cpp b/renderer/lnxscreenmode.cpp index 0971c5d6..dbba3281 100644 --- a/renderer/lnxscreenmode.cpp +++ b/renderer/lnxscreenmode.cpp @@ -168,18 +168,18 @@ bool CLnxVideoModes::Init(void) // Display *dpy,int screen) if (m_ModeInfoList == (SDL_Rect **)-1) // anything is fine. { - mprintf((0, "Windowed surface is probably going to be used.")); + mprintf(0, "Windowed surface is probably going to be used."); m_NumVideoModes = 0; } // if else { - mprintf((0, "-------------------------\n")); - mprintf((0, "Supported Mode Lines:\n")); + mprintf(0, "-------------------------\n"); + mprintf(0, "Supported Mode Lines:\n"); for (int i = 0; m_ModeInfoList[i] != NULL; i++) { //,m_ModeInfoList[i]->hdisplay,m_ModeInfoList[i]->vdisplay); - mprintf((0, " Mode %d: %dX%d\n", i, m_ModeInfoList[i]->w, m_ModeInfoList[i]->h)); + mprintf(0, " Mode %d: %dX%d\n", i, m_ModeInfoList[i]->w, m_ModeInfoList[i]->h); m_NumVideoModes++; } // for - mprintf((0, "-------------------------\n")); + mprintf(0, "-------------------------\n"); } // else #endif diff --git a/rtperformance/rtperformance.cpp b/rtperformance/rtperformance.cpp index c8f6d2c6..c647a323 100644 --- a/rtperformance/rtperformance.cpp +++ b/rtperformance/rtperformance.cpp @@ -109,7 +109,7 @@ void rtp_WriteBufferLog(void) { CFILE *file = cfopen(buffer, "wt"); if (file) { - mprintf((0, "RTP: Recording Log\n")); + mprintf(0, "RTP: Recording Log\n"); strcpy(buffer, "FrameNum,FrameTime,RenderFrameTime,MultiFrameTime,MusicFrameTime,AmbientSoundTime,WeatherFrameTime," "PlayerFrameTime,DoorwayFrameTime,LevelGoalFrameTime,MatCenFrameTime,ObjectFrameTime,AIFrameAllTime," @@ -204,7 +204,7 @@ void rtp_WriteBufferLog(void) { // Close the log file cfclose(file); } else - mprintf((0, "RTP: Unable to open log for writing\n")); + mprintf(0, "RTP: Unable to open log for writing\n"); #endif } @@ -259,7 +259,7 @@ void rtp_Init(void) { LARGE_INTEGER freq; if (!QueryPerformanceFrequency(&freq)) { // there is no hi-res clock available....ummmm - mprintf((0, "RTP: No Hi-Resolution clock available on this system!!!!!!\n")); + mprintf(0, "RTP: No Hi-Resolution clock available on this system!!!!!!\n"); // well, this isn't good...what to do, what to do? } @@ -310,7 +310,7 @@ void rtp_StartLog */ void rtp_StartLog(void) { #ifdef USE_RTP - mprintf((0, "RTP: Starting Log\n")); + mprintf(0, "RTP: Starting Log\n"); Runtime_performance_counter = 0; Runtime_performance_enabled = 1; memset(&RTP_SingleFrame, 0, sizeof(tRTFrameInfo)); @@ -325,8 +325,8 @@ void rtp_StopLog */ void rtp_StopLog(void) { #ifdef USE_RTP - mprintf((0, "Recorded performance for %f seconds\n", timer_GetTime() - rtp_startlog_time)); - mprintf((0, "RTP: Stopping Log\n")); + mprintf(0, "Recorded performance for %f seconds\n", timer_GetTime() - rtp_startlog_time); + mprintf(0, "RTP: Stopping Log\n"); // Save out the log now rtp_WriteBufferLog(); @@ -341,7 +341,7 @@ void rtp_PauseLog */ void rtp_PauseLog(void) { #ifdef USE_RTP - mprintf((0, "RTP: Pausing Log\n")); + mprintf(0, "RTP: Pausing Log\n"); Runtime_performance_enabled = 0; #endif } @@ -352,7 +352,7 @@ void rtp_ResumeLog */ void rtp_ResumeLog(void) { #ifdef USE_RTP - mprintf((0, "RTP: Resuming Log\n")); + mprintf(0, "RTP: Resuming Log\n"); Runtime_performance_enabled = 1; #endif } diff --git a/scripts/aigame2.cpp b/scripts/aigame2.cpp index c8d259c3..dc3c2d81 100644 --- a/scripts/aigame2.cpp +++ b/scripts/aigame2.cpp @@ -982,9 +982,9 @@ bool aiBlackStormTrooper::OnNotify(int me_handle, tOSIRISEVTAINOTIFY *data) { case AIN_SEE_TARGET: memory->snipe_target_handles[0] = data->it_handle; - // mprintf (0, "BStorm: See target!!\n"); + // mprintf(0, "BStorm: See target!!\n"); if (memory->state == STATE_IDLE) { - // mprintf (0, "BStorm: Found target!!\n"); + // mprintf(0, "BStorm: Found target!!\n"); memory->target_handle = memory->snipe_target_handles[0]; set_state(me_handle, STATE_HIDE); @@ -995,7 +995,7 @@ bool aiBlackStormTrooper::OnNotify(int me_handle, tOSIRISEVTAINOTIFY *data) { //@@ case AIN_SEE_TARGET: //@@ // snipe!! //@@ if (memory->state == STATE_IDLE) { - //@@ mprintf (0, "Acquired!\n"); + //@@ mprintf(0, "Acquired!\n"); //@@ set_state(me_handle, STATE_HIDE); //@@ } //@@ else if (memory->state == STATE_BASE && memory->timer < Game_GetTime()) { @@ -1009,7 +1009,7 @@ bool aiBlackStormTrooper::OnNotify(int me_handle, tOSIRISEVTAINOTIFY *data) { case AIN_NEAR_TARGET: if (memory->state == STATE_BASE) { - // mprintf (0, "BStorm: Near target, must flee.\n"); + // mprintf(0, "BStorm: Near target, must flee.\n"); set_state(me_handle, STATE_HIDE); } break; @@ -1061,7 +1061,7 @@ retry_set_state: AI_GoalValue(me_handle, 0, VF_SET, AIGV_F_CIRCLE_DIST, &dist); //*/ - // mprintf (0, "BStorm: Idling around.\n"); + // mprintf(0, "BStorm: Idling around.\n"); break; case STATE_BASE: @@ -1073,7 +1073,7 @@ retry_set_state: FlushGoal(me_handle, 1); FlushGoal(me_handle, 2); if (memory->cur_snipe_point == -1) { - // mprintf (0, "BStorm: Eek! We should be hiding, not basing!"); + // mprintf(0, "BStorm: Eek! We should be hiding, not basing!"); state = STATE_HIDE; goto retry_set_state; } diff --git a/sndlib/ddsoundload.cpp b/sndlib/ddsoundload.cpp index 888286db..7039dbe3 100644 --- a/sndlib/ddsoundload.cpp +++ b/sndlib/ddsoundload.cpp @@ -157,7 +157,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil if (e_type) *e_type = SND_LOAD_ERROR_NO_FILE; - mprintf((0, "SOUND LOADER: %s not found\n", filename)); + mprintf(0, "SOUND LOADER: %s not found\n", filename); goto error_state; } @@ -171,7 +171,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Make sure that it is a RIFF format temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x46464952) { - mprintf((0, "SOUND LOADER: %s is not a RIFF format file\n", filename)); + mprintf(0, "SOUND LOADER: %s is not a RIFF format file\n", filename); goto error_state; } @@ -182,7 +182,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Make sure it is a wave file temp_long = (uint32_t)cf_ReadInt(cfptr); if (temp_long != 0x45564157) { - mprintf((0, "SOUND LOADER: %s is not a WAVE file\n", filename)); + mprintf(0, "SOUND LOADER: %s is not a WAVE file\n", filename); goto error_state; } nextseek = cftell(cfptr); @@ -197,7 +197,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil ckid = cf_ReadInt(cfptr); cksize = cf_ReadInt(cfptr); if (cksize <= 0) { - mprintf((0, "SOUND LOADER: %s has an invalid block length\n", filename)); + mprintf(0, "SOUND LOADER: %s has an invalid block length\n", filename); goto error_state; } @@ -209,7 +209,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil case 0x20746D66: // Format Chunk // Make sure that this format was not preceeded by another format without data inbetween them. if (f_fmt) { - mprintf((0, "Sound Loader: Found 2 formats in a row in file %s\n", filename)); + mprintf(0, "Sound Loader: Found 2 formats in a row in file %s\n", filename); goto error_state; } @@ -280,24 +280,24 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Currently, we only support PCM wave files if (fmttag != 0x0001) { - mprintf((0, "SOUND LOADER: %s is a type %s wavefile, we only support WAVE_FORMAT_PCM waves.\n", filename, - format_type)); + mprintf(0, "SOUND LOADER: %s is a type %s wavefile, we only support WAVE_FORMAT_PCM waves.\n", filename, + format_type); goto error_state; } // Get the number of channels number_channels = cf_ReadShort(cfptr); if (number_channels != 1) { - mprintf((0, "SOUND LOADER: Invalid number of channels(%d)in %s, we want mono samples only.\n", number_channels, - filename)); + mprintf(0, "SOUND LOADER: Invalid number of channels(%d)in %s, we want mono samples only.\n", number_channels, + filename); goto error_state; } // Get the number of samples per second samples_per_second = cf_ReadInt(cfptr); if (samples_per_second != 22050) { - mprintf((0, "SOUND LOADER: Invalid sample per second(%d)in %s, we want 22k samples only.\n", samples_per_second, - filename)); + mprintf(0, "SOUND LOADER: Invalid sample per second(%d)in %s, we want 22k samples only.\n", samples_per_second, + filename); goto error_state; } @@ -310,8 +310,8 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Get the Bits per sample bits_per_sample = cf_ReadShort(cfptr); if (bits_per_sample != 8 && bits_per_sample != 16) { - mprintf((0, "SOUND LOADER: Invalid bits per sample(%d)in %s, we want 8 or 16 bit samples only.\n", - bits_per_sample, filename)); + mprintf(0, "SOUND LOADER: Invalid bits per sample(%d)in %s, we want 8 or 16 bit samples only.\n", + bits_per_sample, filename); goto error_state; } @@ -359,7 +359,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Data Chunk case 0x61746164: if (!f_fmt) { - mprintf((0, "SOUND LOADER: Format Chunk not defined before Data Chunk\n")); + mprintf(0, "SOUND LOADER: Format Chunk not defined before Data Chunk\n"); goto error_state; } @@ -417,7 +417,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil // Undefined chunk default: - // mprintf((0, "\nSOUND LOADER: Unknown Chunk in %s, attempting to continue.\n", filename)); + // mprintf(0, "\nSOUND LOADER: Unknown Chunk in %s, attempting to continue.\n", filename); break; } } @@ -426,12 +426,12 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil cfclose(cfptr); if (SoundFiles[sound_file_index].sample_8bit != NULL) { - mprintf((0, "Sound file %s is 8bit please make a 16bit version", filename)); + mprintf(0, "Sound file %s is 8bit please make a 16bit version", filename); } // Make sure we got data and format information if (SoundFiles[sound_file_index].sample_8bit == NULL && SoundFiles[sound_file_index].sample_16bit == NULL) { - mprintf((0, "SOUND LOADER: Did not find data and/or format in %s.\n", filename)); + mprintf(0, "SOUND LOADER: Did not find data and/or format in %s.\n", filename); goto error_state; } else if (SoundFiles[sound_file_index].sample_8bit != NULL && !f_high_quality) { // Doing the volume clipping with the low quality (8 bit) sound requires some tricky math -- see chris diff --git a/sndlib/ds3dgeometry.cpp b/sndlib/ds3dgeometry.cpp index 9ea454c9..57098f86 100644 --- a/sndlib/ds3dgeometry.cpp +++ b/sndlib/ds3dgeometry.cpp @@ -76,7 +76,7 @@ bool llsGeometry::Init(llsSystem *snd_sys) { } if (!m_lib_init) { - mprintf((0, "DDSNDGEO: Failed to initialize geometry interface.\n")); + mprintf(0, "DDSNDGEO: Failed to initialize geometry interface.\n"); return false; } @@ -94,7 +94,7 @@ bool llsGeometry::Init(llsSystem *snd_sys) { CreateMaterial(SNDGEO_MATERIAL_WATER, 1.0f, 0.3f, 0.8f, 0.7f); CreateMaterial(SNDGEO_MATERIAL_METAL, 0.1f, 0.1f, 0.95f, 0.85f); - mprintf((0, "DDSNDGEO: Initialized.\n")); + mprintf(0, "DDSNDGEO: Initialized.\n"); return true; } @@ -116,7 +116,7 @@ void llsGeometry::Shutdown() { m_snd_system = NULL; m_lib_init = false; - mprintf((0, "DDSNDGEO: Shutdown.\n")); + mprintf(0, "DDSNDGEO: Shutdown.\n"); } void llsGeometry::StartFrame() { @@ -126,9 +126,9 @@ void llsGeometry::StartFrame() { } void llsGeometry::EndFrame() { - mprintf_at((3, 4, 20, "sndpoly=%04d", n_primatives_used)); - mprintf_at((3, 4, 38, "sndmat=%04d", n_materials_used)); - mprintf_at((3, 5, 20, "sndref=%04d", n_reflections_used)); + mprintf_at(3, 4, 20, "sndpoly=%04d", n_primatives_used); + mprintf_at(3, 4, 38, "sndmat=%04d", n_materials_used); + mprintf_at(3, 5, 20, "sndref=%04d", n_reflections_used); } // polygon lists diff --git a/sndlib/ds3dlib.cpp b/sndlib/ds3dlib.cpp index e147d461..93e9ee5e 100644 --- a/sndlib/ds3dlib.cpp +++ b/sndlib/ds3dlib.cpp @@ -403,7 +403,7 @@ int GamePanToDsPan(float pan) { if (ds_pan < -MAX_DS_PAN) ds_pan = -MAX_DS_PAN; - // mprintf((0, "P %f %d\n", pan, ds_pan)); + // mprintf(0, "P %f %d\n", pan, ds_pan); return ds_pan; } @@ -421,7 +421,7 @@ int GameVolumeToDsAttenuation(float volume) { fvol = DSBVOLUME_MIN; } - // mprintf((0, "V %f %f\n", volume, fvol)); + // mprintf(0, "V %f %f\n", volume, fvol); return (int)fvol; } @@ -497,7 +497,7 @@ inline void sb_adjust_properties_3d(sound_buffer_info *sb, float f_volume, pos_s // EAX_SetBufferReverbMix(lpDSB3D, reverb); // } } else { - mprintf((0, "m_mixer_type = %d\n", sb->m_mixer_type)); + mprintf(0, "m_mixer_type = %d\n", sb->m_mixer_type); Int3(); } } @@ -518,7 +518,7 @@ inline void sb_adjust_properties_2d(sound_buffer_info *sb, float f_volume, float if (lpdsb == NULL) return; - // mprintf((0, "Sound UID %d is now at %d volume,%d pan\n", sound_uid, volume, pan)); + // mprintf(0, "Sound UID %d is now at %d volume,%d pan\n", sound_uid, volume, pan); lpdsb->SetVolume(GameVolumeToDsAttenuation(f_volume)); lpdsb->SetPan(GamePanToDsPan(f_pan)); // chrishack pan is off @@ -717,7 +717,7 @@ void StreamMixer(char *ptr, int len) { loop_start = Sounds[sound_index].loop_start; loop_end = Sounds[sound_index].loop_end; if (!sample_16bit && !sample_8bit) { - mprintf((0, "sound file %s didn't have data for samples.\n", snd_file->name)); + mprintf(0, "sound file %s didn't have data for samples.\n", snd_file->name); } } @@ -796,7 +796,7 @@ void StreamMixer(char *ptr, int len) { if (num_write <= 0) { num_write = 0; - mprintf((0, "d")); + mprintf(0, "d"); goto stream_done; } } else { @@ -818,7 +818,7 @@ void StreamMixer(char *ptr, int len) { if (!(num_write > 0 && num_write <= num_samples)) // this was an assert { num_write = 0; - mprintf((0, "D")); + mprintf(0, "D"); goto done; } @@ -945,12 +945,14 @@ void StreamMixer(char *ptr, int len) { if (cur_buf->play_info->m_stream_cback && cur_buf->play_info->m_stream_data) { cur_buf->play_info->m_stream_data = (*cur_buf->play_info->m_stream_cback)( cur_buf->play_info->user_data, cur_buf->play_info->m_stream_handle, &cur_buf->play_info->m_stream_size); - // cur_buf->s->current_position = (char - //*)cur_buf->play_info->m_stream_data; mprintf((0, "%x %d\n", - // cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); +// cur_buf->s->current_position = (char*)cur_buf->play_info->m_stream_data; +// mprintf(0, "%x %d\n", cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); ASSERT(!(cur_buf->play_info->m_stream_data && cur_buf->play_info->m_stream_size <= 0)); - // mprintf((0, "Data %X, length %d\n", - // cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); +/* + mprintf(0, "Data %X, length %d\n", + cur_buf->play_info->m_stream_data, + cur_buf->play_info->m_stream_size); +*/ if (cur_buf->play_info->m_stream_data) { switch (cur_buf->play_info->m_stream_format) { @@ -976,12 +978,12 @@ void StreamMixer(char *ptr, int len) { } loop_end -= 1; } else { - mprintf((0, "SE: Data is NULL\n")); + mprintf(0, "SE: Data is NULL\n"); cur_buf->m_status &= ~SSF_PLAY_STREAMING; f_loop = false; } } else { - mprintf((0, "SE: Callback/data is NULL\n")); + mprintf(0, "SE: Callback/data is NULL\n"); cur_buf->m_status &= ~SSF_PLAY_STREAMING; f_loop = false; } @@ -1024,7 +1026,7 @@ void StreamMixer(char *ptr, int len) { a++; } - // mprintf((0," -%d- ",a)); + // mprintf(0," -%d- ",a); } // Locks the primary buffer and fills in the new data @@ -1098,7 +1100,7 @@ void __cdecl StreamTimer(void *user_ptr) { result = sb_info->m_lp_looping_buffer->GetCurrentPosition((DWORD *)&playp, (DWORD *)&writep); - // mprintf((0, "(%d,%d)\n", playp, writep)); + // mprintf(0, "(%d,%d)\n", playp, writep); // If primary buffer was stopped from playing if (writep == playp) { @@ -1196,7 +1198,7 @@ bool win_llsSystem::StartStreaming(void) { m_sb_info.thread_handle = _beginthread(StreamTimer, 16384, (void *)&m_sb_info); if (m_sb_info.thread_handle == -1) { m_sb_info.thread_alive = false; - mprintf((0, "Thread failed\n")); + mprintf(0, "Thread failed\n"); Int3(); return false; } @@ -1289,8 +1291,7 @@ HRESULT win_llsSystem::CreateDSBuffer(int buffer_type, LPDIRECTSOUNDBUFFER *lp_l ASSERT(0); // Invalid type of buffer } } else { - mprintf( - (0, "DS3DLIB: Unsupported function for mixer specfied in CreateDSBuffer (%d,%d)\n", m_mixer_type, buffer_type)); + mprintf(0, "DS3DLIB: Unsupported function for mixer specfied in CreateDSBuffer (%d,%d)\n", m_mixer_type, buffer_type); Int3(); // Get Samir!!! return DSERR_UNSUPPORTED; } @@ -1303,7 +1304,7 @@ HRESULT win_llsSystem::CreateDSBuffer(int buffer_type, LPDIRECTSOUNDBUFFER *lp_l // Creative EAX Init if (m_mixer_type == SOUND_MIXER_CREATIVE_EAX) { if (!EAX_SetPrimaryBuffer()) { - mprintf((0, "CreateDSBuffer: EAX Init failed.\n")); + mprintf(0, "CreateDSBuffer: EAX Init failed.\n"); result = DSERR_UNSUPPORTED; goto ds_error; } @@ -1314,7 +1315,7 @@ HRESULT win_llsSystem::CreateDSBuffer(int buffer_type, LPDIRECTSOUNDBUFFER *lp_l } if (result != DS_OK) { - mprintf((0, "DS3DLIB: Failed to init sound buffer of type %d for mixer %d.\n", buffer_type, m_mixer_type)); + mprintf(0, "DS3DLIB: Failed to init sound buffer of type %d for mixer %d.\n", buffer_type, m_mixer_type); goto ds_error; } @@ -1342,7 +1343,7 @@ HRESULT win_llsSystem::CreateDSBuffer(int buffer_type, LPDIRECTSOUNDBUFFER *lp_l ds_error: if (result != DS_OK) { - mprintf((0, "DS3DLIB:result=%x\n", result)); + mprintf(0, "DS3DLIB:result=%x\n", result); if (lp_lp_dsb_3d && (*lp_lp_dsb_3d)) { (*lp_lp_dsb_3d)->Release(); *lp_lp_dsb_3d = NULL; @@ -1363,7 +1364,7 @@ BOOL CALLBACK LLEnumCallback(LPGUID lp_guid, LPCSTR lpstr_description, LPCSTR lp if (m_sound_device_name[0]) { if (strcmp(lpstr_description, m_sound_device_name) == 0) { - mprintf((0, "Using sound card:%s-%s\n", lpstr_description, lpstr_module)); + mprintf(0, "Using sound card:%s-%s\n", lpstr_description, lpstr_module); if (lp_guid) { memmove(lp_ret_guid, lp_guid, sizeof(GUID)); } @@ -1458,7 +1459,7 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max if (mixer_type != SOUND_MIXER_NONE) { if (mixer_type == SOUND_MIXER_CREATIVE_EAX) { if (!EAX_Create(pguid, &m_lp_ds)) { - mprintf((0, "Sound NT: Error EAX\n")); + mprintf(0, "Sound NT: Error EAX\n"); retval = false; goto error_sub; } @@ -1477,7 +1478,7 @@ int win_llsSystem::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t Max m_lp_ds->GetCaps(&dscaps); if (dscaps.dwFlags & DSCAPS_EMULDRIVER) { mixer_type = SOUND_MIXER_DS_8; - mprintf((0, "SOUND INIT(1): We are in NT or have a crappy sound card\n")); + mprintf(0, "SOUND INIT(1): We are in NT or have a crappy sound card\n"); } m_sound_mixer.m_loop_method = DSLOOP_STREAM_METHOD; @@ -1494,7 +1495,7 @@ retry_mixer_init: // test different conditions to see if we really can play sound in software hresult = m_lp_ds->SetCooperativeLevel((HWND)m_hwnd_main, DSSCL_WRITEPRIMARY); if (hresult != DS_OK) { - mprintf((0, "SOUND INIT(2): SCL: WritePrimary failed. Attempting DS 8 init.\n")); + mprintf(0, "SOUND INIT(2): SCL: WritePrimary failed. Attempting DS 8 init.\n"); mixer_type = SOUND_MIXER_DS_8; goto retry_mixer_init; } @@ -1512,7 +1513,7 @@ retry_mixer_init: m_sb_info.m_lp_primary_buffer->Release(); m_sb_info.m_lp_primary_buffer = NULL; } - mprintf((0, "SOUND INIT(3): Cannot create primary buffer.\n")); + mprintf(0, "SOUND INIT(3): Cannot create primary buffer.\n"); mixer_type = SOUND_MIXER_DS_8; goto retry_mixer_init; } else { @@ -1528,12 +1529,12 @@ retry_mixer_init: if (!Fast_mixer) { Fast_mixer = (int *)mem_malloc(dsbcaps.dwBufferBytes * sizeof(int)); Fast_mixer_len = dsbcaps.dwBufferBytes; - mprintf((0, "Using %d ints for fast software mixer\n", dsbcaps.dwBufferBytes)); + mprintf(0, "Using %d ints for fast software mixer\n", dsbcaps.dwBufferBytes); } // Is you want to see the caps, here is where -- mprintf all you want if (!(dsbcaps.dwFlags & DSBCAPS_LOCHARDWARE)) { - mprintf((0, "SOUND INIT(4): Primary is not in hardware\n")); + mprintf(0, "SOUND INIT(4): Primary is not in hardware\n"); m_sb_info.m_lp_primary_buffer->Release(); m_sb_info.m_lp_primary_buffer = NULL; mixer_type = SOUND_MIXER_DS_8; @@ -1547,7 +1548,7 @@ retry_mixer_init: // Start the primary and have it always play. m_f_sound_lib_init = StartStreaming(); if (!m_f_sound_lib_init) { - mprintf((0, "SOUND INIT(5): Something went wrong in StartStreaming\n")); + mprintf(0, "SOUND INIT(5): Something went wrong in StartStreaming\n"); m_sb_info.m_lp_primary_buffer->Release(); m_sb_info.m_lp_primary_buffer = NULL; mixer_type = SOUND_MIXER_DS_8; @@ -1562,7 +1563,7 @@ retry_mixer_init: m_mixer_type = mixer_type; hresult = m_lp_ds->SetCooperativeLevel((HWND)m_hwnd_main, DSSCL_PRIORITY); if (hresult != DS_OK) { - mprintf((0, "Sound NT: Error 1\n")); + mprintf(0, "Sound NT: Error 1\n"); retval = false; goto error_sub; } @@ -1575,7 +1576,7 @@ retry_mixer_init: true, // stereo f16bit); // 8 or 16 bit if (hresult != DS_OK) { - mprintf((0, "Sound NT: Error 2\n")); + mprintf(0, "Sound NT: Error 2\n"); if (m_sb_info.m_lp_primary_buffer) { m_sb_info.m_lp_primary_buffer->Release(); m_sb_info.m_lp_primary_buffer = NULL; @@ -1601,30 +1602,30 @@ retry_mixer_init: } } - mprintf((0, "Sound mixer: ")); + mprintf(0, "Sound mixer: "); retval = true; switch (m_mixer_type) { case SOUND_MIXER_SOFTWARE_16: - mprintf((0, "Software 16\n")); + mprintf(0, "Software 16\n"); break; case SOUND_MIXER_DS_8: - mprintf((0, "DS 8\n")); + mprintf(0, "DS 8\n"); break; case SOUND_MIXER_DS_16: - mprintf((0, "DS 16\n")); + mprintf(0, "DS 16\n"); break; case SOUND_MIXER_DS3D_16: - mprintf((0, "DS3D 16\n")); + mprintf(0, "DS3D 16\n"); break; case SOUND_MIXER_CREATIVE_EAX: - mprintf((0, "Creative EAX\n")); + mprintf(0, "Creative EAX\n"); break; case SOUND_MIXER_NONE: - mprintf((0, "None\n")); + mprintf(0, "None\n"); break; default: - mprintf((0, "LLSound ERROR: Unsupported mixer")); + mprintf(0, "LLSound ERROR: Unsupported mixer"); Int3(); retval = false; break; @@ -1667,7 +1668,7 @@ error_sub: m_lp_ds->Release(); } m_lp_ds = NULL; - mprintf((0, "Sound Warning: Didn't initialize sound library.\n")); + mprintf(0, "Sound Warning: Didn't initialize sound library.\n"); if (m_sound_mixer.m_sound_cache != NULL) delete[] m_sound_mixer.m_sound_cache; m_f_sound_lib_init = 0; @@ -1686,7 +1687,7 @@ void win_llsSystem::DestroySoundLib(void) { if (!m_f_sound_lib_init) return; - mprintf((0, "Start of sound system close\n")); + mprintf(0, "Start of sound system close\n"); // kill sound geometry object if any. if (m_geometry) { @@ -1697,7 +1698,7 @@ void win_llsSystem::DestroySoundLib(void) { StopAllSounds(); // Wait till they are all done - mprintf((0, "Waiting for sounds to stop\n")); + mprintf(0, "Waiting for sounds to stop\n"); if (m_mixer_type != SOUND_MIXER_SOFTWARE_16) { while (!f_all_done) { f_all_done = true; @@ -1720,7 +1721,7 @@ void win_llsSystem::DestroySoundLib(void) { sb_loop_thread_kill(); } } - mprintf((0, "All sounds stopped\n")); + mprintf(0, "All sounds stopped\n"); if (m_mixer_type == SOUND_MIXER_SOFTWARE_16) { // Kill thread goes here @@ -1746,7 +1747,7 @@ void win_llsSystem::DestroySoundLib(void) { m_lp_ds = NULL; m_sb_info.m_lp_looping_buffer = NULL; - mprintf((0, "End of sound system close\n")); + mprintf(0, "End of sound system close\n"); if (m_sound_mixer.m_sound_cache != NULL) delete[] m_sound_mixer.m_sound_cache; @@ -1880,7 +1881,7 @@ void win_llsSystem::StopSound(int sound_uid, uint8_t f_immediately) { m_sound_mixer.m_sound_cache[current_slot].m_sound_buffer = NULL; } - // mprintf((0, "SL cleaning slot %d\n", current_slot)); + // mprintf(0, "SL cleaning slot %d\n", current_slot); m_sound_mixer.m_sound_cache[current_slot].m_status = SSF_UNUSED; } @@ -1980,17 +1981,21 @@ int16_t win_llsSystem::FindFreeSoundSlot(float volume, int priority) if (throw_out_slot > -1) { sb = &m_sound_mixer.m_sound_cache[throw_out_slot]; win_llsSystem::StopSound(sb->m_unique_id, SKT_HOLD_UNTIL_STOP); - // mprintf((0, "DDSNDLIB: Replace sound (p:%d) with sound (p:%d) in slot %d\n", sb->play_info->priority, - // priority, throw_out_slot)); +/* + mprintf(0, "DDSNDLIB: Replace sound (p:%d) with sound (p:%d) in slot %d\n", + sb->play_info->priority, + priority, + throw_out_slot)); +*/ return throw_out_slot; } } #ifdef _DEBUG if (sound_index > -1) { - mprintf((0, "DDSNDLIB: Sound %s with priority (%d) too low.\n", Sounds[sound_index].name, priority)); + mprintf(0, "DDSNDLIB: Sound %s with priority (%d) too low.\n", Sounds[sound_index].name, priority); } else { - mprintf((0, "DDSNDLIB: Sound unknown with priority (%d) too low.\n", priority)); + mprintf(0, "DDSNDLIB: Sound unknown with priority (%d) too low.\n", priority); } #endif @@ -2019,7 +2024,7 @@ int win_llsSystem::PlaySound2d(play_information *play_info, int sound_index, flo // do common processing. if (SoundFiles[Sounds[sound_index].sample_index].used == 0) { - mprintf((0, "Tryed to play %d sound, it DNE.\n", sound_index)); + mprintf(0, "Tryed to play %d sound, it DNE.\n", sound_index); return -1; } #ifdef _DEBUG @@ -2144,7 +2149,7 @@ void win_llsSystem::LoopStartStreaming(sound_buffer_info *sb, int buffer_type, f sb->s->bytes_left = sound_length; buffer_size = sound_length; sb->m_status = SSF_PLAY_LOOPING | SSF_BUFFERED_LOOP; - // mprintf((0, "DDSNDLIB: Starting buffered loop %d (step %d).\n", sb->m_unique_id, sb->s->loop_step)); + // mprintf(0, "DDSNDLIB: Starting buffered loop %d (step %d).\n", sb->m_unique_id, sb->s->loop_step); break; default: buffer_size = STREAM_BUFFER_SIZE; @@ -2285,7 +2290,7 @@ int win_llsSystem::PlayStream(play_information *play_info) { return -1; } - // mprintf((0, "TS(%d)Playing sound index %d at %d volume,%d pan\n", TotalSoundsPlayed, sound_index, volume, pan)); + // mprintf(0, "TS(%d)Playing sound index %d at %d volume,%d pan\n", TotalSoundsPlayed, sound_index, volume, pan); m_total_sounds_played++; m_sound_mixer.m_sound_cache[sound_slot].play_info = play_info; @@ -2333,7 +2338,7 @@ bool win_llsSystem::IsSoundInstancePlaying(int sound_uid) { if ((current_slot = ValidateUniqueId(sound_uid)) == -1) return false; - // mprintf((0, "Checking slot %d of UID %d\n", current_slot, sound_uid)); + // mprintf(0, "Checking slot %d of UID %d\n", current_slot, sound_uid); if (m_sound_mixer.m_sound_cache[current_slot].m_status != SSF_UNUSED) { return true; @@ -2510,7 +2515,7 @@ void win_llsSystem::SoundStartFrame(void) { // perform necessary functions if sound events are pending for frame, this doesn't have to do anything // if the mixer doesn't require such actions. Aureal does though. if (m_pending_actions) { - mprintf((0, "pending actions\n")); + mprintf(0, "pending actions\n"); } // start mixer dependant frame @@ -2518,14 +2523,14 @@ void win_llsSystem::SoundStartFrame(void) { m_pending_actions = false; // cleanup sound cache. - // mprintf((0, "StartCleanup\n")); + // mprintf(0, "StartCleanup\n"); if (m_mixer_type != SOUND_MIXER_SOFTWARE_16) { for (i = 0; i < m_sound_mixer.m_max_sounds_played; i++) { sound_buffer_info *sb = &m_sound_mixer.m_sound_cache[i]; update_directsound_sb(sb, true); } } - // mprintf((0, "EndCleanup\n")); + // mprintf(0, "EndCleanup\n"); int counter = 0, loop_counter = 0, stream_counter = 0, buf_loop_counter = 0; @@ -2570,17 +2575,17 @@ void win_llsSystem::SoundStartFrame(void) { } #ifdef _DEBUG - mprintf_at((3, 2, 0, "LNS: %02d/%02d", counter, m_sound_mixer.m_max_sounds_played)); - mprintf_at((3, 3, 1, "Lp: %02d", loop_counter)); - mprintf_at((3, 4, 1, "St: %02d", stream_counter)); - mprintf_at((3, 5, 0, " Ot: %02d", counter - loop_counter - stream_counter)); + mprintf_at(3, 2, 0, "LNS: %02d/%02d", counter, m_sound_mixer.m_max_sounds_played); + mprintf_at(3, 3, 1, "Lp: %02d", loop_counter); + mprintf_at(3, 4, 1, "St: %02d", stream_counter); + mprintf_at(3, 5, 0, " Ot: %02d", counter - loop_counter - stream_counter); if (m_sound_mixer.m_loop_method != DSLOOP_STREAM_METHOD && m_mixer_type != SOUND_MIXER_SOFTWARE_16) { - mprintf_at((3, 3, 10, "Bf: %02d", buf_loop_counter)); + mprintf_at(3, 3, 10, "Bf: %02d", buf_loop_counter); } - mprintf_at((3, 2, 20, "P5:%02d P4:%02d P3:%02d", n_p5, n_p4, n_p3)); - mprintf_at((3, 3, 20, "P2:%02d P1:%02d P0:%02d", n_p2, n_p1, n_p0)); + mprintf_at(3, 2, 20, "P5:%02d P4:%02d P3:%02d", n_p5, n_p4, n_p3); + mprintf_at(3, 3, 20, "P2:%02d P1:%02d P0:%02d", n_p2, n_p1, n_p0); #endif } @@ -2618,7 +2623,7 @@ bool win_llsSystem::CheckAndForceSoundDataAlloc(int sound_index) { if (!result) return false; - mprintf((0, "Sound %s loaded.\n", SoundFiles[sound_file_index].name)); + mprintf(0, "Sound %s loaded.\n", SoundFiles[sound_file_index].name); return true; } @@ -2903,9 +2908,12 @@ int win_llsSystem::PlaySound3d(play_information *play_info, int sound_index, pos sb_free_buffer(sb); return -1; } - - // mprintf((0, "SL Play sound on slot %d, TP = %d UI = %X\n", sound_slot, TotalSoundsPlayed, - // m_sound_mixer.m_sound_cache[sound_slot].m_unique_id)); +/* + mprintf(0, "SL Play sound on slot %d, TP = %d UI = %X\n", + sound_slot, + TotalSoundsPlayed, + m_sound_mixer.m_sound_cache[sound_slot].m_unique_id); +*/ } m_sound_mixer.m_cur_sounds_played++; @@ -3111,55 +3119,52 @@ TryPlayAgainLabel: bool win_llsSystem::DuplicateSoundBuffer(sound_buffer_info *sb) { return false; // for now, let's not do this. +/* + sound_buffer_info *source_sb = m_sound_mixer.FindSoundBuffer(sb->m_sound_index); - /* - sound_buffer_info *source_sb = m_sound_mixer.FindSoundBuffer(sb->m_sound_index); + ASSERT(m_mixer_type != SOUND_MIXER_SOFTWARE_16); - ASSERT(m_mixer_type != SOUND_MIXER_SOFTWARE_16); - - if (!source_sb) { - Int3(); - return false; - } + if (!source_sb) { + Int3(); + return false; + } // we have a source sound buffer. let's use it. - if (m_mixer_type == SOUND_MIXER_AUREAL) { - sb->m_snd_obj = A3D_DuplicateSource(source_sb->m_snd_obj); - if (!sb->m_snd_obj) { - return false; - } - } - else { - HRESULT hr; - hr = m_lp_ds->DuplicateSoundBuffer(source_sb->m_sound_buffer, &sb->m_sound_buffer); - if (FAILED(hr)) { - mprintf((0, "DDSNDLIB: Failed to duplicate sound buffer (%x)\n", hr)); - return false; - } + if (m_mixer_type == SOUND_MIXER_AUREAL) { + sb->m_snd_obj = A3D_DuplicateSource(source_sb->m_snd_obj); + if (!sb->m_snd_obj) { + return false; + } + } else { + HRESULT hr; + hr = m_lp_ds->DuplicateSoundBuffer(source_sb->m_sound_buffer, &sb->m_sound_buffer); + if (FAILED(hr)) { + mprintf(0, "DDSNDLIB: Failed to duplicate sound buffer (%x)\n", hr); + return false; + } - if(IS_3D_MIXER(m_mixer_type)) { - // a 3d buffer needs a 3d interface pointer - if(sb->m_buffer_type == SBT_3D) - { - hr = sb->m_sound_buffer->QueryInterface(IID_IDirectSound3DBuffer, (void - **)&sb->m_sound_buffer_3d); if (FAILED(hr)) { mprintf((0, "DDSNDLIB: Failed to acquire 3d interface from duplicate - buffer (%x)\n", hr)); return false; - } - } - } + if (IS_3D_MIXER(m_mixer_type)) { + // a 3d buffer needs a 3d interface pointer + if (sb->m_buffer_type == SBT_3D) { + hr = sb->m_sound_buffer->QueryInterface(IID_IDirectSound3DBuffer, (void **)&sb->m_sound_buffer_3d); + if (FAILED(hr)) { + mprintf(0, "DDSNDLIB: Failed to acquire 3d interface from duplicate buffer (%x)\n", hr); + return false; + } + } + } + } - } + sb->m_mixer_type = source_sb->m_mixer_type; + sb->bps = source_sb->bps; + sb->stereo = source_sb->stereo; + sb->sample_data = source_sb->sample_data; + sb->sample_length = source_sb->sample_length; - sb->m_mixer_type = source_sb->m_mixer_type; - sb->bps = source_sb->bps; - sb->stereo = source_sb->stereo; - sb->sample_data = source_sb->sample_data; - sb->sample_length = source_sb->sample_length; + // mprintf(0, "Duplicated!!\n"); + SoundFiles[Sounds[sb->m_sound_index].sample_index].use_count++; - // mprintf((0, "Duplicated!!\n")); - SoundFiles[Sounds[sb->m_sound_index].sample_index].use_count++; - - return true; + return true; */ } diff --git a/sndlib/dsound3d.cpp b/sndlib/dsound3d.cpp index 48c3a029..4af8c3b4 100644 --- a/sndlib/dsound3d.cpp +++ b/sndlib/dsound3d.cpp @@ -235,7 +235,7 @@ void __cdecl sb_loop_thread(void *user_ptr) { sndcache = &m_ds.m_ll_sndsys->m_sound_mixer; iteration = 0; - mprintf((0, "DS3DLIB: Looping thread begins.\n")); + mprintf(0, "DS3DLIB: Looping thread begins.\n"); // main thread body while (!m_ds.request_kill) { @@ -256,7 +256,7 @@ void __cdecl sb_loop_thread(void *user_ptr) { // streams will stop at the request of the application always, unlike looping buffers (see below) if (sb->s->please_close) { sb_loop_thread_clean_buffer(sb); - // mprintf((0, "ds thread pleas_close request processed.\n")); + // mprintf(0, "ds thread pleas_close request processed.\n"); } else if (sb->m_status & SSF_PAUSED) { continue; // just continue } else if ((iteration % 4) == (sb->s->time_slice % 4)) { @@ -272,7 +272,7 @@ void __cdecl sb_loop_thread(void *user_ptr) { sb->s->last_half = whichhalf; } } - // mprintf((0, "ds thread stream update.\n")); + // mprintf(0, "ds thread stream update.\n"); } } else if (!(sb->m_status & SSF_BUFFERED_LOOP)) { // this slot is a looping slot. check to see if app requested closing this loop. @@ -307,7 +307,7 @@ void __cdecl sb_loop_thread(void *user_ptr) { // invalidate thread m_ds.thread_alive = false; m_ds.m_ll_sndsys = NULL; - mprintf((0, "DS3DLIB: Looping thread done.\n")); + mprintf(0, "DS3DLIB: Looping thread done.\n"); } /////////////////////////////////////////////////////////////////////////////// @@ -336,7 +336,7 @@ bool sb_loop_thread_init(win_llsSystem *lls) { void sb_loop_thread_kill() { if (m_ds.thread_alive) { - mprintf((0, "DS3DLIB: Killing looping thread.\n")); + mprintf(0, "DS3DLIB: Killing looping thread.\n"); m_ds.request_kill = true; while (m_ds.thread_alive) { Sleep(DSPB_TICK_MILLISECONDS); @@ -438,7 +438,7 @@ void sb_stream_buffered_update(sound_buffer_info *sb) { whichhalf = (playp < sb->s->half_buffer_point) ? 0 : sb->s->half_buffer_point; if (whichhalf != sb->s->last_half) { - // mprintf((0, "DSOUND3D: event triggered. Updating stream half %d.\n", sb->s->last_half)); + // mprintf(0, "DSOUND3D: event triggered. Updating stream half %d.\n", sb->s->last_half); if (sb->s->close_on_next) { extern win_llsSystem *ll_sound_ptr; ll_sound_ptr->StopSound(sb->m_unique_id); @@ -455,7 +455,7 @@ void sb_stream_buffered_update(sound_buffer_info *sb) { ll_sound_ptr->StopSound(sb->m_unique_id); } else { - mprintf((0, "DSOUND3D: event triggered. Updating stream half %d.\n", sb->s->last_half)); + mprintf(0, "DSOUND3D: event triggered. Updating stream half %d.\n", sb->s->last_half); A3D_ClearSourceWaveEvents(sb->m_snd_obj); sb_stream_fillhalf(sb, sb->s->last_half); sb->s->last_half = (sb->s->last_half) ? 0 : sb->s->half_buffer_point; @@ -573,7 +573,7 @@ void sb_buffered_loop_step(win_llsSystem *lls, sound_buffer_info *sb, int force_ sb->s->loop_step++; } if (!sound_length && sb->s->loop_step == 2) { - // mprintf((0, "DS3DLIB: Buffered loop %d advancing to post-end step (done)\n", sb->m_unique_id)); + // mprintf(0, "DS3DLIB: Buffered loop %d advancing to post-end step (done)\n", sb->m_unique_id); lls->StopSound(sb->m_unique_id); return; } else { @@ -612,5 +612,5 @@ void sb_buffered_loop_step(win_llsSystem *lls, sound_buffer_info *sb, int force_ // must be at end to initiate thread management. sb->s->playing = 1; - // mprintf((0, "DDSNDLIB: Buffered loop %d advancing to step %d.\n", sb->m_unique_id, sb->s->loop_step)); + // mprintf(0, "DDSNDLIB: Buffered loop %d advancing to step %d.\n", sb->m_unique_id, sb->s->loop_step); } diff --git a/sndlib/eax.cpp b/sndlib/eax.cpp index 99facc54..823c7739 100644 --- a/sndlib/eax.cpp +++ b/sndlib/eax.cpp @@ -109,10 +109,10 @@ bool EAX_Create(GUID *pGuid, LPDIRECTSOUND *lpds) { return false; } - mprintf((0, "EAX 2.0 support detected.\n")); + mprintf(0, "EAX 2.0 support detected.\n"); hr = (*DLLEAXDirectSoundCreate)(pGuid, &EAX.m_lpds, NULL); } else { - mprintf((0, "EAX 1.0 support detected.\n")); + mprintf(0, "EAX 1.0 support detected.\n"); hr = DirectSoundCreate(pGuid, &EAX.m_lpds, NULL); } @@ -183,7 +183,7 @@ bool EAX_SetPrimaryBuffer() { if (EAX.m_lpksps == NULL) { if (FAILED(EAX.m_lpdsb->QueryInterface(IID_IKsPropertySet, (LPVOID *)&EAX.m_lpksps))) { - mprintf((0, "EAX: Error failed to query property set interface.\n")); + mprintf(0, "EAX: Error failed to query property set interface.\n"); Int3(); retval = false; goto error_sub; @@ -226,7 +226,7 @@ bool EAX_SetPrimaryBuffer() { error_sub: if (retval == false) { - mprintf((0, "EAX: Error failed to query environmental support.\n")); + mprintf(0, "EAX: Error failed to query environmental support.\n"); Int3(); if (EAX.m_lpksps) { EAX.m_lpksps->Release(); diff --git a/sndlib/hlsoundlib.cpp b/sndlib/hlsoundlib.cpp index 4e1b6891..41adbf26 100644 --- a/sndlib/hlsoundlib.cpp +++ b/sndlib/hlsoundlib.cpp @@ -508,7 +508,7 @@ void hlsSystem::SetLLSoundQuantity(int n_sounds) { n_sounds = MAX_SOUNDS_MIXED; } n_lls_sounds = n_sounds; - mprintf((1, "SNDLIB: Allow %d sounds to be mixed.\n", n_sounds)); + mprintf(1, "SNDLIB: Allow %d sounds to be mixed.\n", n_sounds); if (m_f_hls_system_init) { InitSoundLib(NULL, Sound_mixer, Sound_quality, false); } @@ -562,7 +562,7 @@ int hlsSystem::InitSoundLib(oeApplication *sos, char mixer_type, char quality, b void hlsSystem::KillSoundLib(bool f_kill_sound_list) { int i; if (m_f_hls_system_init) { - mprintf((1, "m_sounds_played %d\n", m_sounds_played)); + mprintf(1, "m_sounds_played %d\n", m_sounds_played); // clean up stream system AudioStream::Shutdown(); for (i = 0; i < MAX_SOUND_OBJECTS; i++) { @@ -632,7 +632,7 @@ void hlsSystem::StopAllSounds() { SoundRenderReset(); - mprintf((0, "Stopped all sounds\n")); + mprintf(0, "Stopped all sounds\n"); } // Code for the beginning and ending of a frame of action // Begin_sound_frame(listener pos/orient/velocity) @@ -708,7 +708,7 @@ void hlsSystem::BeginSoundFrame(bool f_in_game) { counter++; // oldvolume = m_sound_objects[i].volume; // oldpan = m_sound_objects[i].pan; - // mprintf((0, "SO %d playing: uid %d\n", i, m_sound_objects[i].m_sound_uid)); + // mprintf(0, "SO %d playing: uid %d\n", i, m_sound_objects[i].m_sound_uid); // Handle high-level only sounds if (m_sound_objects[i].m_obj_type_flags & SIF_TOO_FAR) { if (m_sound_objects[i].m_obj_type_flags & SIF_LOOPING) { @@ -742,7 +742,7 @@ void hlsSystem::BeginSoundFrame(bool f_in_game) { if (m_sound_objects[i].m_sound_uid != -1) { m_sound_objects[i].m_obj_type_flags &= (~SIF_TOO_FAR); } else { - // mprintf((0, "LLSound full 3\n")); + // mprintf(0, "LLSound full 3\n"); } } continue; @@ -797,7 +797,7 @@ void hlsSystem::BeginSoundFrame(bool f_in_game) { fvi_info hit_data; fvi_query fq; - // mprintf((0, "Obstruction test.\n")); + // mprintf(0, "Obstruction test.\n"); hit_data.hit_type[0] = HIT_WALL; fq.p1 = &Viewer_object->pos; @@ -822,11 +822,11 @@ void hlsSystem::BeginSoundFrame(bool f_in_game) { } } } - // mprintf((0, "BeginSoundFrame: used sound_objects %d\n", counter)); + // mprintf(0, "BeginSoundFrame: used sound_objects %d\n", counter); end_beginsoundframe: AudioStream::Frame(); DebugBlockPrint("DS"); - mprintf_at((3, 1, 0, "HNS: %04d", counter)); + mprintf_at(3, 1, 0, "HNS: %04d", counter); } // Plays the deffered 3d stuff @@ -1113,8 +1113,8 @@ int hlsSystem::Play3dSound(int sound_index, pos_state *cur_pos, object *cur_obj, } // no free slots? hmmm.... if (i >= MAX_SOUND_OBJECTS) { - mprintf((2, "HLSOUNDLIB HOLY COW: Over %d sounds trying to play(beyond max) - %s\n", MAX_SOUND_OBJECTS, - Sounds[sound_index].name)); + mprintf(2, "HLSOUNDLIB HOLY COW: Over %d sounds trying to play(beyond max) - %s\n", MAX_SOUND_OBJECTS, + Sounds[sound_index].name); // Int3(); return -1; } @@ -1157,7 +1157,7 @@ int hlsSystem::Play3dSound(int sound_index, pos_state *cur_pos, object *cur_obj, } if (m_sound_objects[i].m_sound_uid == -1) { m_sound_objects[i].m_obj_type_flags |= SIF_TOO_FAR; - // mprintf((0, "LLSound full 2\n")); + // mprintf(0, "LLSound full 2\n"); } else if (!f_audible) { m_sound_objects[i].m_obj_type_flags |= SIF_TOO_FAR; } @@ -1205,10 +1205,10 @@ int hlsSystem::Play2dSound(int sound_index, int priority, float volume, float pa if (m_sound_objects[i].m_obj_type_flags == SIF_UNUSED) break; } - // mprintf((0, "HL %d\n", i)); + // mprintf(0, "HL %d\n", i); // ASSERT(i < MAX_SOUND_OBJECTS); if (i >= MAX_SOUND_OBJECTS) { - mprintf((3, "Play2DSound: Max Sounds Objects used\n")); + mprintf(3, "Play2DSound: Max Sounds Objects used\n"); // Int3(); return -1; } @@ -1226,11 +1226,11 @@ int hlsSystem::Play2dSound(int sound_index, int priority, float volume, float pa // m_sound_objects[i].play_info.sample_skip_interval = static_skip; // // if(m_sound_objects[i].play_info.sample_skip_interval == 0) - // mprintf((0, "22.5k\n")); + // mprintf(0, "22.5k\n"); // else if (m_sound_objects[i].play_info.sample_skip_interval == 1) - // mprintf((0, "11.25k\n")); + // mprintf(0, "11.25k\n"); // else - // mprintf((0, "5.75k\n")); + // mprintf(0, "5.75k\n"); m_sound_objects[i].m_sound_index = sound_index; m_sound_objects[i].m_sound_uid = m_ll_sound_ptr->PlaySound2d(&m_sound_objects[i].play_info, sound_index, volume * m_master_volume, pan, @@ -1239,7 +1239,7 @@ int hlsSystem::Play2dSound(int sound_index, int priority, float volume, float pa if (m_sound_objects[i].m_sound_uid == -1) { m_sound_objects[i].m_obj_type_flags = SIF_UNUSED; m_sound_objects[i].m_hlsound_uid = -1; - mprintf((1, "Play2DSound: $%d Unplayed\n", i)); + mprintf(1, "Play2DSound: $%d Unplayed\n", i); return -1; } @@ -1263,7 +1263,7 @@ int hlsSystem::PlayStream(int unique_handle, void *data, int size, int stream_fo break; } if (i >= MAX_SOUND_OBJECTS) { - mprintf((2, "PlayStream:Max Sounds Objects\n")); + mprintf(2, "PlayStream:Max Sounds Objects\n"); // Int3(); return -1; } @@ -1287,7 +1287,7 @@ int hlsSystem::PlayStream(int unique_handle, void *data, int size, int stream_fo if (m_sound_objects[i].m_sound_uid == -1) { m_sound_objects[i].m_obj_type_flags = SIF_UNUSED; m_sound_objects[i].m_hlsound_uid = -1; - mprintf((2, "LLSound full 1\n")); + mprintf(2, "LLSound full 1\n"); return -1; } @@ -1323,7 +1323,7 @@ void hlsSystem::StopSound(int sound_obj_index, uint8_t f_stop_priority) { m_sound_objects[sound_obj_index].m_obj_type_flags &= (~SIF_LOOPING); if (m_sound_objects[sound_obj_index].m_sound_uid != -1) { - mprintf((1, "stopSound %d \n", m_sound_objects[sound_obj_index].m_sound_uid)); + mprintf(1, "stopSound %d \n", m_sound_objects[sound_obj_index].m_sound_uid); m_ll_sound_ptr->StopSound(m_sound_objects[sound_obj_index].m_sound_uid, f_stop_priority); } if (f_stop_priority == SKT_STOP_IMMEDIATELY || m_sound_objects[sound_obj_index].m_sound_uid == -1) { diff --git a/sndlib/mixer.cpp b/sndlib/mixer.cpp index ddc869fd..af9bda39 100644 --- a/sndlib/mixer.cpp +++ b/sndlib/mixer.cpp @@ -50,7 +50,7 @@ software_mixer::~software_mixer() { bool software_mixer::Initialize(tMixerInit *mi) { if (m_init) { - mprintf((0, "Mixer: Already Init\n")); + mprintf(0, "Mixer: Already Init\n"); Int3(); return false; } @@ -58,7 +58,7 @@ bool software_mixer::Initialize(tMixerInit *mi) { // Sam 6/29 - When using SDL, there's no primary buffer // if(!mi->primary_buffer || !mi->ll_sound_ptr) if (!mi->ll_sound_ptr) { - mprintf((0, "Mixer: Bad Value passed on init\n")); + mprintf(0, "Mixer: Bad Value passed on init\n"); Int3(); return false; } @@ -113,7 +113,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { // this code will assure that this function will not be called when sound system is in error mode. if (*m_error_code != SSL_OK) { - mprintf((0, "MIX: Mixer in error code %d\n", *m_error_code)); + mprintf(0, "MIX: Mixer in error code %d\n", *m_error_code); return; } @@ -121,7 +121,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { ASSERT(ptr && len >= 0); if ((len % m_primary_alignment) != 0) { - mprintf((0, "MIX:Len is not aligned!\n")); + mprintf(0, "MIX:Len is not aligned!\n"); (*m_fpSetError)(SSL_ERROR_STREAMMIXER); (*m_fpErrorText)("ASSERT((len % ll_sound_ptr->m_primary_alignment) == 0)\nLen:%d PrA:%d", len, m_primary_alignment); return; @@ -190,7 +190,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { loop_start = Sounds[sound_index].loop_start; loop_end = Sounds[sound_index].loop_end; if (!sample_16bit && !sample_8bit) { - mprintf((0, "sound file %s didn't have data for samples.\n", snd_file->name)); + mprintf(0, "sound file %s didn't have data for samples.\n", snd_file->name); } } @@ -198,7 +198,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { // ASSERT(sample_16bit || sample_8bit); if (!sample_16bit && !sample_8bit) { sound_file_info *snd_file = &SoundFiles[Sounds[cur_buf->m_sound_index].sample_index]; - mprintf((0, "MIX: No data for %s\n", snd_file->name)); + mprintf(0, "MIX: No data for %s\n", snd_file->name); (*m_fpSetError)(SSL_ERROR_SAMPLE_NODATA); (*m_fpErrorText)("ASSERT(sample_16bit || sample_8bit)\nNo data found for sound file: %s", snd_file->name); cur_buf->m_status = SSF_UNUSED; @@ -264,7 +264,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { if (num_write <= 0) { num_write = 0; - mprintf((0, "d")); + mprintf(0, "d"); goto stream_done; } } else { @@ -286,7 +286,7 @@ void software_mixer::StreamMixer(char *ptr, int len) { if ((num_write < 0) || (num_write > num_samples)) // this was an assert { num_write = 0; - mprintf((0, "D")); + mprintf(0, "D"); goto done; } @@ -426,12 +426,10 @@ void software_mixer::StreamMixer(char *ptr, int len) { if (cur_buf->play_info->m_stream_cback && cur_buf->play_info->m_stream_data) { cur_buf->play_info->m_stream_data = (*cur_buf->play_info->m_stream_cback)( cur_buf->play_info->user_data, cur_buf->play_info->m_stream_handle, &cur_buf->play_info->m_stream_size); - // cur_buf->s->current_position = (char - //*)cur_buf->play_info->m_stream_data; mprintf((0, "%x %d\n", - // cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); + // cur_buf->s->current_position = (char*)cur_buf->play_info->m_stream_data; + // mprintf(0, "%x %d\n", cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); ASSERT(!(cur_buf->play_info->m_stream_data && cur_buf->play_info->m_stream_size <= 0)); - // mprintf((0, "Data %X, length %d\n", - // cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size)); + // mprintf(0, "Data %X, length %d\n", cur_buf->play_info->m_stream_data, cur_buf->play_info->m_stream_size); if (cur_buf->play_info->m_stream_data) { switch (cur_buf->play_info->m_stream_format) { @@ -457,12 +455,12 @@ void software_mixer::StreamMixer(char *ptr, int len) { } loop_end -= 1; } else { - mprintf((0, "SE: Data is NULL\n")); + mprintf(0, "SE: Data is NULL\n"); cur_buf->m_status &= ~SSF_PLAY_STREAMING; f_loop = false; } } else { - mprintf((0, "SE: Callback/data is NULL\n")); + mprintf(0, "SE: Callback/data is NULL\n"); cur_buf->m_status &= ~SSF_PLAY_STREAMING; f_loop = false; } diff --git a/sndlib/sdlsound.cpp b/sndlib/sdlsound.cpp index 1db05509..8cf2180d 100644 --- a/sndlib/sdlsound.cpp +++ b/sndlib/sdlsound.cpp @@ -104,7 +104,7 @@ int lnxsound::InitSoundLib(char mixer_type, oeApplication *sos, uint8_t max_soun return false; } - mprintf((0, "Sound: Hardware configured. Kicking off stream thread...")); + mprintf(0, "Sound: Hardware configured. Kicking off stream thread..."); SDL_PauseAudioDevice(sound_device, 0); m_total_sounds_played = 0; @@ -251,17 +251,17 @@ int16_t lnxsound::FindFreeSoundSlot(float volume, int priority) if (throw_out_slot > -1) { sb = &sound_cache[throw_out_slot]; StopSound(sb->m_unique_id, SKT_HOLD_UNTIL_STOP); - mprintf((0, "DDSNDLIB: Replace sound (p:%d) with sound (p:%d) in slot %d\n", sb->play_info->priority, priority, - throw_out_slot)); + mprintf(0, "DDSNDLIB: Replace sound (p:%d) with sound (p:%d) in slot %d\n", sb->play_info->priority, priority, + throw_out_slot); return throw_out_slot; } } #ifdef _DEBUG if (sound_index > -1) { - mprintf((0, "DDSNDLIB: Sound %s with priority (%d) too low.\n", Sounds[sound_index].name, priority)); + mprintf(0, "DDSNDLIB: Sound %s with priority (%d) too low.\n", Sounds[sound_index].name, priority); } else { - mprintf((0, "DDSNDLIB: Sound unknown with priority (%d) too low.\n", priority)); + mprintf(0, "DDSNDLIB: Sound unknown with priority (%d) too low.\n", priority); } #endif return -1; @@ -289,7 +289,7 @@ int lnxsound::PlaySound2d(play_information *play_info, int sound_index, float f_ // do common processing. if (SoundFiles[Sounds[sound_index].sample_index].used == 0) { - mprintf((0, "Tryed to play %d sound, it DNE.\n", sound_index)); + mprintf(0, "Tryed to play %d sound, it DNE.\n", sound_index); return -1; } #ifdef _DEBUG @@ -614,7 +614,7 @@ bool lnxsound::CheckAndForceSoundDataAlloc(int sound_index) { if (!result) return false; - mprintf((0, "Sound %s loaded.\n", SoundFiles[sound_file_index].name)); + mprintf(0, "Sound %s loaded.\n", SoundFiles[sound_file_index].name); return true; } @@ -633,7 +633,7 @@ void lnxsound::SoundStartFrame() { // perform necessary functions if sound events are pending for frame, this doesn't have to do anything // if the mixer doesn't require such actions. Aureal does though. if (m_pending_actions) { - mprintf((0, "pending actions\n")); + mprintf(0, "pending actions\n"); } m_in_sound_frame = true; @@ -682,13 +682,13 @@ void lnxsound::SoundStartFrame() { } #ifdef _DEBUG - mprintf_at((3, 2, 0, "LNS: %02d/%02d", counter, MAX_SOUNDS_PLAYING_AT_ONCE)); - mprintf_at((3, 3, 1, "Lp: %02d", loop_counter)); - mprintf_at((3, 4, 1, "St: %02d", stream_counter)); - mprintf_at((3, 5, 0, " Ot: %02d", counter - loop_counter - stream_counter)); + mprintf_at(3, 2, 0, "LNS: %02d/%02d", counter, MAX_SOUNDS_PLAYING_AT_ONCE); + mprintf_at(3, 3, 1, "Lp: %02d", loop_counter); + mprintf_at(3, 4, 1, "St: %02d", stream_counter); + mprintf_at(3, 5, 0, " Ot: %02d", counter - loop_counter - stream_counter); - mprintf_at((3, 2, 20, "P5:%02d P4:%02d P3:%02d", n_p5, n_p4, n_p3)); - mprintf_at((3, 3, 20, "P2:%02d P1:%02d P0:%02d", n_p2, n_p1, n_p0)); + mprintf_at(3, 2, 20, "P5:%02d P4:%02d P3:%02d", n_p5, n_p4, n_p3); + mprintf_at(3, 3, 20, "P2:%02d P1:%02d P0:%02d", n_p2, n_p1, n_p0); #endif } diff --git a/sndlib/sndrender.cpp b/sndlib/sndrender.cpp index 42b865c4..ba5ab3c7 100644 --- a/sndlib/sndrender.cpp +++ b/sndlib/sndrender.cpp @@ -134,7 +134,7 @@ void sound_render_room_geometry(int iroom, int slot) { // do reflections if (iface == (reflect_face * 3)) { - // mprintf((0, "reflect ")); + // mprintf(0, "reflect "); int flags = GameTextures[rfacep->tmap].flags; if (flags & TF_WATER) { diff --git a/sndlib/soundload.cpp b/sndlib/soundload.cpp index d446e903..db1cc736 100644 --- a/sndlib/soundload.cpp +++ b/sndlib/soundload.cpp @@ -421,7 +421,7 @@ int LoadSoundFile(const char *filename, float import_volume, bool f_get_data) { // Make room for the new sound sound_file_index = AllocSoundFile(); if (sound_file_index == -1) { - mprintf((0, "SOUND LOADER: No free sound file slots are available.\n", filename)); + mprintf(0, "SOUND LOADER: No free sound file slots are available.\n", filename); Int3(); return -1; } @@ -430,7 +430,7 @@ int LoadSoundFile(const char *filename, float import_volume, bool f_get_data) { len = strlen(filename); if (len < 4) { - mprintf((0, "SOUND LOADER: %s does not have a 3 charactor extension.\n", filename)); + mprintf(0, "SOUND LOADER: %s does not have a 3 charactor extension.\n", filename); Int3(); // Get chris goto error_state; } @@ -441,11 +441,11 @@ int LoadSoundFile(const char *filename, float import_volume, bool f_get_data) { strncpy(extension, &filename[len - 3], 5); if (strnicmp("wav", extension, 3) == 0) { if (!SoundLoadWaveFile(filename, import_volume, sound_file_index, false, f_get_data)) { - mprintf((0, "SOUND LOADER: Error loading %s.\n", filename)); + mprintf(0, "SOUND LOADER: Error loading %s.\n", filename); goto error_state; } } else { - mprintf((0, "SOUND LOADER: %s in not a supported file type.\n", extension)); + mprintf(0, "SOUND LOADER: %s in not a supported file type.\n", extension); goto error_state; } diff --git a/stream_audio/osfarchive.cpp b/stream_audio/osfarchive.cpp index 6d080ca3..fe119687 100644 --- a/stream_audio/osfarchive.cpp +++ b/stream_audio/osfarchive.cpp @@ -97,7 +97,7 @@ bool OSFArchive::Open(const char *filename, bool write) { cfseek(m_fp, -OSF_HDR_SIZE, SEEK_END); cf_ReadBytes((uint8_t *)tag, strlen(OSF_TAG), m_fp); if (strcmp(OSF_TAG, tag) != 0) { - mprintf((0, "Illegal OSF file format for %s.\n", filename)); + mprintf(0, "Illegal OSF file format for %s.\n", filename); cfclose(m_fp); m_fp = NULL; return false; @@ -120,7 +120,7 @@ bool OSFArchive::Open(const char *filename, bool write) { // read in aux header based off of type. m_hdr.digi.measure = (uint32_t)cf_ReadInt(m_fp); } else { - mprintf((0, "Unsupported OSF file type in %s!\n", filename)); + mprintf(0, "Unsupported OSF file type in %s!\n", filename); cfclose(m_fp); m_fp = NULL; return false; @@ -131,7 +131,7 @@ bool OSFArchive::Open(const char *filename, bool write) { cfseek(m_fp, -OSF_HDR_TITLE_OFS, SEEK_END); if (!cf_ReadBytes((uint8_t *)m_name, OSF_HDR_TITLE_LEN, m_fp)) { - mprintf((0, "Stream title not found for %s.\n", filename)); + mprintf(0, "Stream title not found for %s.\n", filename); cfclose(m_fp); m_fp = NULL; return false; @@ -208,7 +208,7 @@ bool OSFArchive::SaveHeader(uint8_t type, uint8_t comp, uint8_t flags, uint32_t hdrcur = cftell(m_fp); if ((hdrcur - hdrstart) > OSF_HDR_TITLE_OFS) { - mprintf((0, "stream header too big for title!\n")); + mprintf(0, "stream header too big for title!\n"); return false; } diff --git a/stream_audio/streamaudio.cpp b/stream_audio/streamaudio.cpp index c04ba56f..66e7734c 100644 --- a/stream_audio/streamaudio.cpp +++ b/stream_audio/streamaudio.cpp @@ -214,7 +214,7 @@ bool AudioStream::ActivateStream(AudioStream *stream) { return true; } } - mprintf((0, "STRMAUD: AudioStream queue filled!\n")); + mprintf(0, "STRMAUD: AudioStream queue filled!\n"); return false; } void AudioStream::DeactivateStream(AudioStream *stream) { @@ -247,7 +247,7 @@ void AudioStream::Frame() { } else if (strm->m_state == STRM_STOPPING) { if (!AudioStream::m_ll_sndsys->IsSoundInstancePlaying(strm->m_llshandle)) { strm->Stop(); - // mprintf((0, "STRM[%d]: Stopped!\n", strm->m_curid)); + // mprintf(0, "STRM[%d]: Stopped!\n", strm->m_curid); LOGFILE((_logfp, "STRM[%d]: Stopped!\n", strm->m_curid)); if (CHECK_FLAG(strm->m_flags, STRM_OPNF_ONETIME)) { strm->Close(); @@ -483,7 +483,7 @@ bool AudioStream::ReopenDigitalStream(uint8_t fbufidx, int nbufs) { // clear out buffer list if (channels == 0 || channels > 2) { // weird, faulty osf - mprintf((0, "STRM[%d]: Illegal OSF (no channels?): %d.\n", m_curid, channels)); + mprintf(0, "STRM[%d]: Illegal OSF (no channels?): %d.\n", m_curid, channels); LOGFILE((_logfp, "STRM[%d]: Illegal OSF (no channels?): %d.\n", m_curid, channels)); return false; } @@ -498,7 +498,7 @@ bool AudioStream::ReopenDigitalStream(uint8_t fbufidx, int nbufs) { if (nbuffers == 0) nbuffers = 1; } else { - mprintf((0, "STRM[%d]: Bad stream length %d\n", m_curid, filelen)); + mprintf(0, "STRM[%d]: Bad stream length %d\n", m_curid, filelen); LOGFILE((_logfp, "STRM[%d]: Bad stream length %d\n", m_curid, filelen)); return false; } @@ -521,7 +521,7 @@ bool AudioStream::ReopenDigitalStream(uint8_t fbufidx, int nbufs) { } } } - // mprintf((0,"STRM[%d]: Using buffer size of %d\n",m_curid, m_bufsize)); + // mprintf(0,"STRM[%d]: Using buffer size of %d\n",m_curid, m_bufsize); LOGFILE((_logfp, "STRM[%d]: Using buffer size of %d\n", m_curid, m_bufsize)); // mark stream as not done. m_readahead = true; @@ -547,16 +547,16 @@ bool AudioStream::ReopenDigitalStream(uint8_t fbufidx, int nbufs) { m_buffer[m_fbufidx].flags |= STRM_BUFF_USED; m_buffer[m_fbufidx].id = m_thisid; m_playbytesleft -= m_buffer[m_fbufidx].nbytes; - // mprintf((0, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft)); + // mprintf(0, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft); LOGFILE((_logfp, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft)); if (m_playbytesleft <= (m_bufsize / 4)) { - // mprintf((0, "STRM[%d]: ", m_curid)); + // mprintf(0, "STRM[%d]: ", m_curid); if (m_buffer[m_fbufidx].nbytes == 0) { memset(m_buffer[m_fbufidx].data, 0, 4); m_buffer[m_fbufidx].nbytes = 4; - mprintf((0, "making empty buffer and")); + mprintf(0, "making empty buffer and"); } - // mprintf((0, "TERMINAL buffer.\n")); + // mprintf(0, "TERMINAL buffer.\n"); LOGFILE((_logfp, "STRM[%d] TERMINAL buffer. ", m_curid)); m_buffer[m_fbufidx].flags |= STRM_BUFF_TERMINAL; m_readahead = false; @@ -674,7 +674,7 @@ bool AudioStream::Play(bool start_on_frame) { } return true; } else { - mprintf((0, "STRMAUD:Eh? this should be reserved??\n")); + mprintf(0, "STRMAUD:Eh? this should be reserved??\n"); Int3(); } } @@ -687,7 +687,7 @@ void AudioStream::Pause() { } m_state = STRM_PAUSED; m_ll_sndsys->PauseSound(m_llshandle); - // mprintf((0, "Paused stream (%d)\n", m_llshandle)); + // mprintf(0, "Paused stream (%d)\n", m_llshandle); } // pauses a stream void AudioStream::Resume() { @@ -696,7 +696,7 @@ void AudioStream::Resume() { } m_ll_sndsys->ResumeSound(m_llshandle); m_state = STRM_PLAYING; - // mprintf((0, "Resumed stream (%d)\n", m_llshandle)); + // mprintf(0, "Resumed stream (%d)\n", m_llshandle); } // causes a rewind to start of stream, if on_measure is true, stop occurs when measure ends void AudioStream::Stop(bool on_measure, int *stop_flag) { @@ -763,10 +763,10 @@ void *AudioStream::StreamCallback(int *size) { // adjust sound buffer to the next buffer if (m_state == STRM_STOPPING || m_state == STRM_STOPPED) { if (m_state == STRM_STOPPED) { - // mprintf((0, "STRM[%d]: Callback entered while stopping! Force stop.\n", m_curid)); + // mprintf(0, "STRM[%d]: Callback entered while stopping! Force stop.\n", m_curid); LOGFILE((_logfp, "STRM[%d]: Callback entered while stopping! Force stop.\n", m_curid)); } else { - // mprintf((0, "STRM[%d]: Stopping softly\n", m_curid)); + // mprintf(0, "STRM[%d]: Stopping softly\n", m_curid); LOGFILE((_logfp, "STRM[%d]: Stopping softly\n", m_curid)); // if (m_curid == 3) Int3(); } @@ -777,12 +777,12 @@ void *AudioStream::StreamCallback(int *size) { return NULL; } if (!CHECK_FLAG(m_buffer[nextbuffer].flags, STRM_BUFF_USED)) { - // mprintf((0, "STRM[%d]: Playing onetime buffer?\n",m_curid)); + // mprintf(0, "STRM[%d]: Playing onetime buffer?\n",m_curid); LOGFILE((_logfp, "STRM[%d]: Playing onetime buffer?\n", m_curid)); m_state = STRM_STOPPED; *size = 0; return NULL; - //@@ mprintf((0, "STRMAUD: Repeating last buffer.\n")); + //@@ mprintf(0, "STRMAUD: Repeating last buffer.\n"); //@@ data = (void *)m_buffer[m_sbufidx].data; //@@ *size = m_buffer[m_sbufidx].nbytes; //@@ return data; @@ -792,7 +792,7 @@ void *AudioStream::StreamCallback(int *size) { m_buffer[m_sbufidx].nbytes = 0; m_sbufidx = nextbuffer; // ASSERT(CHECK_FLAG(m_buffer[m_sbufidx].flags, STRM_BUFF_USED)); - // mprintf((0,"%c",m_sbufidx+'A')); + // mprintf(0,"%c",m_sbufidx+'A'); // increment measure count if we've entered a new measure. // if stop measure has been flagged, don't return new valid data. // make sure and lock mutex, because we're modifying these contents when the caller could @@ -804,20 +804,20 @@ void *AudioStream::StreamCallback(int *size) { *size = m_buffer[m_sbufidx].nbytes; // ASSERT((*size) > 0); if (CHECK_FLAG(m_buffer[m_sbufidx].flags, STRM_BUFF_TERMINAL)) { - // mprintf((0, "STRMAUD: reached end of stream (%d bytes).\n", (*size))); + // mprintf(0, "STRMAUD: reached end of stream (%d bytes).\n", (*size)); if (!CHECK_FLAG(m_buffer[m_sbufidx].flags, STRM_BUFF_LOOPEND)) { m_state = STRM_STOPPING; } if (m_stopnextmeasure) { m_state = STRM_STOPPING; } - // mprintf((0, "STRM[%d]: Start stopping softly\n", m_curid)); + // mprintf(0, "STRM[%d]: Start stopping softly\n", m_curid); LOGFILE((_logfp, "STRM[%d]: Start stopping softly\n", m_curid)); // *done = true; } if ((*size) == 0) { // *done = true; - // mprintf((0, "STRM[%d]: Used buffer has 0 bytes!\n", m_curid)); + // mprintf(0, "STRM[%d]: Used buffer has 0 bytes!\n", m_curid); LOGFILE((_logfp, "STRM[%d]: Used buffer has 0 bytes!\n", m_curid)); m_state = STRM_STOPPING; data = NULL; @@ -864,7 +864,7 @@ void AudioStream::UpdateData() { if (m_readahead) { // ok update the next buffer with data m_fbufidx = nextbuffer; - // mprintf((0,"%c",m_fbufidx+'a')); + // mprintf(0,"%c",m_fbufidx+'a'); // if our stream's current id does not match the streaming buffer's id, then we need to reallocate // the stream buffer with the new memory size if (m_buffer[m_fbufidx].id != (int)m_curid) { @@ -878,16 +878,16 @@ void AudioStream::UpdateData() { m_buffer[m_fbufidx].flags |= STRM_BUFF_USED; m_buffer[m_fbufidx].id = (int)m_curid; m_playbytesleft -= m_buffer[m_fbufidx].nbytes; - // mprintf((0, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft)); + // mprintf(0, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft); LOGFILE((_logfp, "[%d]:pbytesleft=%d\n", m_curid, m_playbytesleft)); if (m_playbytesleft <= (m_bufsize / 4)) { - // mprintf((0, "STRM[%d]: ", m_curid)); + // mprintf(0, "STRM[%d]: ", m_curid); if (m_buffer[m_fbufidx].nbytes == 0) { memset(m_buffer[m_fbufidx].data, 0, 4); m_buffer[m_fbufidx].nbytes = 4; - mprintf((0, "making empty buffer and")); + mprintf(0, "making empty buffer and"); } - // mprintf((0, "TERMINAL buffer.\n")); + // mprintf(0, "TERMINAL buffer.\n"); LOGFILE((_logfp, "STRM[%d]: TERMINAL buffer.\n", m_curid)); m_buffer[m_fbufidx].flags |= STRM_BUFF_TERMINAL; m_readahead = false; diff --git a/ui/UIButton.cpp b/ui/UIButton.cpp index d23118ec..48692280 100644 --- a/ui/UIButton.cpp +++ b/ui/UIButton.cpp @@ -265,7 +265,7 @@ void UIButton::OnMouseBtnDown(int btn) { if (m_State != UI_BTS_ACTIVATED && PT_IN_GADGET(m_Wnd, this, UI_input.mx, UI_input.my)) { m_State = UI_BTS_ACTIVATED; LOCK_FOCUS(this); - // mprintf((0, "Mouse down, locking gadget.\n")); + // mprintf(0, "Mouse down, locking gadget.\n"); } else if (m_State == UI_BTS_ACTIVATED && !PT_IN_GADGET(m_Wnd, this, UI_input.mx, UI_input.my)) { m_State = UI_BTS_HILITE; } @@ -281,7 +281,7 @@ void UIButton::OnMouseBtnUp(int btn) { } m_State = UI_BTS_HILITE; } - // mprintf((0, "Mouse up, unlocking gadget.\n")); + // mprintf(0, "Mouse up, unlocking gadget.\n"); UNLOCK_FOCUS(this); } } diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index 783590ef..910818b3 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -239,12 +239,12 @@ void UIEdit::Activate() { UI_current_editbox = this; m_UpdateCount = false; - // mprintf((0, "activating edit box\n")); + // mprintf(0, "activating edit box\n"); } // deactivates edit box (use if you know what you're doing.) void UIEdit::Deactivate() { - // mprintf((0, "deactivating edit box\n")); + // mprintf(0, "deactivating edit box\n"); m_Active = false; UI_current_editbox = NULL; @@ -267,13 +267,13 @@ void UIEdit::OnDestroy() { // override: behavior when gadget loses input focus. void UIEdit::OnLostFocus() { - // mprintf((0, "Edit control lost focus.\n")); + // mprintf(0, "Edit control lost focus.\n"); UIEdit::Deactivate(); } // override: behavior when gadget gains input focus. void UIEdit::OnGainFocus() { - // mprintf((0, "Edit control gained focus.\n")); + // mprintf(0, "Edit control gained focus.\n"); } // behavior when gadget is being drawn. @@ -387,7 +387,7 @@ void UIEdit::OnKeyDown(int key) { for (i = len; i >= m_CurPos; i--) m_TextBuf[i + 1] = m_TextBuf[i]; // adjust scroll region if cursor will go out of visible region. - mprintf((0, "scroll=%d, curpos=%d\n", m_ScrollThresh, m_CurPos)); + mprintf(0, "scroll=%d, curpos=%d\n", m_ScrollThresh, m_CurPos); // if (m_ScrollThresh<=m_CurPos && m_ScrollThresh) // m_StartPos++; m_TextBuf[m_CurPos++] = (char)ascii; diff --git a/ui/UIListBox.cpp b/ui/UIListBox.cpp index 7072ef3f..02ccd40a 100644 --- a/ui/UIListBox.cpp +++ b/ui/UIListBox.cpp @@ -422,7 +422,7 @@ void UIListBox::RemoveItem(const UIItem *item) { } } if (found == -1) { - mprintf((0, "UIListBox:: Didn't find item to remove!\n")); + mprintf(0, "UIListBox:: Didn't find item to remove!\n"); return; } @@ -486,7 +486,7 @@ void UIListBox::SelectItem(const UIItem *item) { } } if (!found) { - mprintf((0, "UIListBox::SelectItem item not found!\n")); + mprintf(0, "UIListBox::SelectItem item not found!\n"); } } @@ -755,14 +755,14 @@ void UIListBox::OnMouseBtnDown(int btn) { if (m_MouseState == 1 || m_MouseState == 2) { // single click pass or double clicking // handle first slow delay scrolling (like keyboard input) if ((m_ClickTime + KEYDOWN_FIRST_DELAY) > UI_TIME()) { - // mprintf((0, "old=%.3f cur=%.3f\n", m_ClickTime, UI_TIME())); + // mprintf(0, "old=%.3f cur=%.3f\n", m_ClickTime, UI_TIME()); return; } else m_MouseState = 3; } else if (m_MouseState == 3) { // handle repeat scrolling (note this is if the user has scrolled once already. if ((m_ClickTime + KEYDOWN_REPEAT_DELAY) > UI_TIME()) { - // mprintf((0, "old=%.3f cur=%.3f\n", m_ClickTime, UI_TIME())); + // mprintf(0, "old=%.3f cur=%.3f\n", m_ClickTime, UI_TIME()); return; } } else if (m_MouseState == 0) { @@ -784,7 +784,7 @@ void UIListBox::OnMouseBtnDown(int btn) { } m_ClickTime = UI_TIME(); // use for scroll timing, this should be reset on button release - // mprintf((0, "new=%.3f\n", m_ClickTime)); + // mprintf(0, "new=%.3f\n", m_ClickTime); // code here should allow for continuous scrolling on mouse down. // we need to add timing so scrolling isn't do damn quick. diff --git a/ui/UIObject.cpp b/ui/UIObject.cpp index b6dd041f..125b0b38 100644 --- a/ui/UIObject.cpp +++ b/ui/UIObject.cpp @@ -65,7 +65,7 @@ void UIObject::Move(int x, int y, int w, int h) { m_Y = y; m_W = w; m_H = h; - mprintf((0, "new [%d,%d]\n", m_X, m_Y)); + mprintf(0, "new [%d,%d]\n", m_X, m_Y); } //@@ diff --git a/ui/UIRes.cpp b/ui/UIRes.cpp index 884f7408..174b5c1e 100644 --- a/ui/UIRes.cpp +++ b/ui/UIRes.cpp @@ -233,7 +233,7 @@ bool UISnazzyTextItem::draw(int x, int y, tUIDrawClass draw_class) { set_color(GR_RGB(r + (int)(r2 * m_data.f), g + (int)(g2 * m_data.f), b + (int)(b2 * m_data.f))); // set_alpha((uint8_t)(m_data.f*m_internaldata.i)); - // mprintf((0, "%x\n", (unsigned)get_color())); + // mprintf(0, "%x\n", (unsigned)get_color()); } return UITextItem::draw(x, y, draw_class); diff --git a/ui/UISlider.cpp b/ui/UISlider.cpp index 864f3358..fb2e021c 100644 --- a/ui/UISlider.cpp +++ b/ui/UISlider.cpp @@ -200,7 +200,7 @@ void UISlider::OnMouseBtnDown(int btn) { else if (new_pos >= m_Range) new_pos = m_Range - 1; if (new_pos != m_Pos) { - // mprintf((0, "x=%d, interval=%d, pos=%d\n", x, m_IntervalWidth, new_pos)); + // mprintf(0, "x=%d, interval=%d, pos=%d\n", x, m_IntervalWidth, new_pos); OnSelect(); } m_Pos = new_pos; diff --git a/ui/UISystem.cpp b/ui/UISystem.cpp index cc1bed98..1b459437 100644 --- a/ui/UISystem.cpp +++ b/ui/UISystem.cpp @@ -273,13 +273,12 @@ bool ui_MousePoll(bool buttons) { } else if (UI_cursor_show) { // if bX_count is 0, then repeat processing can occur, otherwise only real mouse events are processed. if (ddio_MouseGetEvent(&msebtn, &state)) { - // mprintf((2, "mouse #%d state %d at %04d %04d\n", msebtn, UI_input.b1_status, - // UI_input.mx, UI_input.my)); + // mprintf(2, "mouse #%d state %d at %04d %04d\n", msebtn, UI_input.b1_status, UI_input.mx, UI_input.my); if (msebtn == 0) { UI_input.b1_last_status = UI_input.b1_status; UI_input.b1_status = state ? UIMSEBTN_PRESSED : UIMSEBTN_RELEASED; UI_input.b1_count = 1; - // mprintf((0, "M")); + // mprintf(0, "M"); return true; } else { UI_input.b1_status = 0; @@ -293,7 +292,7 @@ bool ui_MousePoll(bool buttons) { if (CHECK_FLAG(btn_mask, MOUSE_LB)) { // process repeat key events. UI_input.b1_status = UIMSEBTN_PRESSED; - // mprintf((0, "m")); + // mprintf(0, "m"); return true; } UI_input.b1_status = 0; @@ -336,7 +335,7 @@ bool ui_KeyPoll() { UI_input.key_status = 0; UI_input.key_first_press = false; } - // mprintf((0, "key=%d status=%d.\n", UI_input.key, UI_input.key_status)); + // mprintf(0, "key=%d status=%d.\n", UI_input.key, UI_input.key_status); return UI_input.key ? true : false; } // ability to load/use mouse cursors @@ -376,7 +375,7 @@ void ui_RemoveAllWindows() { ASSERT(count < 50); } if (count) { - mprintf((0, "%d UI windows left open. Closed them!\n", count)); + mprintf(0, "%d UI windows left open. Closed them!\n", count); } } // removes a window from ui list. @@ -480,7 +479,7 @@ void ui_DoCursor() { u0 = (float)(UI_MOUSE_HOTX - UI_input.mx) / (float)cur_w; if (UI_input.my < UI_MOUSE_HOTY) v0 = (float)(UI_MOUSE_HOTY - UI_input.my) / (float)cur_h; - // mprintf_at((1,5,30,"mx=%d my=%d ", UI_input.mx,UI_input.my)); + // mprintf_at(1,5,30,"mx=%d my=%d ", UI_input.mx,UI_input.my); rend_DrawScaledBitmap(UI_input.mx - UI_MOUSE_HOTX, UI_input.my - UI_MOUSE_HOTY, UI_input.mx + (int)((float)cur_w * u1) - UI_MOUSE_HOTX, UI_input.my + (int)((float)cur_h * v1) - UI_MOUSE_HOTY, UI_cursor_bm, u0, v0, u1, v1); diff --git a/ui/UIWindow.cpp b/ui/UIWindow.cpp index a0ec1d96..ae92e018 100644 --- a/ui/UIWindow.cpp +++ b/ui/UIWindow.cpp @@ -576,7 +576,7 @@ void UIWindow::Render() { gadget->OnDraw(); ui_EndDraw(); } else { - mprintf((0, "WINDOW: Gadget clipped on screen border (%d,%d,%d,%d)\n", l, t, r, b)); + mprintf(0, "WINDOW: Gadget clipped on screen border (%d,%d,%d,%d)\n", l, t, r, b); // Int3(); } diff --git a/win32/WinController.cpp b/win32/WinController.cpp index 74df12be..af46ae11 100644 --- a/win32/WinController.cpp +++ b/win32/WinController.cpp @@ -534,7 +534,7 @@ ct_config_data gameWinController::get_controller_value(ct_type type_req) { case ctMouseButton: for (j = 0; j < CT_MAX_BUTTONS; j++) { if (ddio_MouseBtnUpCount(j)) { - // mprintf((0, "MseBtn %d down\n", j)); + // mprintf(0, "MseBtn %d down\n", j); val = MAKE_CONFIG_DATA(CONTROLLER_CTL_INFO(1, NULL_CONTROLLER), CONTROLLER_CTL_VALUE(j + 1, NULL_BINDING)); return val; } @@ -552,7 +552,7 @@ ct_config_data gameWinController::get_controller_value(ct_type type_req) { : (m_ControlList[i].sens[CT_V_AXIS - 1] > 1.0f) ? 0.80f : (m_ControlList[i].sens[CT_V_AXIS - 1] / 2); pos = get_axis_value(i, CT_V_AXIS, ctAnalog); - mprintf((0, "pos=%.2f\n", pos)); + mprintf(0, "pos=%.2f\n", pos); if (fabs(pos) > limit) val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_V_AXIS, NULL_BINDING)); } @@ -627,13 +627,13 @@ ct_config_data gameWinController::get_controller_value(ct_type type_req) { } if (m_ControlList[i].flags & CTF_Y_AXIS) { pos = get_axis_value(i, CT_Y_AXIS, ctAnalog); - // mprintf((0, "y=%.2f ", pos)); + // mprintf(0, "y=%.2f ", pos); if (fabs(pos) >= 0.90f) val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_Y_AXIS, NULL_BINDING)); } if (m_ControlList[i].flags & CTF_X_AXIS) { pos = get_axis_value(i, CT_X_AXIS, ctAnalog); - // mprintf((0, "x=%.2f\n", pos)); + // mprintf(0, "x=%.2f\n", pos); if (fabs(pos) >= 0.90f) val = MAKE_CONFIG_DATA(ctl, CONTROLLER_CTL_VALUE(CT_X_AXIS, NULL_BINDING)); } @@ -900,7 +900,7 @@ float gameWinController::get_axis_value(int8_t controller, uint8_t axis, ct_form val -= 1.0f; } else { val = 0.0f; - mprintf((1, "gameController::axis unsupported format for function.\n")); + mprintf(1, "gameController::axis unsupported format for function.\n"); } ct_packet key_slide1, key_bank; @@ -1043,7 +1043,7 @@ float gameWinController::get_button_value(int8_t controller, ct_format format, u break; default: - mprintf((1, "gameController::button unsupported format for function\n")); + mprintf(1, "gameController::button unsupported format for function\n"); } return val; @@ -1110,7 +1110,7 @@ float gameWinController::get_pov_value(int8_t controller, ct_format format, uint break; default: - mprintf((1, "gameController::pov unsupported format for function\n")); + mprintf(1, "gameController::pov unsupported format for function\n"); } return val; @@ -1138,7 +1138,7 @@ float gameWinController::get_key_value(int key, ct_format format) { break; default: - mprintf((1, "gameController::key unsupported format for function\n")); + mprintf(1, "gameController::key unsupported format for function\n"); } return val; @@ -1378,7 +1378,7 @@ bool gameWinController::enum_controllers(char *remote_adr) { } m_ControlList[num_devs].deadzone = JOY_DEADZONE; - mprintf((0, "Controller %s found.\n", jc.name)); + mprintf(0, "Controller %s found.\n", jc.name); // okay, now search for a '****.ctl' file in the current directory. parse_ctl_file(num_devs, jc.name); @@ -1451,7 +1451,7 @@ void gameWinController::extctl_getpos(int id) { if ((ji.buttons & (1 << i)) && !(m_ExtCtlStates[id].buttons & (1 << i))) { m_ExtCtlStates[id].btnpresses[i]++; m_ExtCtlStates[id].btnstarts[i] = timer_val; - // mprintf((0, "Start time for %d = %f\n", i, timer_val)); + // mprintf(0, "Start time for %d = %f\n", i, timer_val); } if (ji.buttons & (1 << i)) // if button is down @@ -1482,7 +1482,7 @@ void gameWinController::mouse_geteval() { m_MseState.m_absY = y; m_MseState.m_buttonMask = btnmask; - mprintf_at((1, 5, 30, "btnmask=%08d\n", btnmask)); + mprintf_at(1, 5, 30, "btnmask=%08d\n", btnmask); } // gets sensitivity of axis item diff --git a/win32/winapp.cpp b/win32/winapp.cpp index 001d7f1a..a3bda5e9 100644 --- a/win32/winapp.cpp +++ b/win32/winapp.cpp @@ -234,7 +234,7 @@ oeWin32Application::oeWin32Application(const char *name, unsigned flags, HInstan #endif if (!RegisterClass(&wc)) { - mprintf((0, "Failure to register window class (err:%x).\n", GetLastError())); + mprintf(0, "Failure to register window class (err:%x).\n", GetLastError()); return; } @@ -353,7 +353,7 @@ void oeWin32Application::init() { if (m_hWnd == NULL) { DWORD err = GetLastError(); - mprintf((0, "Failed to create game window (err: %x)\n", err)); + mprintf(0, "Failed to create game window (err: %x)\n", err); return; } @@ -401,7 +401,7 @@ int oeWin32Application::defer_block() { // QUIT APP. exit(1); } else if (msg.message == WM_MOVE) { - mprintf((0, "move msg\n")); + mprintf(0, "move msg\n"); } TranslateMessage(&msg); DispatchMessage(&msg); @@ -416,7 +416,7 @@ int oeWin32Application::defer_block() { if (this->active()) { #ifndef _DEBUG if (GetForegroundWindow() != (HWND)this->m_hWnd && !(m_Flags & OEAPP_CONSOLE)) { - mprintf((0, "forcing this window into the foreground.\n")); + mprintf(0, "forcing this window into the foreground.\n"); SetForegroundWindow((HWND)this->m_hWnd); } #endif @@ -466,11 +466,11 @@ void oeWin32Application::os_init() { #ifdef _DEBUG if (os == Win9x) { - mprintf((0, "Win9x system\n")); + mprintf(0, "Win9x system\n"); } else if (os == WinNT) { - mprintf((0, "WinNT %d.%d.%d system\n", major, minor, build)); + mprintf(0, "WinNT %d.%d.%d system\n", major, minor, build); } else { - mprintf((0, "Win32 non-standard operating system\n")); + mprintf(0, "Win32 non-standard operating system\n"); } #endif @@ -535,7 +535,7 @@ LResult oeWin32Application::WndProc(HWnd hwnd, unsigned msg, WParam wParam, LPar switch (msg) { case WM_ACTIVATEAPP: m_AppActive = wParam ? true : false; - // mprintf((0, "WM_ACTIVATEAPP (%u,%l)\n", wParam, lParam)); + // mprintf(0, "WM_ACTIVATEAPP (%u,%l)\n", wParam, lParam); break; } @@ -673,7 +673,7 @@ LRESULT WINAPI MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { break; case WM_POWERBROADCAST: // Won't allow OS to suspend operation for now. - mprintf((0, "WM_POWERBROADCAST=%u,%d\n", wParam, lParam)); + mprintf(0, "WM_POWERBROADCAST=%u,%d\n", wParam, lParam); if (wParam == PBT_APMQUERYSUSPEND) { return BROADCAST_QUERY_DENY; } diff --git a/win32/windata.cpp b/win32/windata.cpp index 93e3a6cb..43761e0e 100644 --- a/win32/windata.cpp +++ b/win32/windata.cpp @@ -91,7 +91,7 @@ oeWin32AppDatabase::oeWin32AppDatabase() { if (!res) { res = create_record(m_Basepath); if (!res) { - mprintf((1, "Unable to create registry directory.\n")); + mprintf(1, "Unable to create registry directory.\n"); } } } @@ -120,7 +120,7 @@ bool oeWin32AppDatabase::create_record(const char *pathname) { lres = RegCreateKeyEx((HKEY)hBaseKey, pathname, 0, "", REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkey, &disp); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to create key %s (%x)\n", pathname, lres)); + mprintf(1, "Unable to create key %s (%x)\n", pathname, lres); return 0; } @@ -142,7 +142,7 @@ bool oeWin32AppDatabase::lookup_record(const char *pathname) { lres = RegOpenKeyEx((HKEY)hBaseKey, pathname, 0, KEY_READ | KEY_WRITE | KEY_EXECUTE, &hkey); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to open key %s (%x)\n", pathname, lres)); + mprintf(1, "Unable to open key %s (%x)\n", pathname, lres); return 0; } @@ -166,7 +166,7 @@ bool oeWin32AppDatabase::read(const char *label, char *entry, int *entrylen) { assert(type != REG_DWORD); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to query str key %s (%x)\n", label, lres)); + mprintf(1, "Unable to query str key %s (%x)\n", label, lres); return 0; } return 1; @@ -188,7 +188,7 @@ bool oeWin32AppDatabase::read(const char *label, void *entry, int wordsize) { assert(len == 4); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to query int key %s (%x)\n", label, lres)); + mprintf(1, "Unable to query int key %s (%x)\n", label, lres); return 0; } @@ -234,7 +234,7 @@ bool oeWin32AppDatabase::write(const char *label, const char *entry, int entryle lres = RegSetValueEx((HKEY)hCurKey, label, 0, REG_SZ, (LPBYTE)entry, entrylen); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to write str key %s (%x)\n", label, lres)); + mprintf(1, "Unable to write str key %s (%x)\n", label, lres); return 0; } return 1; @@ -249,7 +249,7 @@ bool oeWin32AppDatabase::write(const char *label, int entry) { lres = RegSetValueEx((HKEY)hCurKey, label, 0, REG_DWORD, (LPBYTE)&entry, sizeof(int)); if (lres != ERROR_SUCCESS) { - mprintf((1, "Unable to write int key %s (%x)\n", label, lres)); + mprintf(1, "Unable to write int key %s (%x)\n", label, lres); return 0; }