Overhaul to console structure, a bit

This commit is contained in:
iikorni
2026-08-30 00:50:23 -05:00
parent de75b014b3
commit 216dd1aecd
70 changed files with 2081 additions and 2260 deletions
+48 -73
View File
@@ -6,6 +6,7 @@
<component name="BackendCodeEditorMiscSettings">
<option name="/Default/Housekeeping/FeatureSuggestion/FeatureSuggestionManager/DisabledSuggesters/=SwitchToGoToActionSuggester/@EntryIndexedValue" value="true" type="bool" />
<option name="/Default/Housekeeping/LiveTemplatesHousekeeping/HotspotSessionHintIsShown/@EntryValue" value="true" type="bool" />
<option name="/Default/Housekeeping/OptionsDialog/SelectedPageId/@EntryValue" value="CppGeneralOptions" type="string" />
</component>
<component name="CMakePresetLoader">{
&quot;useNewFormat&quot;: true
@@ -27,85 +28,57 @@
</configurations>
</component>
<component name="ChangeListManager">
<list default="true" id="f5455ea3-1ba8-4b1e-84ce-0eab50a09cdc" name="Changes" comment="More conversion">
<list default="true" id="f5455ea3-1ba8-4b1e-84ce-0eab50a09cdc" name="Changes" comment="Even more conversion, lots of superfluous macro removal">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CMakeLists.txt" beforeDir="false" afterPath="$PROJECT_DIR$/CMakeLists.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Misc/fix_externaltex.patch" beforeDir="false" afterPath="$PROJECT_DIR$/Misc/fix_externaltex.patch" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/bgmusic.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/bgmusic.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/bgmusic.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/bgmusic.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cd_null.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cd_null.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cd_sdl.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cd_sdl.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cdaudio.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cdaudio.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cfgfile.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cfgfile.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cl_demo.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cl_demo.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cl_input.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cl_input.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cl_main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cl_main.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cl_parse.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cl_parse.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/client.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/client.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cl_tent.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cl_tent.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cmd.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cmd.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/cmd.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/cmd.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/common.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/common.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/common.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/common.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/console.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/console.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/console.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/console.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/convar.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/convar.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/convar.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/convar.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/default_cfg.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/default_cfg.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_draw.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_draw.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_fog.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_fog.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_mesh.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_mesh.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_model.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_model.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_model.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_model.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_refrag.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_refrag.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_rmain.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_rmain.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_rmisc.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_rmisc.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_screen.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_screen.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_sky.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_sky.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_texmgr.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_texmgr.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_vidsdl.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_vidsdl.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/gl_warp.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/gl_warp.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/glquake.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/glquake.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/host.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/host.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/host_cmd.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/host_cmd.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/image.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/image.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/image.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/image.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/in_sdl.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/in_sdl.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/input.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/input.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/keys.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/keys.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/keys.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/keys.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/main_sdl.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/main_sdl.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/menu.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/menu.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/menu.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/menu.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_bsd.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_bsd.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_defs.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_defs.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_dgrm.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_dgrm.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_dgrm.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_dgrm.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_loop.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_loop.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_loop.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_loop.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_main.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_main.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_udp.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_udp.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_udp.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_udp.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_wins.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_wins.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_wins.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_wins.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_wipx.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_wipx.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/net_wipx.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/net_wipx.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/pr_cmds.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/pr_cmds.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/pr_edict.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/pr_edict.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/pr_exec.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/pr_exec.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/progs.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/progs.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/protocol.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/protocol.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/q_sound.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/q_sound.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/q_stdinc.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/q_stdinc.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/quakedef.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/quakedef.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/r_alias.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/r_alias.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/r_brush.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/r_brush.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/r_part.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/r_part.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/r_sprite.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/r_sprite.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/r_world.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/r_world.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/render.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/render.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/sbar.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sbar.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/screen.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/screen.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/server.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/server.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_codec.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_codec.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_codec.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_codec.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_codeci.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_codeci.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_dma.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_dma.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_flac.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_flac.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_mem.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_mem.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_mikmod.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_mikmod.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_mix.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_mix.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/snd_modplug.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/snd_modplug.cpp" afterDir="false" />
@@ -122,14 +95,10 @@
<change beforePath="$PROJECT_DIR$/Quake/sv_move.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sv_move.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/sv_phys.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sv_phys.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/sv_user.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sv_user.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/sys_sdl_unix.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sys_sdl_unix.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/sys_sdl_win.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/sys_sdl_win.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/vid.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/vid.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/view.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/view.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/wad.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/wad.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/world.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/world.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/world.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/world.hpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/zone.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/zone.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/Quake/zone.hpp" beforeDir="false" afterPath="$PROJECT_DIR$/Quake/zone.hpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -138,6 +107,7 @@
</component>
<component name="ClangdSettings">
<option name="formatViaClangd" value="false" />
<option name="clangWarnings" value="-Wno-invalid-static-assert-message,-Wno-unused-variable,-Wno-infinite-recursion,-Wno-array-bounds,-Wno-return-stack-address,-Werror=implicit-function-declaration,-Wshadow,-Wno-shadow-field-in-constructor-modified,-Wno-shadow-ivar,-Wuninitialized,-Wunused-label,-Wunused-lambda-capture" />
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="CMakeBuildProfile:Debug" />
<component name="Git.Settings">
@@ -145,6 +115,10 @@
</component>
<component name="HighlightingSettingsPerFile">
<setting file="mock:///dummy.cpp" root0="SKIP_HIGHLIGHTING" />
<setting file="mock:///home/iikorni/Downloads/quakespasm-0.96.3/Quake/console.cpp" root0="SKIP_HIGHLIGHTING" />
<setting file="mock:///home/iikorni/Downloads/quakespasm-0.96.3/Quake/host.cpp" root0="SKIP_HIGHLIGHTING" />
<setting file="mock:///home/iikorni/Downloads/quakespasm-0.96.3/Quake/keys.cpp" root0="SKIP_HIGHLIGHTING" />
<setting file="mock:///home/iikorni/Downloads/quakespasm-0.96.3/Quake/menu.cpp" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="MacroExpansionManager">
<option name="directoryName" value="5yRIaLtN" />
@@ -164,32 +138,33 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"CMake Application.quakespasm.executor": "Run",
"CidrDebugProfileConversion": "true",
"ModuleVcsDetector.initialDetectionPerformed": "true",
"RunOnceActivity.RadMigrateCodeStyle": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"RunOnceActivity.cidr.known.project.marker": "true",
"RunOnceActivity.git.unshallow": "true",
"RunOnceActivity.readMode.enableVisualFormatting": "true",
"RunOnceActivity.typescript.service.memoryLimit.init": "true",
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
"cf.first.check.clang-format": "false",
"cidr.known.project.marker": "true",
"codeWithMe.voiceChat.enabledByDefault": "false",
"git-widget-placeholder": "master",
"last_opened_file_path": "/home/iikorni/Downloads/quakespasm-0.96.3/cmake-build-debug/id1",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.jshint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.jshint": "",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;CMake Application.quakespasm.executor&quot;: &quot;Run&quot;,
&quot;CidrDebugProfileConversion&quot;: &quot;true&quot;,
&quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
&quot;RunOnceActivity.RadMigrateCodeStyle&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
&quot;RunOnceActivity.readMode.enableVisualFormatting&quot;: &quot;true&quot;,
&quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
&quot;SHARE_PROJECT_CONFIGURATION_FILES&quot;: &quot;true&quot;,
&quot;cf.first.check.clang-format&quot;: &quot;false&quot;,
&quot;cidr.known.project.marker&quot;: &quot;true&quot;,
&quot;codeWithMe.voiceChat.enabledByDefault&quot;: &quot;false&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;last_opened_file_path&quot;: &quot;/home/iikorni/Downloads/quakespasm-0.96.3/cmake-build-debug/id1&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.jshint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.jshint&quot;: &quot;&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;language.cpp.clang-tidy&quot;
}
}]]></component>
}</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/cmake-build-debug/id1" />
@@ -199,11 +174,6 @@
</key>
</component>
<component name="RunManager">
<configuration default="true" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
<configuration name="quakespasm" type="CMakeRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="quakespasm" TARGET_NAME="quakespasm" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="quakespasm" RUN_TARGET_NAME="quakespasm">
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
@@ -255,6 +225,11 @@
<component name="VcsManagerConfiguration">
<MESSAGE value="Begin converting QS engine to CPP" />
<MESSAGE value="More conversion" />
<option name="LAST_COMMIT_MESSAGE" value="More conversion" />
<MESSAGE value="Even more conversion, lots of superfluous macro removal" />
<option name="LAST_COMMIT_MESSAGE" value="Even more conversion, lots of superfluous macro removal" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />
<select />
</component>
</project>
+7 -7
View File
@@ -21,7 +21,7 @@ index 239d361..80948f1 100644
+ if (strstr(tx->name,"sky4")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==13039)
+ q_strlcpy(tx->name, "sky1", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ }
if (loadmodel->bspversion == BSPVERSION_QUAKE64)
@@ -38,40 +38,40 @@ index 239d361..80948f1 100644
+ q_strlcpy(tx->name, "plat_top1_cable", sizeof(tx->name));
+ else
+ q_strlcpy(tx->name, "plat_top1_bolt", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ if (strstr(tx->name,"metal5_2")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==49173)
+ q_strlcpy(tx->name, "metal5_2_x", sizeof(tx->name));
+ else
+ q_strlcpy(tx->name, "metal5_2_arc", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ if (strstr(tx->name,"metal5_4")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==20977)
+ q_strlcpy(tx->name, "metal5_4_double", sizeof(tx->name));
+ else
+ q_strlcpy(tx->name, "metal5_4_arc", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ if (strstr(tx->name,"metal5_8")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
+ q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
+ else
+ q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ if (strstr(tx->name,"metal5_8")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==48444)
+ q_strlcpy(tx->name, "metal5_8_rune", sizeof(tx->name));
+ else
+ q_strlcpy(tx->name, "metal5_8_back", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ if (strstr(tx->name,"window03")) {
+ if (CRC_Block((byte *)(tx+1), tx->width * tx->height)==63697) // e4m2 variant
+ q_strlcpy(tx->name, "window03_e4m2", sizeof(tx->name));
+ Con_Printf(" using %s\n", tx->name);
+ console::info(" using %s\n", tx->name);
+ }
+ }
+
+13 -13
View File
@@ -109,7 +109,7 @@ namespace music {
if (command::argc() == 2) {
play(*command::argv(1));
} else {
Con_Printf("music <musicfile>\n");
console::info("music <musicfile>\n");
}
}
@@ -136,9 +136,9 @@ namespace music {
}
if (bgmloop)
Con_Printf("Music will be looped\n");
console::info("Music will be looped\n");
else
Con_Printf("Music will not be looped\n");
console::info("Music will not be looped\n");
}
void _stop() {
@@ -147,7 +147,7 @@ namespace music {
void _jump() {
if (command::argc() != 2) {
Con_Printf("music_jump <ordernum>\n");
console::info("music_jump <ordernum>\n");
} else if (bgmstream) {
S_CodecJumpToOrder(bgmstream, static_cast<int>(std::strtol(command::argv(1)->c_str(), nullptr, 10)));
}
@@ -180,7 +180,7 @@ namespace music {
}
}
Con_Printf("Couldn't handle music file %s\n", filename.c_str());
console::info("Couldn't handle music file %s\n", filename.c_str());
}
void update_stream() {
@@ -239,14 +239,14 @@ namespace music {
{
if (bgmloop) {
if (did_rewind) {
Con_Printf("Stream keeps returning EOF.\n");
console::info("Stream keeps returning EOF.\n");
stop();
return;
}
res = S_CodecRewindStream(bgmstream);
if (res != 0) {
Con_Printf("Stream seek error (%i), stopping.\n", res);
console::info("Stream seek error (%i), stopping.\n", res);
stop();
return;
}
@@ -257,7 +257,7 @@ namespace music {
}
} else /* res < 0: some read error */
{
Con_Printf("Stream read error (%i), stopping.\n", res);
console::info("Stream read error (%i), stopping.\n", res);
stop();
return;
}
@@ -312,7 +312,7 @@ namespace music {
return;
if (filename.empty()) {
Con_DPrintf("null music file name\n");
console::debug("null music file name\n");
return;
}
@@ -332,7 +332,7 @@ namespace music {
}
}
if (chosen == nullptr) {
Con_Printf("Unhandled extension for %s\n", filename.c_str());
console::info("Unhandled extension for %s\n", filename.c_str());
return;
}
q_snprintf(tmp, sizeof(tmp), "%s/%s", chosen->dir, filename.c_str());
@@ -350,7 +350,7 @@ namespace music {
break;
}
Con_Printf("Couldn't handle music file %s\n", filename.c_str());
console::info("Couldn't handle music file %s\n", filename.c_str());
}
void stop() {
@@ -433,13 +433,13 @@ namespace music {
}
if (ext == nullptr)
Con_Printf("Couldn't find a cdrip for track %d\n", static_cast<int>(track));
console::info("Couldn't find a cdrip for track %d\n", static_cast<int>(track));
else {
q_snprintf(tmp, sizeof(tmp), "%s/track%02d.%s",
MUSIC_DIRNAME, static_cast<int>(track), ext);
bgmstream = S_CodecOpenStreamType(tmp, type, bgmloop);
if (!bgmstream)
Con_Printf("Couldn't handle music file %s\n", tmp);
console::info("Couldn't handle music file %s\n", tmp);
}
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ void CDAudio_Update(void)
int CDAudio_Init(void)
{
Con_Printf("CDAudio disabled at compile time\n");
console::info("CDAudio disabled at compile time\n");
return -1;
}
+27 -27
View File
@@ -66,7 +66,7 @@ static void CDAudio_Eject(void)
SDL_CDStop(cd_handle); /* see CDAudio_Stop() */
#endif
if (SDL_CDEject(cd_handle) < 0)
Con_Printf ("Unable to eject CD-ROM: %s\n", SDL_GetError ());
console::info ("Unable to eject CD-ROM: %s\n", SDL_GetError ());
}
static int CDAudio_GetAudioDiskInfo(void)
@@ -102,13 +102,13 @@ int CDAudio_Play(byte track, bool looping)
if (track < 1 || track > cd_handle->numtracks)
{
Con_Printf ("CDAudio_Play: Bad track number %d.\n", track);
console::info ("CDAudio_Play: Bad track number %d.\n", track);
return -1;
}
if (cd_handle->track[track-1].type == SDL_DATA_TRACK)
{
Con_Printf ("CDAudio_Play: track %d is not audio\n", track);
console::info ("CDAudio_Play: track %d is not audio\n", track);
return -1;
}
@@ -121,7 +121,7 @@ int CDAudio_Play(byte track, bool looping)
if (SDL_CDPlay(cd_handle, cd_handle->track[track-1].offset, cd_handle->track[track-1].length) < 0)
{
Con_Printf ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ());
console::info ("CDAudio_Play: Unable to play track %d: %s\n", track, SDL_GetError ());
return -1;
}
@@ -161,10 +161,10 @@ void CDAudio_Stop(void)
* Samsung DVD r/w drive running under 2.6.35.6 kernel.
* Therefore, avoid dead stops if playback may be resumed shortly. */
if (SDL_CDPause(cd_handle) < 0)
Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
console::info ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
#else
if (SDL_CDStop(cd_handle) < 0)
Con_Printf ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
console::info ("CDAudio_Stop: Unable to stop CD-ROM (%s)\n", SDL_GetError());
#endif
wasPlaying = false;
@@ -182,7 +182,7 @@ void CDAudio_Pause(void)
return;
if (SDL_CDPause(cd_handle) < 0)
Con_Printf ("Unable to pause CD-ROM: %s\n", SDL_GetError());
console::info ("Unable to pause CD-ROM: %s\n", SDL_GetError());
wasPlaying = playing;
playing = false;
@@ -201,7 +201,7 @@ void CDAudio_Resume(void)
return;
if (SDL_CDResume(cd_handle) < 0)
Con_Printf ("Unable to resume CD-ROM: %s\n", SDL_GetError());
console::info ("Unable to resume CD-ROM: %s\n", SDL_GetError());
playing = true;
endOfTrack += realtime - pausetime;
pausetime = -1.0;
@@ -223,10 +223,10 @@ static void CD_f (void)
if (command::argc() < 2)
{
Con_Printf("commands:");
Con_Printf("on, off, reset, remap, \n");
Con_Printf("play, stop, loop, pause, resume\n");
Con_Printf("eject, info, next, prev\n");
console::info("commands:");
console::info("on, off, reset, remap, \n");
console::info("play, stop, loop, pause, resume\n");
console::info("eject, info, next, prev\n");
return;
}
@@ -264,7 +264,7 @@ static void CD_f (void)
{
for (n = 1; n < 100; n++)
if (remap[n] != n)
Con_Printf(" %u -> %u\n", n, remap[n]);
console::info(" %u -> %u\n", n, remap[n]);
return;
}
for (n = 1; n <= ret; n++)
@@ -277,7 +277,7 @@ static void CD_f (void)
CDAudio_GetAudioDiskInfo();
if (!cdValid)
{
Con_Printf("No CD in player.\n");
console::info("No CD in player.\n");
return;
}
}
@@ -329,12 +329,12 @@ static void CD_f (void)
int current_min, current_sec, current_frame;
int length_min, length_sec, length_frame;
Con_Printf ("%u tracks\n", cd_handle->numtracks);
console::info ("%u tracks\n", cd_handle->numtracks);
if (playing)
Con_Printf("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
console::info("Currently %s track %u\n", playLooping ? "looping" : "playing", playTrack);
else if (wasPlaying)
Con_Printf("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
console::info("Paused %s track %u\n", playLooping ? "looping" : "playing", playTrack);
if (playing || wasPlaying)
{
@@ -342,11 +342,11 @@ static void CD_f (void)
FRAMES_TO_MSF(cd_handle->cur_frame, &current_min, &current_sec, &current_frame);
FRAMES_TO_MSF(cd_handle->track[playTrack-1].length, &length_min, &length_sec, &length_frame);
Con_Printf ("Current position: %d:%02d.%02d (of %d:%02d.%02d)\n",
console::info ("Current position: %d:%02d.%02d (of %d:%02d.%02d)\n",
current_min, current_sec, current_frame * 60 / CD_FPS,
length_min, length_sec, length_frame * 60 / CD_FPS);
}
Con_Printf("Volume is %f\n", bgmvolume.value);
console::info("Volume is %f\n", bgmvolume.value);
return;
}
@@ -367,7 +367,7 @@ static void CD_f (void)
return;
}
Con_Printf ("cd: unknown command \"%s\"\n", command);
console::info ("cd: unknown command \"%s\"\n", command);
}
static bool CD_GetVolume (void *unused)
@@ -504,12 +504,12 @@ int CDAudio_Init(void)
if (SDL_InitSubSystem(SDL_INIT_CDROM) < 0)
{
Con_Printf("Couldn't init SDL cdrom: %s\n", SDL_GetError());
console::info("Couldn't init SDL cdrom: %s\n", SDL_GetError());
return -1;
}
const int sdl_num_drives = SDL_CDNumDrives();
Con_Printf ("SDL detected %d CD-ROM drive%c\n", sdl_num_drives,
console::info ("SDL detected %d CD-ROM drive%c\n", sdl_num_drives,
sdl_num_drives == 1 ? ' ' : 's');
if (sdl_num_drives < 1)
@@ -520,7 +520,7 @@ int CDAudio_Init(void)
const char *userdev = get_cddev_arg(com_argv[dev.value()+1]);
if (!userdev)
{
Con_Printf("Invalid argument to -cddev\n");
console::info("Invalid argument to -cddev\n");
return -1;
}
for (auto i = 0; i < sdl_num_drives; i++)
@@ -533,7 +533,7 @@ int CDAudio_Init(void)
}
if (cd_dev == -1)
{
Con_Printf("SDL couldn't find cdrom device %s\n", userdev);
console::info("SDL couldn't find cdrom device %s\n", userdev);
return -1;
}
}
@@ -544,7 +544,7 @@ int CDAudio_Init(void)
cd_handle = SDL_CDOpen(cd_dev);
if (!cd_handle)
{
Con_Printf ("CDAudio_Init: Unable to open CD-ROM drive %s (%s)\n",
console::info ("CDAudio_Init: Unable to open CD-ROM drive %s (%s)\n",
SDL_CDName(cd_dev), SDL_GetError());
return -1;
}
@@ -554,11 +554,11 @@ int CDAudio_Init(void)
enabled = true;
old_cdvolume = bgmvolume.value;
Con_Printf("CDAudio initialized (SDL, using %s)\n", SDL_CDName(cd_dev));
console::info("CDAudio initialized (SDL, using %s)\n", SDL_CDName(cd_dev));
if (CDAudio_GetAudioDiskInfo())
{
Con_Printf("CDAudio_Init: No CD in drive\n");
console::info("CDAudio_Init: No CD in drive\n");
cdValid = false;
}
+17 -17
View File
@@ -174,7 +174,7 @@ int CL_GetMessage (void)
// discard nop keepalive message
if (net_message.cursize == 1 && net_message.data[0] == svc_nop)
Con_Printf ("<-- server to client keepalive\n");
console::info ("<-- server to client keepalive\n");
else
break;
}
@@ -208,7 +208,7 @@ void CL_Stop_f (void)
if (!cls.demorecording)
{
Con_Printf ("Not recording a demo.\n");
console::info ("Not recording a demo.\n");
return;
}
@@ -221,7 +221,7 @@ void CL_Stop_f (void)
fclose (cls.demofile);
cls.demofile = NULL;
cls.demorecording = false;
Con_Printf ("Completed demo\n");
console::info ("Completed demo\n");
// ericw -- update demo tab-completion list
DemoList_Rebuild ();
@@ -245,7 +245,7 @@ void CL_Record_f (void)
if (cls.demoplayback)
{
Con_Printf ("Can't record during demo playback\n");
console::info ("Can't record during demo playback\n");
return;
}
@@ -255,25 +255,25 @@ void CL_Record_f (void)
c = command::argc();
if (c != 2 && c != 3 && c != 4)
{
Con_Printf ("record <demoname> [<map> [cd track]]\n");
console::info ("record <demoname> [<map> [cd track]]\n");
return;
}
if (strstr(command::argv(1).value_or("").c_str(), ".."))
{
Con_Printf ("Relative pathnames are not allowed.\n");
console::info ("Relative pathnames are not allowed.\n");
return;
}
if (c == 2 && cls.state == ca_connected)
{
#if 0
Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
console::info("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
return;
#endif
if (cls.signon < 2)
{
Con_Printf("Can't record - try again when connected\n");
console::info("Can't record - try again when connected\n");
return;
}
}
@@ -282,7 +282,7 @@ void CL_Record_f (void)
if (c == 4)
{
track = atoi(command::argv(3)->c_str());
Con_Printf ("Forcing CD track to %i\n", cls.forcetrack);
console::info ("Forcing CD track to %i\n", cls.forcetrack);
}
else
{
@@ -302,11 +302,11 @@ void CL_Record_f (void)
// open the demo file
COM_AddExtension (name, ".dem", sizeof(name));
Con_Printf ("recording to %s.\n", name);
console::info ("recording to %s.\n", name);
cls.demofile = fopen (name, "wb");
if (!cls.demofile)
{
Con_Printf ("ERROR: couldn't create %s\n", name);
console::info ("ERROR: couldn't create %s\n", name);
return;
}
@@ -409,7 +409,7 @@ void CL_PlayDemo_f (void)
if (command::argc() != 2)
{
Con_Printf ("playdemo <demoname> : plays a demo\n");
console::info ("playdemo <demoname> : plays a demo\n");
return;
}
@@ -420,12 +420,12 @@ void CL_PlayDemo_f (void)
std::strncpy(name, command::argv(1).value_or("").c_str(), sizeof(name));
COM_AddExtension (name, ".dem", sizeof(name));
Con_Printf ("Playing demo from %s.\n", name);
console::info ("Playing demo from %s.\n", name);
COM_FOpenFile (name, &cls.demofile, NULL);
if (!cls.demofile)
{
Con_Printf ("ERROR: couldn't open %s\n", name);
console::info ("ERROR: couldn't open %s\n", name);
cls.demonum = -1; // stop demo loop
return;
}
@@ -439,7 +439,7 @@ void CL_PlayDemo_f (void)
fclose (cls.demofile);
cls.demofile = NULL;
cls.demonum = -1; // stop demo loop
Con_Printf ("ERROR: demo \"%s\" is invalid\n", name);
console::info ("ERROR: demo \"%s\" is invalid\n", name);
return;
}
@@ -469,7 +469,7 @@ static void CL_FinishTimeDemo (void)
time = realtime - cls.td_starttime;
if (!time)
time = 1;
Con_Printf ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);
console::info ("%i frames %5.1f seconds %5.1f fps\n", frames, time, frames/time);
}
/*
@@ -486,7 +486,7 @@ void CL_TimeDemo_f (void)
if (command::argc() != 2)
{
Con_Printf ("timedemo <demoname> : gets demo speeds\n");
console::info ("timedemo <demoname> : gets demo speeds\n");
return;
}
+2 -2
View File
@@ -79,7 +79,7 @@ void KeyDown(kbutton_t *b) {
else if (!b->down[1])
b->down[1] = k;
else {
Con_Printf("Three keys down for a button!\n");
console::info("Three keys down for a button!\n");
return;
}
@@ -388,7 +388,7 @@ void CL_SendMove(const usercmd_t *cmd) {
return;
if (NET_SendUnreliableMessage(cls.netcon, &buf) == -1) {
Con_Printf("CL_SendMove: lost server connection\n");
console::info("CL_SendMove: lost server connection\n");
CL_Disconnect();
}
}
+17 -17
View File
@@ -116,7 +116,7 @@ void CL_Disconnect(void) {
if (cls.demorecording)
CL_Stop_f();
Con_DPrintf("Sending clc_disconnect\n");
console::debug("Sending clc_disconnect\n");
SZ_Clear(&cls.message);
MSG_WriteByte(&cls.message, clc_disconnect);
NET_SendUnreliableMessage(cls.netcon, &cls.message);
@@ -160,7 +160,7 @@ void CL_EstablishConnection(const char *host) {
cls.netcon = NET_Connect(host);
if (!cls.netcon)
Host_Error("CL_Connect: connect failed");
Con_DPrintf("CL_EstablishConnection: connected to %s\n", host);
console::debug("CL_EstablishConnection: connected to %s\n", host);
cls.demonum = -1; // not in the demo loop now
cls.state = ca_connected;
@@ -178,7 +178,7 @@ An svc_signonnum has been received, perform a client side setup
void CL_SignonReply(void) {
char str[8192];
Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
console::debug("CL_SignonReply: %i\n", cls.signon);
switch (cls.signon) {
case 1:
@@ -227,7 +227,7 @@ void CL_NextDemo(void) {
if (!cls.demos[cls.demonum][0] || cls.demonum == MAX_DEMOS) {
cls.demonum = 0;
if (!cls.demos[cls.demonum][0]) {
Con_Printf("No demos listed with startdemos\n");
console::info("No demos listed with startdemos\n");
cls.demonum = -1;
CL_Disconnect();
return;
@@ -254,12 +254,12 @@ void CL_PrintEntities_f(void) {
return;
for (i = 0, ent = cl_entities; i < cl.num_entities; i++, ent++) {
Con_Printf("%3i:", i);
console::info("%3i:", i);
if (!ent->model) {
Con_Printf("EMPTY\n");
console::info("EMPTY\n");
continue;
}
Con_Printf("%s:%2i (%5.1f,%5.1f,%5.1f) [%5.1f %5.1f %5.1f]\n"
console::info("%s:%2i (%5.1f,%5.1f,%5.1f) [%5.1f %5.1f %5.1f]\n"
, ent->model->name, ent->frame, ent->origin[0], ent->origin[1], ent->origin[2], ent->angles[0],
ent->angles[1], ent->angles[2]);
}
@@ -597,7 +597,7 @@ int CL_ReadFromServer(void) {
} while (ret && cls.state == ca_connected);
if (cl_shownet.value)
Con_Printf("\n");
console::info("\n");
CL_RelinkEntities();
CL_UpdateTEnts();
@@ -606,13 +606,13 @@ int CL_ReadFromServer(void) {
//visedicts
if (cl_numvisedicts > 256 && dev_peakstats.visedicts <= 256)
Con_DWarning("%i visedicts exceeds standard limit of 256 (max = %d).\n", cl_numvisedicts, MAX_VISEDICTS);
console::dev_warn("%i visedicts exceeds standard limit of 256 (max = %d).\n", cl_numvisedicts, MAX_VISEDICTS);
dev_stats.visedicts = cl_numvisedicts;
dev_peakstats.visedicts = std::max(cl_numvisedicts, dev_peakstats.visedicts);
//temp entities
if (num_temp_entities > 64 && dev_peakstats.tempents <= 64)
Con_DWarning("%i tempentities exceeds standard limit of 64 (max = %d).\n", num_temp_entities,
console::dev_warn("%i tempentities exceeds standard limit of 64 (max = %d).\n", num_temp_entities,
MAX_TEMP_ENTITIES);
dev_stats.tempents = num_temp_entities;
dev_peakstats.tempents = std::max(num_temp_entities, dev_peakstats.tempents);
@@ -622,7 +622,7 @@ int CL_ReadFromServer(void) {
if (b->model && b->endtime >= cl.time)
num_beams++;
if (num_beams > 24 && dev_peakstats.beams <= 24)
Con_DWarning("%i beams exceeded standard limit of 24 (max = %d).\n", num_beams, MAX_BEAMS);
console::dev_warn("%i beams exceeded standard limit of 24 (max = %d).\n", num_beams, MAX_BEAMS);
dev_stats.beams = num_beams;
dev_peakstats.beams = std::max(num_beams, dev_peakstats.beams);
@@ -631,7 +631,7 @@ int CL_ReadFromServer(void) {
if (l->die >= cl.time && l->radius)
num_dlights++;
if (num_dlights > 32 && dev_peakstats.dlights <= 32)
Con_DWarning("%i dlights exceeded standard limit of 32 (max = %d).\n", num_dlights, MAX_DLIGHTS);
console::dev_warn("%i dlights exceeded standard limit of 32 (max = %d).\n", num_dlights, MAX_DLIGHTS);
dev_stats.dlights = num_dlights;
dev_peakstats.dlights = std::max(num_dlights, dev_peakstats.dlights);
@@ -675,7 +675,7 @@ void CL_SendCmd(void) {
return; // no message at all
if (!NET_CanSendMessage(cls.netcon)) {
Con_DPrintf("CL_SendCmd: can't send\n");
console::debug("CL_SendCmd: can't send\n");
return;
}
@@ -702,9 +702,9 @@ void CL_Tracepos_f(void) {
TraceLine(r_refdef.vieworg, v, w);
if (VectorLength(w) == 0)
Con_Printf("Tracepos: trace didn't hit anything\n");
console::info("Tracepos: trace didn't hit anything\n");
else
Con_Printf("Tracepos: (%i %i %i)\n", (int) w[0], (int) w[1], (int) w[2]);
console::info("Tracepos: (%i %i %i)\n", (int) w[0], (int) w[1], (int) w[2]);
}
/*
@@ -719,7 +719,7 @@ void CL_Viewpos_f(void) {
return;
#if 0
//camera position
Con_Printf("Viewpos: (%i %i %i) %i %i %i\n",
console::info("Viewpos: (%i %i %i) %i %i %i\n",
(int) r_refdef.vieworg[0],
(int) r_refdef.vieworg[1],
(int) r_refdef.vieworg[2],
@@ -728,7 +728,7 @@ void CL_Viewpos_f(void) {
(int) r_refdef.viewangles[ROLL]);
#else
//player position
Con_Printf("Viewpos: (%i %i %i) %i %i %i\n",
console::info("Viewpos: (%i %i %i) %i %i %i\n",
(int) cl_entities[cl.viewentity].origin[0],
(int) cl_entities[cl.viewentity].origin[1],
(int) cl_entities[cl.viewentity].origin[2],
+26 -26
View File
@@ -260,7 +260,7 @@ void CL_KeepaliveMessage(void) {
lastmsg = time;
// write out a nop
Con_Printf("--> client to server keepalive\n");
console::info("--> client to server keepalive\n");
MSG_WriteByte(&cls.message, clc_nop);
NET_SendMessage(cls.netcon, &cls.message);
@@ -279,7 +279,7 @@ void CL_ParseServerInfo(void) {
char model_precache[MAX_MODELS][MAX_QPATH];
char sound_precache[MAX_SOUNDS][MAX_QPATH];
Con_DPrintf("Serverinfo packet received.\n");
console::debug("Serverinfo packet received.\n");
// ericw -- bring up loading plaque for map changes within a demo.
// it will be hidden in CL_SignonReply.
@@ -295,7 +295,7 @@ void CL_ParseServerInfo(void) {
i = MSG_ReadLong();
//johnfitz -- support multiple protocols
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ) {
Con_Printf("\n"); //because there's no newline after serverinfo print
console::info("\n"); //because there's no newline after serverinfo print
Host_Error("Server returned version %i, not %i or %i or %i", i, PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE,
PROTOCOL_RMQ);
}
@@ -310,7 +310,7 @@ void CL_ParseServerInfo(void) {
cl.protocolflags = (unsigned int) MSG_ReadLong();
if (0 != (cl.protocolflags & (~supportedflags))) {
Con_Warning("PROTOCOL_RMQ protocolflags %i contains unsupported flags\n", cl.protocolflags);
console::warn("PROTOCOL_RMQ protocolflags %i contains unsupported flags\n", cl.protocolflags);
}
} else cl.protocolflags = 0;
@@ -329,11 +329,11 @@ void CL_ParseServerInfo(void) {
std::strncpy(cl.levelname, str, sizeof(cl.levelname));
// seperate the printfs so the server message can have a color
Con_Printf("\n%s\n", Con_Quakebar(40)); //johnfitz
Con_Printf("%c%s\n", 2, str);
console::info("\n%s\n", Con_Quakebar(40)); //johnfitz
console::info("%c%s\n", 2, str);
//johnfitz -- tell user which protocol this is
Con_Printf("Using protocol %i\n", i);
console::info("Using protocol %i\n", i);
// first we go through and touch all of the precache data that still
// happens to be in the cache, so precaching something else doesn't
@@ -354,7 +354,7 @@ void CL_ParseServerInfo(void) {
//johnfitz -- check for excessive models
if (nummodels >= 256)
Con_DWarning("%i models exceeds standard limit of 256 (max = %d).\n", nummodels, MAX_MODELS);
console::dev_warn("%i models exceeds standard limit of 256 (max = %d).\n", nummodels, MAX_MODELS);
//johnfitz
// precache sounds
@@ -372,7 +372,7 @@ void CL_ParseServerInfo(void) {
//johnfitz -- check for excessive sounds
if (numsounds >= 256)
Con_DWarning("%i sounds exceeds standard limit of 256 (max = %d).\n", numsounds, MAX_SOUNDS);
console::dev_warn("%i sounds exceeds standard limit of 256 (max = %d).\n", numsounds, MAX_SOUNDS);
//johnfitz
//
@@ -578,7 +578,7 @@ void CL_ParseUpdate(int bits) {
float a, b;
if (warn_about_nehahra_protocol) {
Con_Warning("nonstandard update bit, assuming Nehahra protocol\n");
console::warn("nonstandard update bit, assuming Nehahra protocol\n");
warn_about_nehahra_protocol = false;
}
@@ -908,33 +908,33 @@ static void CL_DumpPacket(void) {
int i, pos;
unsigned char *packet = net_message.data;
Con_Printf("CL_DumpPacket, BEGIN:\n");
console::info("CL_DumpPacket, BEGIN:\n");
pos = 0;
while (pos < net_message.cursize) {
Con_Printf("%5i ", pos);
console::info("%5i ", pos);
for (i = 0; i < 16; i++) {
if (pos >= net_message.cursize)
Con_Printf(" X ");
else Con_Printf("%2x ", packet[pos]);
console::info(" X ");
else console::info("%2x ", packet[pos]);
pos++;
}
pos -= 16;
for (i = 0; i < 16; i++) {
if (pos >= net_message.cursize)
Con_Printf("X");
console::info("X");
else if (packet[pos] == 0)
Con_Printf(".");
else Con_Printf("%c", packet[pos]);
console::info(".");
else console::info("%c", packet[pos]);
pos++;
}
Con_Printf("\n");
console::info("\n");
}
Con_Printf("CL_DumpPacket, --- END ---\n");
console::info("CL_DumpPacket, --- END ---\n");
}
#endif /* CL_DumpPacket */
#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
#define SHOWNET(x) if(cl_shownet.value==2)console::info ("%3i:%s\n", msg_readcount-1, x);
/*
=====================
@@ -951,9 +951,9 @@ void CL_ParseServerMessage(void) {
// if recording demos, copy the message out
//
if (cl_shownet.value == 1)
Con_Printf("%i ", net_message.cursize);
console::info("%i ", net_message.cursize);
else if (cl_shownet.value == 2)
Con_Printf("------------------\n");
console::info("------------------\n");
// cl.onground = false; // unless the server says otherwise
@@ -995,7 +995,7 @@ void CL_ParseServerMessage(void) {
break;
case svc_nop:
// Con_Printf ("svc_nop\n");
// console::info ("svc_nop\n");
break;
case svc_time:
@@ -1022,7 +1022,7 @@ void CL_ParseServerMessage(void) {
Host_EndGame("Server disconnected\n");
case svc_print:
Con_Printf("%s", MSG_ReadString());
console::info("%s", MSG_ReadString());
break;
case svc_centerprint:
@@ -1146,7 +1146,7 @@ void CL_ParseServerMessage(void) {
//johnfitz -- if signonnum==2, signon packet has been fully parsed, so check for excessive static ents and efrags
if (i == 2) {
if (cl.num_statics > 128)
Con_DWarning("%i static entities exceeds standard limit of 128 (max = %d).\n", cl.num_statics,
console::dev_warn("%i static entities exceeds standard limit of 128 (max = %d).\n", cl.num_statics,
MAX_STATIC_ENTITIES);
R_CheckEfrags();
}
@@ -1248,7 +1248,7 @@ void CL_ParseServerMessage(void) {
//used by the 2021 rerelease
case svc_achievement:
str = MSG_ReadString();
Con_DPrintf("Ignoring svc_achievement (%s)\n", str);
console::debug("Ignoring svc_achievement (%s)\n", str);
break;
case svc_localsound:
CL_ParseLocalSound();
+1 -1
View File
@@ -102,7 +102,7 @@ void CL_ParseBeam (qmodel_t *m)
//johnfitz -- less spammy overflow message
if (!dev_overflows.beams || dev_overflows.beams + CONSOLE_RESPAM_TIME < realtime )
{
Con_Printf ("Beam list overflow!\n");
console::info ("Beam list overflow!\n");
dev_overflows.beams = realtime;
}
//johnfitz
+26 -26
View File
@@ -79,29 +79,29 @@ namespace command {
if (partial.has_value() && !name.starts_with(partial.value())) {
continue;
}
Con_SafePrintf(" %s\n", name.c_str());
console::safe_print(" %s\n", name.c_str());
count++;
}
Con_SafePrintf("%i commands", count);
console::safe_print("%i commands", count);
if (partial) {
Con_SafePrintf(" beginning with \"%s\"", partial->c_str());
console::safe_print(" beginning with \"%s\"", partial->c_str());
}
Con_SafePrintf("\n");
console::safe_print("\n");
}
void _unalias() {
switch (argc()) {
default:
case 1:
Con_Printf("unalias <name> : delete alias\n");
console::info("unalias <name> : delete alias\n");
break;
case 2: {
const auto name = argv(1).value();
if (ALIASES.contains(name)) {
ALIASES.erase(name);
} else {
Con_Printf("No alias named %s\n", name.c_str());
console::info("No alias named %s\n", name.c_str());
}
break;
}
@@ -114,13 +114,13 @@ namespace command {
//list all aliases
auto count = 0;
for (auto &[name, alias]: ALIASES) {
Con_SafePrintf(" %s: %s", name.c_str(), alias.value.c_str());
console::safe_print(" %s: %s", name.c_str(), alias.value.c_str());
count++;
}
if (count != 0)
Con_SafePrintf("%i alias command(s)\n", count);
console::safe_print("%i alias command(s)\n", count);
else
Con_SafePrintf("no alias commands found\n");
console::safe_print("no alias commands found\n");
break;
}
case 2: {
@@ -128,14 +128,14 @@ namespace command {
const auto lookup = argv(1).value();
for (auto &[name, alias]: ALIASES)
if (name.starts_with(lookup))
Con_Printf(" %s: %s", name.c_str(), alias.value.c_str());
console::info(" %s: %s", name.c_str(), alias.value.c_str());
break;
}
default: {
//set alias string
const auto new_name = argv(1).value();
if (new_name.length() >= MAX_ALIAS_LENGTH) {
Con_Printf("Alias name is too long\n");
console::info("Alias name is too long\n");
return;
}
@@ -212,7 +212,7 @@ namespace command {
void _exec() {
if (argc() != 2) {
Con_Printf("exec <filename> : execute a script file\n");
console::info("exec <filename> : execute a script file\n");
return;
}
@@ -225,10 +225,10 @@ namespace command {
f = default_cfg; /* see above.. */
}
if (f == nullptr) {
Con_Printf("couldn't exec %s\n", argv(1)->c_str());
console::info("couldn't exec %s\n", argv(1)->c_str());
return;
}
Con_Printf("execing %s\n", argv(1)->c_str());
console::info("execing %s\n", argv(1)->c_str());
buffer::insert_text(f);
if (f != default_cfg) {
@@ -238,8 +238,8 @@ namespace command {
void _echo() {
for (auto i = 1; i < argc(); i++)
Con_Printf("%s ", argv(i)->c_str());
Con_Printf("\n");
console::info("%s ", argv(i)->c_str());
console::info("\n");
}
char *tint_substring(const char *in, const char *substr, char *out, const size_t outsize) {
@@ -266,14 +266,14 @@ namespace command {
int hits = 0;
const auto substr = argv(1);
if (!substr.has_value()) {
Con_SafePrintf("%s <substring> : search through commands and cvars for the given substring\n",
console::safe_print("%s <substring> : search through commands and cvars for the given substring\n",
argv(0).value().c_str());
return;
}
for (const auto &name: REFS | std::views::keys) {
if (q_strcasestr(name.c_str(), substr.value().c_str())) {
hits++;
Con_SafePrintf(
console::safe_print(
"%s\n", tint_substring(name.c_str(), substr.value().c_str(), tmpbuf, sizeof(tmpbuf)));
}
}
@@ -281,13 +281,13 @@ namespace command {
for (const auto &var: convar::get_variables()) {
if (q_strcasestr(var->name.c_str(), substr.value().c_str())) {
hits++;
Con_SafePrintf("%s (current value: \"%s\")\n",
console::safe_print("%s (current value: \"%s\")\n",
tint_substring(var->name.c_str(), substr.value().c_str(), tmpbuf, sizeof(tmpbuf)),
var->string);
}
}
if (!hits)
Con_SafePrintf("no cvars nor commands contain that substring\n");
console::safe_print("no cvars nor commands contain that substring\n");
}
}
@@ -325,14 +325,14 @@ namespace command {
// fail if the command is a variable name
if (convar::variable_string(name).has_value()) {
Con_Printf("Cmd_AddCommand: %s already defined as a var\n", name.c_str());
console::info("Cmd_AddCommand: %s already defined as a var\n", name.c_str());
return;
}
// fail if the command already exists
for (auto &[other_name, func]: std::ranges::views::values(REFS)) {
if (name == other_name) {
Con_Printf("Cmd_AddCommand: %s already defined\n", name.c_str());
console::info("Cmd_AddCommand: %s already defined\n", name.c_str());
return;
}
}
@@ -433,12 +433,12 @@ namespace command {
// check cvars
if (!Cvar_Command())
Con_Printf("Unknown command \"%s\"\n", argv(0).value().c_str());
console::info("Unknown command \"%s\"\n", argv(0).value().c_str());
}
void forward_to_server() {
if (cls.state != ca_connected) {
Con_Printf("Can't \"%s\", not connected\n", argv(0).value_or("").c_str());
console::info("Can't \"%s\", not connected\n", argv(0).value_or("").c_str());
return;
}
@@ -491,7 +491,7 @@ namespace command::buffer {
void add_text(const std::string &text) {
if (_buffer.length() + text.length() >= MAX_BUFFER_SIZE) {
Con_Printf("command::buffer::add_text(): overflow\n");
console::info("command::buffer::add_text(): overflow\n");
return;
}
@@ -500,7 +500,7 @@ namespace command::buffer {
void insert_text(const std::string &text) {
if (_buffer.length() + text.length() >= MAX_BUFFER_SIZE) {
Con_Printf("command::buffer::insert_text(): overflow\n");
console::info("command::buffer::insert_text(): overflow\n");
return;
}
+28 -28
View File
@@ -689,7 +689,7 @@ void *SZ_GetSpace(sizebuf_t *buf, int length) {
Sys_Error("SZ_GetSpace: %i is > full buffer size", length);
buf->overflowed = true;
Con_Printf("SZ_GetSpace: overflow\n");
console::info("SZ_GetSpace: overflow\n");
SZ_Clear(buf);
}
@@ -1069,7 +1069,7 @@ static void COM_CheckRegistered(void) {
if (h == -1) {
convar::set_rom("registered", "0");
Con_Printf("Playing shareware version.\n");
console::info("Playing shareware version.\n");
if (com_modified)
Sys_Error("You must have the registered version to use modified games.\n\n"
"Basedir is: %s\n\n"
@@ -1098,7 +1098,7 @@ static void COM_CheckRegistered(void) {
convar::set_rom("cmdline", &com_cmdline[i]);
convar::set_rom("registered", "1");
Con_Printf("Playing registered version.\n");
console::info("Playing registered version.\n");
}
@@ -1129,7 +1129,7 @@ void COM_InitArgv(int argc, char **argv) {
if (n > 0 && com_cmdline[n - 1] == ' ')
com_cmdline[n - 1] = 0; //johnfitz -- kill the trailing space
Con_Printf("Command line: %s\n", com_cmdline);
console::info("Command line: %s\n", com_cmdline);
for (com_argc = 0; (com_argc < MAX_NUM_ARGVS) && (com_argc < argc); com_argc++) {
largv[com_argc] = argv[com_argc];
@@ -1226,12 +1226,12 @@ COM_Path_f
static void COM_Path_f(void) {
searchpath_t *s;
Con_Printf("Current search path:\n");
console::info("Current search path:\n");
for (s = com_searchpaths; s; s = s->next) {
if (s->pack) {
Con_Printf("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
console::info("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
} else
Con_Printf("%s\n", s->filename);
console::info("%s\n", s->filename);
}
}
@@ -1380,8 +1380,8 @@ static int COM_FindFile(const char *filename, int *handle, FILE **file,
&& strcmp(COM_FileGetExtension(filename), "lit") != 0
&& strcmp(COM_FileGetExtension(filename), "vis") != 0
&& strcmp(COM_FileGetExtension(filename), "ent") != 0)
Con_DPrintf("FindFile: can't find %s\n", filename);
else Con_DPrintf2("FindFile: can't find %s\n", filename);
console::debug("FindFile: can't find %s\n", filename);
else console::trace("FindFile: can't find %s\n", filename);
if (handle)
*handle = -1;
@@ -1760,22 +1760,22 @@ static void COM_Game_f(void) {
if (!registered.value) //disable shareware quake
{
Con_Printf("You must have the registered version to use modified games\n");
console::info("You must have the registered version to use modified games\n");
return;
}
if (!*p || !strcmp(p, ".") || strstr(p, "..") || strstr(p, "/") || strstr(p, "\\") || strstr(p, ":")) {
Con_Printf("gamedir should be a single directory name, not a path\n");
console::info("gamedir should be a single directory name, not a path\n");
return;
}
if (*p2) {
if (strcmp(p2, "-hipnotic") && strcmp(p2, "-rogue") && strcmp(p2, "-quoth")) {
Con_Printf("invalid mission pack argument to \"game\"\n");
console::info("invalid mission pack argument to \"game\"\n");
return;
}
if (!q_strcasecmp(p, GAMENAME)) {
Con_Printf("no mission pack arguments to %s game\n", GAMENAME);
console::info("no mission pack arguments to %s game\n", GAMENAME);
return;
}
}
@@ -1783,7 +1783,7 @@ static void COM_Game_f(void) {
if (Sys_FileType(va("%s/%s", com_basedir, p)) != FS_ENT_DIRECTORY) {
if (host_parms->userdir == host_parms->basedir || (
Sys_FileType(va("%s/%s", host_parms->userdir, p)) != FS_ENT_DIRECTORY)) {
Con_Printf("No such game directory \"%s\"\n", p);
console::info("No such game directory \"%s\"\n", p);
return;
}
}
@@ -1797,13 +1797,13 @@ static void COM_Game_f(void) {
// as '-missionpack', otherwise would be a mess
if (!q_strcasecmp(p, &p2[1]))
goto _same;
Con_Printf("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]);
console::info("reloading game \"%s\" with \"%s\" support\n", p, &p2[1]);
} else if (!*p2 && com_searchpaths->path_id > 2)
Con_Printf("reloading game \"%s\" without mission pack support\n", p);
console::info("reloading game \"%s\" without mission pack support\n", p);
else goto _same;
} else {
_same:
Con_Printf("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" is already \"%s\"\n", COM_SkipPath(com_gamedir));
return;
}
}
@@ -1874,13 +1874,13 @@ static void COM_Game_f(void) {
Host_Resetdemos();
DemoList_Rebuild();
Con_Printf("\"game\" changed to \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" changed to \"%s\"\n", COM_SkipPath(com_gamedir));
VID_Lock();
command::buffer::add_text("exec quake.rc\n");
command::buffer::add_text("vid_unlock\n");
} else //Diplay the current gamedir
Con_Printf("\"game\" is \"%s\"\n", COM_SkipPath(com_gamedir));
console::info("\"game\" is \"%s\"\n", COM_SkipPath(com_gamedir));
}
/*
@@ -2208,7 +2208,7 @@ void LOC_LoadFile(const char *file) {
if (!file || !*file)
return;
Con_Printf("\nLanguage initialization\n");
console::info("\nLanguage initialization\n");
memset(&archive, 0, sizeof(archive));
q_snprintf(path, sizeof(path), "%s/%s", com_basedir, file);
@@ -2249,7 +2249,7 @@ void LOC_LoadFile(const char *file) {
mz_zip_reader_end(&archive);
if (rw)
SDL_RWclose(rw);
Con_Printf("Couldn't load '%s'\nfrom '%s'\n", file, com_basedir);
console::info("Couldn't load '%s'\nfrom '%s'\n", file, com_basedir);
return;
}
SDL_RWread(rw, localization.text, 1, sz);
@@ -2284,7 +2284,7 @@ void LOC_LoadFile(const char *file) {
if (line[0] == '/') {
if (line[1] != '/')
Con_DPrintf("LOC_LoadFile: malformed comment on line %d\n", lineno);
console::debug("LOC_LoadFile: malformed comment on line %d\n", lineno);
} else if (equals) {
char *key_end = equals;
bool leading_quote;
@@ -2333,7 +2333,7 @@ void LOC_LoadFile(const char *file) {
break;
default:
Con_Printf("LOC_LoadFile: unrecognized escape sequence \\%c on line %d\n", c, lineno);
console::info("LOC_LoadFile: unrecognized escape sequence \\%c on line %d\n", c, lineno);
*value_dst++ = c;
break;
}
@@ -2379,7 +2379,7 @@ void LOC_LoadFile(const char *file) {
localization.numindices = localization.numentries * 2; // 50% load factor
if (localization.numindices == 0) {
Con_Printf("No localized strings in file '%s'\n", file);
console::info("No localized strings in file '%s'\n", file);
return;
}
@@ -2406,7 +2406,7 @@ void LOC_LoadFile(const char *file) {
}
}
Con_Printf("Loaded %d strings from '%s'\n", localization.numentries, file);
console::info("Loaded %d strings from '%s'\n", localization.numentries, file);
}
/*
@@ -2538,7 +2538,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
int numargs = 0;
if (!len) {
Con_DPrintf("LOC_Format: no output space\n");
console::debug("LOC_Format: no output space\n");
return 0;
}
--len; // reserve space for the terminator
@@ -2559,7 +2559,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
insert_len = std::strlen(insert);
if (insert_len > space_left) {
Con_DPrintf("LOC_Format: overflow at argument #%d\n", numargs);
console::debug("LOC_Format: overflow at argument #%d\n", numargs);
insert_len = space_left;
}
@@ -2568,7 +2568,7 @@ size_t LOC_Format(const char *format, const char * (*getarg_fn)(int idx, void *u
}
if (*format)
Con_DPrintf("LOC_Format: overflow\n");
console::debug("LOC_Format: overflow\n");
out[written] = 0;
+410 -477
View File
File diff suppressed because it is too large Load Diff
+33 -18
View File
@@ -23,47 +23,62 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef __CONSOLE_H
#define __CONSOLE_H
//
// console
//
extern int con_totallines;
extern int con_backscroll;
extern bool con_forcedup; // because no entities to refresh
extern bool con_initialized;
extern byte *con_chars;
extern char con_lastcenterstring[]; //johnfitz
void Con_DrawCharacter(int cx, int line, int num);
namespace console {
extern int total_lines;
extern int back_scroll;
extern bool forced_up;
extern bool initialized;
void init();
void line_feed();
void info(const char *fmt, ...);
void warn(const char *fmt, ...);
void dev_warn(const char *fmt, ...);
void debug(const char *fmt, ...);
void trace(const char *fmt, ...);
void safe_print(const char *fmt, ...);
void toggle_console();
}
void Con_CheckResize(void);
void Con_Init (void);
void Con_DrawConsole(int lines, bool drawinput);
void Con_Printf (const char *fmt, ...) FUNC_PRINTF(1,2);
void Con_DWarning (const char *fmt, ...) FUNC_PRINTF(1,2); //ericw
void Con_Warning (const char *fmt, ...) FUNC_PRINTF(1,2); //johnfitz
void Con_DPrintf (const char *fmt, ...) FUNC_PRINTF(1,2);
void Con_DPrintf2 (const char *fmt, ...) FUNC_PRINTF(1,2); //johnfitz
void Con_SafePrintf (const char *fmt, ...) FUNC_PRINTF(1,2);
void Con_DrawNotify(void);
void Con_ClearNotify(void);
void Con_ToggleConsole_f (void);
void Con_NotifyBox(const char *text); // during startup for sound / cd warnings
void Con_Show(void);
void Con_Hide(void);
const char *Con_Quakebar(int len);
void Con_TabComplete(void);
void Con_LogCenterPrint(const char *str);
//
// debuglog
//
void LOG_Init(quakeparms_t *parms);
void LOG_Close(void);
void Con_DebugLog(const char *msg);
#endif /* __CONSOLE_H */
+13 -13
View File
@@ -61,7 +61,7 @@ void Cvar_List_f() {
if (partial && std::strncmp(partial, name.c_str(), len) != 0) {
continue;
}
Con_SafePrintf("%s%s %s \"%s\"\n",
console::safe_print("%s%s %s \"%s\"\n",
var->flags.archive ? "*" : " ",
var->flags.notify ? "s" : " ",
name.c_str(),
@@ -69,11 +69,11 @@ void Cvar_List_f() {
count++;
}
Con_SafePrintf("%i cvars", count);
console::safe_print("%i cvars", count);
if (partial) {
Con_SafePrintf(" beginning with \"%s\"", partial);
console::safe_print(" beginning with \"%s\"", partial);
}
Con_SafePrintf("\n");
console::safe_print("\n");
}
/*
@@ -85,7 +85,7 @@ void Cvar_Inc_f(void) {
switch (command::argc()) {
default:
case 1:
Con_Printf("inc <cvar> [amount] : increment cvar\n");
console::info("inc <cvar> [amount] : increment cvar\n");
break;
case 2:
convar::set_value(*command::argv(1), convar::variable_value(*command::argv(1)).value_or(0.0) + 1);
@@ -105,7 +105,7 @@ void Cvar_Toggle_f() {
switch (command::argc()) {
default:
case 1:
Con_Printf("toggle <cvar> : toggle cvar\n");
console::info("toggle <cvar> : toggle cvar\n");
break;
case 2:
if (convar::variable_value(*command::argv(1)).value_or(0.0) != 0.0)
@@ -125,7 +125,7 @@ void Cvar_Cycle_f() {
int i;
if (command::argc() < 3) {
Con_Printf("cycle <cvar> <value list>: cycle cvar through a list of values\n");
console::info("cycle <cvar> <value list>: cycle cvar through a list of values\n");
return;
}
@@ -162,7 +162,7 @@ void Cvar_Reset_f() {
switch (command::argc()) {
default:
case 1:
Con_Printf("reset <cvar> : reset cvar to default\n");
console::info("reset <cvar> : reset cvar to default\n");
break;
case 2:
convar::reset(*command::argv(1));
@@ -320,7 +320,7 @@ std::optional<std::string_view> convar::complete_variable(const std::string_view
*/
void convar::reset(const std::string &name) {
if (const auto var = find_var(name); !var.has_value())
Con_Printf("variable \"%s\" not found\n", name.c_str());
console::info("variable \"%s\" not found\n", name.c_str());
else
var.value()->set(var.value()->default_string);
}
@@ -390,7 +390,7 @@ void convar::set(const std::string &name, const std::string &value) {
const auto var = find_var(name);
if (!var.has_value()) {
// there is an error in C code if this happens
Con_Printf("Cvar_Set: variable %s not found\n", name.c_str());
console::info("Cvar_Set: variable %s not found\n", name.c_str());
return;
}
@@ -460,13 +460,13 @@ void convar::inscribe() {
// first check to see if it has already been defined
if (find_var(this->name)) {
Con_Printf("Can't register variable %s, already defined\n", this->name.c_str());
console::info("Can't register variable %s, already defined\n", this->name.c_str());
return;
}
// check for overlap with a command
if (command::exists(this->name)) {
Con_Printf("Cvar_RegisterVariable: %s is a command\n", this->name.c_str());
console::info("Cvar_RegisterVariable: %s is a command\n", this->name.c_str());
return;
}
@@ -515,7 +515,7 @@ bool Cvar_Command() {
// perform a variable print or set
if (command::argc() == 1) {
Con_Printf("\"%s\" is \"%s\"\n", var.value()->name.c_str(), var.value()->string);
console::info("\"%s\" is \"%s\"\n", var.value()->name.c_str(), var.value()->string);
return true;
}
+1 -1
View File
@@ -559,7 +559,7 @@ void Draw_ConsoleBackground (void)
pic->width = vid.conwidth;
pic->height = vid.conheight;
alpha = (con_forcedup) ? 1.0f : scr_conalpha.value;
alpha = (console::forced_up) ? 1.0f : scr_conalpha.value;
GL_SetCanvas (CANVAS_CONSOLE); //in case this is called from weird places
+9 -9
View File
@@ -115,15 +115,15 @@ void Fog_FogCommand_f(void) {
switch (command::argc()) {
default:
case 1:
Con_Printf("usage:\n");
Con_Printf(" fog <density>\n");
Con_Printf(" fog <red> <green> <blue>\n");
Con_Printf(" fog <density> <red> <green> <blue>\n");
Con_Printf("current values:\n");
Con_Printf(" \"density\" is \"%f\"\n", fog_density);
Con_Printf(" \"red\" is \"%f\"\n", fog_red);
Con_Printf(" \"green\" is \"%f\"\n", fog_green);
Con_Printf(" \"blue\" is \"%f\"\n", fog_blue);
console::info("usage:\n");
console::info(" fog <density>\n");
console::info(" fog <red> <green> <blue>\n");
console::info(" fog <density> <red> <green> <blue>\n");
console::info("current values:\n");
console::info(" \"density\" is \"%f\"\n", fog_density);
console::info(" \"red\" is \"%f\"\n", fog_red);
console::info(" \"green\" is \"%f\"\n", fog_green);
console::info(" \"blue\" is \"%f\"\n", fog_blue);
return;
case 2:
d = std::atof(command::argv(1)->c_str());
+2 -2
View File
@@ -276,7 +276,7 @@ static void BuildTris (void)
commands[numcommands++] = 0; // end of list marker
Con_DPrintf2 ("%3i tri %3i vert %3i cmd\n", pheader->numtris, numorder, numcommands);
console::trace ("%3i tri %3i vert %3i cmd\n", pheader->numtris, numorder, numcommands);
}
static void GL_MakeAliasModelDisplayLists_VBO (qmodel_t *, aliashdr_t *);
@@ -303,7 +303,7 @@ void GL_MakeAliasModelDisplayLists (qmodel_t *m, aliashdr_t *hdr)
//johnfitz
//johnfitz -- generate meshes
Con_DPrintf2 ("meshing %s...\n",m->name);
console::trace ("meshing %s...\n",m->name);
BuildTris ();
// save the data out
+40 -40
View File
@@ -178,7 +178,7 @@ static byte *Mod_DecompressVis (byte *in, qmodel_t *model)
{
if(!model->viswarn) {
model->viswarn = true;
Con_Warning("Mod_DecompressVis: output overrun on model \"%s\"\n", model->name);
console::warn("Mod_DecompressVis: output overrun on model \"%s\"\n", model->name);
}
return mod_decompressed;
}
@@ -471,7 +471,7 @@ static void Mod_LoadTextures (lump_t *l)
//johnfitz -- don't return early if no textures; still need to create dummy texture
if (!l->filelen)
{
Con_Printf ("Mod_LoadTextures: no textures in bsp file\n");
console::info ("Mod_LoadTextures: no textures in bsp file\n");
nummiptex = 0;
m = NULL; // avoid bogus compiler warning
}
@@ -499,14 +499,14 @@ static void Mod_LoadTextures (lump_t *l)
if (mt->width == 0 || mt->height == 0)
{
Con_Warning ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
console::warn ("Zero sized texture %s in %s!\n", mt->name, loadmodel->name);
continue;
}
if ( (mt->width & 15) || (mt->height & 15) )
{
if (loadmodel->bspversion != BSPVERSION_QUAKE64)
Con_Warning ("Texture %s (%d x %d) is not 16 aligned\n", mt->name, mt->width, mt->height);
console::warn ("Texture %s (%d x %d) is not 16 aligned\n", mt->name, mt->width, mt->height);
}
pixels = mt->width*mt->height; // only copy the first mip, the rest are auto-generated
@@ -524,7 +524,7 @@ static void Mod_LoadTextures (lump_t *l)
// the end of the .bsp file buffer
if (((byte*)(mt+1) + pixels) > (mod_base + l->fileofs + l->filelen))
{
Con_DPrintf("Texture %s extends past end of lump\n", mt->name);
console::debug("Texture %s extends past end of lump\n", mt->name);
pixels = std::max(0L, (long)((mod_base + l->fileofs + l->filelen) - (byte*)(mt+1)));
}
@@ -787,7 +787,7 @@ static void Mod_LoadLighting (lump_t *l)
if (path_id < loadmodel->path_id)
{
Hunk_FreeToLowMark(mark);
Con_DPrintf("ignored %s from a gamedir with lower priority\n", litfilename);
console::debug("ignored %s from a gamedir with lower priority\n", litfilename);
}
else
if (data[0] == 'Q' && data[1] == 'L' && data[2] == 'I' && data[3] == 'T')
@@ -797,23 +797,23 @@ static void Mod_LoadLighting (lump_t *l)
{
if (8+l->filelen*3 == com_filesize)
{
Con_DPrintf2("%s loaded\n", litfilename);
console::trace("%s loaded\n", litfilename);
loadmodel->lightdata = data + 8;
return;
}
Hunk_FreeToLowMark(mark);
Con_Printf("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize);
console::info("Outdated .lit file (%s should be %u bytes, not %u)\n", litfilename, 8+l->filelen*3, com_filesize);
}
else
{
Hunk_FreeToLowMark(mark);
Con_Printf("Unknown .lit file version (%d)\n", i);
console::info("Unknown .lit file version (%d)\n", i);
}
}
else
{
Hunk_FreeToLowMark(mark);
Con_Printf("Corrupt .lit file (old version?), ignoring\n");
console::info("Corrupt .lit file (old version?), ignoring\n");
}
}
// LordHavoc: no .lit found, expand the white lighting data to color
@@ -900,13 +900,13 @@ static void Mod_LoadEntities (lump_t *l)
COM_StripExtension(basemapname, basemapname, sizeof(basemapname));
q_snprintf(entfilename, sizeof(entfilename), "%s@%04x.ent", basemapname, crc);
Con_DPrintf2("trying to load %s\n", entfilename);
console::trace("trying to load %s\n", entfilename);
ents = (char *) COM_LoadHunkFile (entfilename, &path_id);
if (!ents)
{
q_snprintf(entfilename, sizeof(entfilename), "%s.ent", basemapname);
Con_DPrintf2("trying to load %s\n", entfilename);
console::trace("trying to load %s\n", entfilename);
ents = (char *) COM_LoadHunkFile (entfilename, &path_id);
}
@@ -917,12 +917,12 @@ static void Mod_LoadEntities (lump_t *l)
if (path_id < loadmodel->path_id)
{
Hunk_FreeToLowMark(mark);
Con_DPrintf("ignored %s from a gamedir with lower priority\n", entfilename);
console::debug("ignored %s from a gamedir with lower priority\n", entfilename);
}
else
{
loadmodel->entities = ents;
Con_DPrintf("Loaded external entity file %s\n", entfilename);
console::debug("Loaded external entity file %s\n", entfilename);
return;
}
}
@@ -1067,7 +1067,7 @@ static void Mod_LoadTexinfo (lump_t *l)
//johnfitz: report missing textures
if (missing && loadmodel->numtextures > 1)
Con_Printf ("Mod_LoadTexinfo: %d texture(s) missing from BSP file\n", missing);
console::info ("Mod_LoadTexinfo: %d texture(s) missing from BSP file\n", missing);
//johnfitz
}
@@ -1248,7 +1248,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
//johnfitz -- warn mappers about exceeding old limits
if (count > 32767 && !bsp2)
Con_DWarning ("%i faces exceeds standard limit of 32767.\n", count);
console::dev_warn ("%i faces exceeds standard limit of 32767.\n", count);
//johnfitz
loadmodel->surfaces = out;
@@ -1283,7 +1283,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
out->flags = 0;
if (out->numedges < 3)
Con_Warning("surfnum %d: bad numedges %d\n", surfnum, out->numedges);
console::warn("surfnum %d: bad numedges %d\n", surfnum, out->numedges);
if (side)
out->flags |= SURF_PLANEBACK;
@@ -1318,7 +1318,7 @@ static void Mod_LoadFaces (lump_t *l, bool bsp2)
out->flags |= SURF_DRAWTILED;
else if (out->samples && !loadmodel->haslitwater)
{
Con_DPrintf ("Map has lit water\n");
console::debug ("Map has lit water\n");
loadmodel->haslitwater = true;
}
@@ -1393,7 +1393,7 @@ static void Mod_LoadNodes_S (lump_t *l)
//johnfitz -- warn mappers about exceeding old limits
if (count > 32767)
Con_DWarning ("%i nodes exceeds standard limit of 32767.\n", count);
console::dev_warn ("%i nodes exceeds standard limit of 32767.\n", count);
//johnfitz
loadmodel->nodes = out;
@@ -1426,7 +1426,7 @@ static void Mod_LoadNodes_S (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else
{
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
}
}
@@ -1478,7 +1478,7 @@ static void Mod_LoadNodes_L1 (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else
{
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
}
}
@@ -1530,7 +1530,7 @@ static void Mod_LoadNodes_L2 (lump_t *l)
out->children[j] = (mnode_t *)(loadmodel->leafs + p);
else
{
Con_Printf("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
console::info("Mod_LoadNodes: invalid leaf index %i (file has only %i leafs)\n", p, loadmodel->numleafs);
out->children[j] = (mnode_t *)(loadmodel->leafs); //map it to the solid leaf
}
}
@@ -1736,7 +1736,7 @@ static void Mod_LoadClipnodes (lump_t *l, bool bsp2)
//johnfitz -- warn about exceeding old limits
if (count > 32767 && !bsp2)
Con_DWarning ("%i clipnodes exceeds standard limit of 32767.\n", count);
console::dev_warn ("%i clipnodes exceeds standard limit of 32767.\n", count);
//johnfitz
loadmodel->clipnodes = out;
@@ -1890,7 +1890,7 @@ static void Mod_LoadMarksurfaces (lump_t *l, int bsp2)
//johnfitz -- warn mappers about exceeding old limits
if (count > 32767)
Con_DWarning ("%i marksurfaces exceeds standard limit of 32767.\n", count);
console::dev_warn ("%i marksurfaces exceeds standard limit of 32767.\n", count);
//johnfitz
for (i=0 ; i<count ; i++)
@@ -2022,7 +2022,7 @@ static void Mod_LoadSubmodels (lump_t *l)
out = loadmodel->submodels;
if (out->visleafs > 8192)
Con_DWarning ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs);
console::dev_warn ("%i visleafs exceeds standard limit of 8192.\n", out->visleafs);
//johnfitz
}
@@ -2102,23 +2102,23 @@ static FILE *Mod_FindVisibilityExternal(void)
q_snprintf(visfilename, sizeof(visfilename), "maps/%s.vis", loadname);
if (COM_FOpenFile(visfilename, &f, &path_id) < 0)
{
Con_DPrintf("%s not found, trying ", visfilename);
console::debug("%s not found, trying ", visfilename);
q_snprintf(visfilename, sizeof(visfilename), "%s.vis", COM_SkipPath(com_gamedir));
Con_DPrintf("%s\n", visfilename);
console::debug("%s\n", visfilename);
if (COM_FOpenFile(visfilename, &f, &path_id) < 0)
{
Con_DPrintf("external vis not found\n");
console::debug("external vis not found\n");
return NULL;
}
}
if (path_id < loadmodel->path_id)
{
fclose(f);
Con_DPrintf("ignored %s from a gamedir with lower priority\n", visfilename);
console::debug("ignored %s from a gamedir with lower priority\n", visfilename);
return NULL;
}
Con_DPrintf("Found external VIS %s\n", visfilename);
console::debug("Found external VIS %s\n", visfilename);
shortname = COM_SkipPath(loadmodel->name);
pos = 0;
@@ -2136,7 +2136,7 @@ static FILE *Mod_FindVisibilityExternal(void)
}
if (r != VISPATCH_HEADER_LEN) {
fclose(f);
Con_DPrintf("%s not found in %s\n", shortname, visfilename);
console::debug("%s not found in %s\n", shortname, visfilename);
return NULL;
}
@@ -2152,7 +2152,7 @@ static byte *Mod_LoadVisibilityExternal(FILE* f)
if (!fread(&filelen, 4, 1, f)) return NULL;
filelen = LittleLong(filelen);
if (filelen <= 0) return NULL;
Con_DPrintf("...%d bytes visibility data\n", filelen);
console::debug("...%d bytes visibility data\n", filelen);
visdata = (byte *) Hunk_AllocName(filelen, "EXT_VIS");
if (!fread(visdata, filelen, 1, f))
return NULL;
@@ -2168,7 +2168,7 @@ static void Mod_LoadLeafsExternal(FILE* f)
if (!fread(&filelen, 4, 1, f)) return;
filelen = LittleLong(filelen);
if (filelen <= 0) return;
Con_DPrintf("...%d bytes leaf data\n", filelen);
console::debug("...%d bytes leaf data\n", filelen);
in = Hunk_AllocName(filelen, "EXT_LEAF");
if (!fread(in, filelen, 1, f))
return;
@@ -2234,13 +2234,13 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
if (mod->bspversion == BSPVERSION && external_vis.value && sv.modelname[0] && !q_strcasecmp(loadname, sv.name))
{
FILE* fvis;
Con_DPrintf("trying to open external vis file\n");
console::debug("trying to open external vis file\n");
fvis = Mod_FindVisibilityExternal();
if (fvis) {
int mark = Hunk_LowMark();
loadmodel->leafs = NULL;
loadmodel->numleafs = 0;
Con_DPrintf("found valid external .vis file for map\n");
console::debug("found valid external .vis file for map\n");
loadmodel->visdata = Mod_LoadVisibilityExternal(fvis);
if (loadmodel->visdata) {
Mod_LoadLeafsExternal(fvis);
@@ -2250,7 +2250,7 @@ static void Mod_LoadBrushModel (qmodel_t *mod, void *buffer)
goto visdone;
}
Hunk_FreeToLowMark(mark);
Con_DPrintf("External VIS data failed, using standard vis.\n");
console::debug("External VIS data failed, using standard vis.\n");
}
}
@@ -2781,7 +2781,7 @@ static void Mod_LoadAliasModel (qmodel_t *mod, void *buffer)
pheader->skinheight = LittleLong (pinmodel->skinheight);
if (pheader->skinheight > MAX_LBM_HEIGHT)
Con_DWarning ("model %s has a skin taller than %d", mod->name,
console::dev_warn ("model %s has a skin taller than %d", mod->name,
MAX_LBM_HEIGHT);
pheader->numverts = LittleLong (pinmodel->numverts);
@@ -3084,11 +3084,11 @@ static void Mod_Print (void)
int i;
qmodel_t *mod;
Con_SafePrintf ("Cached models:\n"); //johnfitz -- safeprint instead of print
console::safe_print ("Cached models:\n"); //johnfitz -- safeprint instead of print
for (i=0, mod=mod_known ; i < mod_numknown ; i++, mod++)
{
Con_SafePrintf ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print
console::safe_print ("%8p : %s\n", mod->cache.data, mod->name); //johnfitz -- safeprint instead of print
}
Con_Printf ("%i models\n",mod_numknown); //johnfitz -- print the total too
console::info ("%i models\n",mod_numknown); //johnfitz -- print the total too
}
+1 -1
View File
@@ -152,7 +152,7 @@ void R_CheckEfrags (void)
return; //don't spam when still parsing signon packet full of static ents
if (cl.num_efrags > 640 && dev_peakstats.efrags <= 640)
Con_DWarning ("%i efrags exceeds standard limit of 640.\n", cl.num_efrags);
console::dev_warn ("%i efrags exceeds standard limit of 640.\n", cl.num_efrags);
dev_stats.efrags = cl.num_efrags;
dev_peakstats.efrags = std::max(cl.num_efrags, dev_peakstats.efrags);
+3 -3
View File
@@ -1044,7 +1044,7 @@ void R_RenderView(void) {
//johnfitz -- modified r_speeds output
time2 = Sys_DoubleTime();
if (r_pos.value)
Con_Printf("x %i y %i z %i (pitch %i yaw %i roll %i)\n",
console::info("x %i y %i z %i (pitch %i yaw %i roll %i)\n",
(int) cl_entities[cl.viewentity].origin[0],
(int) cl_entities[cl.viewentity].origin[1],
(int) cl_entities[cl.viewentity].origin[2],
@@ -1052,7 +1052,7 @@ void R_RenderView(void) {
(int) cl.viewangles[YAW],
(int) cl.viewangles[ROLL]);
else if (r_speeds.value == 2)
Con_Printf("%3i ms %4i/%4i wpoly %4i/%4i epoly %3i lmap %4i/%4i sky %1.1f mtex\n",
console::info("%3i ms %4i/%4i wpoly %4i/%4i epoly %3i lmap %4i/%4i sky %1.1f mtex\n",
(int) ((time2 - time1) * 1000),
rs_brushpolys,
rs_brushpasses,
@@ -1063,7 +1063,7 @@ void R_RenderView(void) {
rs_skypasses,
TexMgr_FrameUsage());
else if (r_speeds.value)
Con_Printf("%3i ms %4i wpoly %4i epoly %3i lmap\n",
console::info("%3i ms %4i wpoly %4i epoly %3i lmap\n",
(int) ((time2 - time1) * 1000),
rs_brushpolys,
rs_aliaspolys,
+6 -6
View File
@@ -273,7 +273,7 @@ void R_TranslateNewPlayerSkin(int playernum) {
//TODO: move these tests to the place where skinnum gets received from the server
if (skinnum < 0 || skinnum >= paliashdr->numskins) {
Con_DPrintf("(%d): Invalid player skin #%d\n", playernum, skinnum);
console::debug("(%d): Invalid player skin #%d\n", playernum, skinnum);
skinnum = 0;
}
@@ -414,7 +414,7 @@ void R_TimeRefresh_f(void) {
float start, stop, time;
if (cls.state != ca_connected) {
Con_Printf("Not connected to a server\n");
console::info("Not connected to a server\n");
return;
}
@@ -429,7 +429,7 @@ void R_TimeRefresh_f(void) {
glFinish();
stop = Sys_DoubleTime();
time = stop - start;
Con_Printf("%f seconds (%f fps)\n", time, 128 / time);
console::info("%f seconds (%f fps)\n", time, 128 / time);
}
void D_FlushCaches(void) {
@@ -448,7 +448,7 @@ static bool GL_CheckShader(GLuint shader) {
memset(infolog, 0, sizeof(infolog));
GL_GetShaderInfoLogFunc(shader, sizeof(infolog), NULL, infolog);
Con_Warning("GLSL program failed to compile: %s", infolog);
console::warn("GLSL program failed to compile: %s", infolog);
return false;
}
@@ -465,7 +465,7 @@ static bool GL_CheckProgram(GLuint program) {
memset(infolog, 0, sizeof(infolog));
GL_GetProgramInfoLogFunc(program, sizeof(infolog), NULL, infolog);
Con_Warning("GLSL program failed to link: %s", infolog);
console::warn("GLSL program failed to link: %s", infolog);
return false;
}
@@ -485,7 +485,7 @@ GLint GL_GetUniformLocation(GLuint *programPtr, const char *name) {
location = GL_GetUniformLocationFunc(*programPtr, name);
if (location == -1) {
Con_Warning("GL_GetUniformLocationFunc %s failed\n", name);
console::warn("GL_GetUniformLocationFunc %s failed\n", name);
*programPtr = 0;
}
return location;
+14 -14
View File
@@ -58,7 +58,7 @@ draw
CenterPrint ()
SlowPrint ()
Screen_Update ();
Con_Printf ();
console::info ();
net
turn off messages option
@@ -653,9 +653,9 @@ void SCR_SetUpToDrawConsole(void) {
return; // never a console with loading plaque
// decide on the height of the console
con_forcedup = !cl.worldmodel || cls.signon != SIGNONS;
console::forced_up = !cl.worldmodel || cls.signon != SIGNONS;
if (con_forcedup) {
if (console::forced_up) {
scr_conlines = glheight; //full screen //johnfitz -- glheight instead of vid.height
scr_con_current = scr_conlines;
} else if (key_dest == key_console)
@@ -681,7 +681,7 @@ void SCR_SetUpToDrawConsole(void) {
if (clearconsole++ < vid.numpages)
Sbar_Changed();
if (!con_forcedup && scr_con_current)
if (!console::forced_up && scr_con_current)
scr_tileclear_updates = 0; //johnfitz
}
@@ -710,9 +710,9 @@ SCREEN SHOTS
*/
static void SCR_ScreenShot_Usage(void) {
Con_Printf("usage: screenshot <format> <quality>\n");
Con_Printf(" format must be \"png\" or \"tga\" or \"jpg\"\n");
Con_Printf(" quality must be 1-100\n");
console::info("usage: screenshot <format> <quality>\n");
console::info(" format must be \"png\" or \"tga\" or \"jpg\"\n");
console::info(" quality must be 1-100\n");
return;
}
@@ -761,13 +761,13 @@ void SCR_ScreenShot_f(void) {
break; // file doesn't exist
}
if (i == 10000) {
Con_Printf("SCR_ScreenShot_f: Couldn't find an unused filename\n");
console::info("SCR_ScreenShot_f: Couldn't find an unused filename\n");
return;
}
//get data
if (!(buffer = (byte *) malloc(glwidth * glheight * 3))) {
Con_Printf("SCR_ScreenShot_f: Couldn't allocate memory\n");
console::info("SCR_ScreenShot_f: Couldn't allocate memory\n");
return;
}
@@ -785,9 +785,9 @@ void SCR_ScreenShot_f(void) {
ok = false;
if (ok)
Con_Printf("Wrote %s\n", imagename);
console::info("Wrote %s\n", imagename);
else
Con_Printf("SCR_ScreenShot_f: Couldn't create %s\n", imagename);
console::info("SCR_ScreenShot_f: Couldn't create %s\n", imagename);
free(buffer);
}
@@ -988,12 +988,12 @@ void SCR_UpdateScreen(void) {
if (scr_disabled_for_loading) {
if (realtime - scr_disabled_time > 60) {
scr_disabled_for_loading = false;
Con_Printf("load failed.\n");
console::info("load failed.\n");
} else
return;
}
if (!scr_initialized || !con_initialized)
if (!scr_initialized || !console::initialized)
return; // not initialized yet
@@ -1019,7 +1019,7 @@ void SCR_UpdateScreen(void) {
if (scr_drawdialog) //new game confirm
{
if (con_forcedup)
if (console::forced_up)
Draw_ConsoleBackground();
else
Sbar_Draw();
+5 -5
View File
@@ -102,7 +102,7 @@ void Sky_LoadTexture (qmodel_t *mod, texture_t *mt)
if (mt->width != 256 || mt->height != 128)
{
Con_Warning ("Sky texture %s is %d x %d, expected 256 x 128\n", mt->name, mt->width, mt->height);
console::warn ("Sky texture %s is %d x %d, expected 256 x 128\n", mt->name, mt->width, mt->height);
if (mt->width < 2 || mt->height < 1)
return;
}
@@ -165,7 +165,7 @@ void Sky_LoadTextureQ64 (qmodel_t *mod, texture_t *mt)
if (mt->width != 32 || mt->height != 64)
{
Con_DWarning ("Q64 sky texture %s is %d x %d, expected 32 x 64\n", mt->name, mt->width, mt->height);
console::dev_warn ("Q64 sky texture %s is %d x %d, expected 32 x 64\n", mt->name, mt->width, mt->height);
if (mt->width < 1 || mt->height < 2)
return;
}
@@ -254,7 +254,7 @@ void Sky_LoadSkyBox (const char *name)
}
else
{
Con_Printf ("Couldn't load %s\n", filename);
console::info ("Couldn't load %s\n", filename);
skybox_textures[i] = notexture;
}
Hunk_FreeToLowMark (mark);
@@ -367,13 +367,13 @@ void Sky_SkyCommand_f (void)
switch (command::argc())
{
case 1:
Con_Printf("\"sky\" is \"%s\"\n", skybox_name);
console::info("\"sky\" is \"%s\"\n", skybox_name);
break;
case 2:
Sky_LoadSkyBox(command::argv(1)->c_str());
break;
default:
Con_Printf("usage: sky <skyname>\n");
console::info("usage: sky <skyname>\n");
}
}
+10 -10
View File
@@ -81,8 +81,8 @@ TexMgr_DescribeTextureModes_f -- report available texturemodes
static void TexMgr_DescribeTextureModes_f(void) {
int i;
for (i = 0; i < NUM_GLMODES; i++)
Con_SafePrintf(" %2i: %s\n", i + 1, glmodes[i].name);
Con_Printf("%i modes\n", i);
console::safe_print(" %2i: %s\n", i + 1, glmodes[i].name);
console::info("%i modes\n", i);
}
/*
@@ -144,7 +144,7 @@ static void TexMgr_TextureMode_f(convar *var) {
return;
}
Con_Printf("\"%s\" is not a valid texturemode\n", gl_texturemode.string);
console::info("\"%s\" is not a valid texturemode\n", gl_texturemode.string);
gl_texturemode.set(glmodes[glmode_idx].name);
}
@@ -183,7 +183,7 @@ static void TexMgr_Imagelist_f(void) {
gltexture_t *glt;
for (glt = active_gltextures; glt; glt = glt->next) {
Con_SafePrintf(" %4i x%4i %s\n", glt->width, glt->height, glt->name);
console::safe_print(" %4i x%4i %s\n", glt->width, glt->height, glt->name);
if (glt->flags & TEXPREF_MIPMAP)
texels += glt->width * glt->height * 4.0f / 3.0f;
else
@@ -191,7 +191,7 @@ static void TexMgr_Imagelist_f(void) {
}
mb = texels * (convar::variable_value("vid_bpp").value_or(0.0) / 8.0f) / 0x100000;
Con_Printf("%i textures %i pixels %1.1f megabytes\n", numgltextures, (int) texels, mb);
console::info("%i textures %i pixels %1.1f megabytes\n", numgltextures, (int) texels, mb);
}
/*
@@ -232,7 +232,7 @@ static void TexMgr_Imagedump_f(void) {
free(buffer);
}
Con_Printf("dumped %i textures to %s\n", numgltextures, dirname);
console::info("dumped %i textures to %s\n", numgltextures, dirname);
}
/*
@@ -322,7 +322,7 @@ void TexMgr_FreeTexture(gltexture_t *kill) {
return;
if (kill == NULL) {
Con_Printf("TexMgr_FreeTexture: NULL texture\n");
console::info("TexMgr_FreeTexture: NULL texture\n");
return;
}
@@ -348,7 +348,7 @@ void TexMgr_FreeTexture(gltexture_t *kill) {
}
}
Con_Printf("TexMgr_FreeTexture: not found\n");
console::info("TexMgr_FreeTexture: not found\n");
}
/*
@@ -1263,7 +1263,7 @@ void TexMgr_ReloadImage(gltexture_t *glt, int shirt, int pants) {
}
if (!data) {
invalid:
Con_Printf("TexMgr_ReloadImage: invalid source for %s\n", glt->name);
console::info("TexMgr_ReloadImage: invalid source for %s\n", glt->name);
Hunk_FreeToLowMark(mark);
return;
}
@@ -1280,7 +1280,7 @@ void TexMgr_ReloadImage(gltexture_t *glt, int shirt, int pants) {
glt->shirt = shirt;
glt->pants = pants;
} else
Con_Printf("TexMgr_ReloadImage: can't colormap a non SRC_INDEXED texture: %s\n", glt->name);
console::info("TexMgr_ReloadImage: can't colormap a non SRC_INDEXED texture: %s\n", glt->name);
}
if (glt->shirt > -1 && glt->pants > -1) {
//create new translation table
+78 -78
View File
@@ -207,18 +207,18 @@ static void VID_Gamma_SetGamma(void) {
#if defined(USE_SDL2)
# if USE_GAMMA_RAMPS
if (SDL_SetWindowGammaRamp(draw_context, vid_gamma_red, vid_gamma_green, vid_gamma_blue) != 0)
Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetWindowGammaRamp\n");
console::info("VID_Gamma_SetGamma: failed on SDL_SetWindowGammaRamp\n");
# else
if (SDL_SetWindowBrightness(draw_context, value) != 0)
Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetWindowBrightness\n");
console::info("VID_Gamma_SetGamma: failed on SDL_SetWindowBrightness\n");
# endif
#else /* USE_SDL2 */
# if USE_GAMMA_RAMPS
if (SDL_SetGammaRamp(vid_gamma_red, vid_gamma_green, vid_gamma_blue) == -1)
Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetGammaRamp\n");
console::info("VID_Gamma_SetGamma: failed on SDL_SetGammaRamp\n");
# else
if (SDL_SetGamma(value, value, value) == -1)
Con_Printf("VID_Gamma_SetGamma: failed on SDL_SetGamma\n");
console::info("VID_Gamma_SetGamma: failed on SDL_SetGamma\n");
# endif
#endif /* USE_SDL2 */
}
@@ -237,18 +237,18 @@ static void VID_Gamma_Restore(void) {
#if defined(USE_SDL2)
# if USE_GAMMA_RAMPS
if (SDL_SetWindowGammaRamp(draw_context, vid_sysgamma_red, vid_sysgamma_green, vid_sysgamma_blue) != 0)
Con_Printf("VID_Gamma_Restore: failed on SDL_SetWindowGammaRamp\n");
console::info("VID_Gamma_Restore: failed on SDL_SetWindowGammaRamp\n");
# else
if (SDL_SetWindowBrightness(draw_context, 1) != 0)
Con_Printf("VID_Gamma_Restore: failed on SDL_SetWindowBrightness\n");
console::info("VID_Gamma_Restore: failed on SDL_SetWindowBrightness\n");
# endif
#else /* USE_SDL2 */
# if USE_GAMMA_RAMPS
if (SDL_SetGammaRamp(vid_sysgamma_red, vid_sysgamma_green, vid_sysgamma_blue) == -1)
Con_Printf("VID_Gamma_Restore: failed on SDL_SetGammaRamp\n");
console::info("VID_Gamma_Restore: failed on SDL_SetGammaRamp\n");
# else
if (SDL_SetGamma(1, 1, 1) == -1)
Con_Printf("VID_Gamma_Restore: failed on SDL_SetGamma\n");
console::info("VID_Gamma_Restore: failed on SDL_SetGamma\n");
# endif
#endif /* USE_SDL2 */
}
@@ -319,7 +319,7 @@ static void VID_Gamma_Init(void) {
#endif /* USE_SDL2 */
if (!gammaworks)
Con_SafePrintf("gamma adjustment not available\n");
console::safe_print("gamma adjustment not available\n");
}
/*
@@ -565,7 +565,7 @@ static bool VID_SetMode(int width, int height, int refreshrate, int bpp, bool fu
int previous_display;
#endif
// so Con_Printfs don't mess us up by forcing vid and snd updates
// so console::infos don't mess us up by forcing vid and snd updates
temp = scr_disabled_for_loading;
scr_disabled_for_loading = true;
@@ -728,7 +728,7 @@ static bool VID_SetMode(int width, int height, int refreshrate, int bpp, bool fu
// fix the leftover Alt from any Alt-Tab or the like that switched us away
ClearAllStates();
Con_SafePrintf("Video mode %dx%dx%d %dHz (%d-bit z-buffer, %dx FSAA) initialized\n",
console::safe_print("Video mode %dx%dx%d %dHz (%d-bit z-buffer, %dx FSAA) initialized\n",
VID_GetCurrentWidth(),
VID_GetCurrentHeight(),
VID_GetCurrentBPP(),
@@ -775,7 +775,7 @@ static void VID_Restart(void) {
// validate new mode
//
if (!VID_ValidMode(width, height, refreshrate, bpp, fullscreen)) {
Con_Printf("%dx%dx%d %dHz %s is not a valid mode\n",
console::info("%dx%dx%d %dHz %s is not a valid mode\n",
width, height, bpp, refreshrate, fullscreen ? "fullscreen" : "windowed");
return;
}
@@ -933,10 +933,10 @@ GL_Info_f -- johnfitz
===============
*/
static void GL_Info_f(void) {
Con_SafePrintf("GL_VENDOR: %s\n", gl_vendor);
Con_SafePrintf("GL_RENDERER: %s\n", gl_renderer);
Con_SafePrintf("GL_VERSION: %s\n", gl_version);
Con_Printf("GL_EXTENSIONS: %s\n", gl_extensions_nice);
console::safe_print("GL_VENDOR: %s\n", gl_vendor);
console::safe_print("GL_RENDERER: %s\n", gl_renderer);
console::safe_print("GL_VERSION: %s\n", gl_version);
console::info("GL_EXTENSIONS: %s\n", gl_extensions_nice);
}
/*
@@ -973,9 +973,9 @@ static void GL_CheckExtensions(void) {
// ARB_vertex_buffer_object
//
if (common::check_param("-novbo").has_value())
Con_Warning("Vertex buffer objects disabled at command line\n");
console::warn("Vertex buffer objects disabled at command line\n");
else if (gl_version_major < 1 || (gl_version_major == 1 && gl_version_minor < 5))
Con_Warning("OpenGL version < 1.5, skipping ARB_vertex_buffer_object check\n");
console::warn("OpenGL version < 1.5, skipping ARB_vertex_buffer_object check\n");
else {
GL_BindBufferFunc = (PFNGLBINDBUFFERARBPROC) SDL_GL_GetProcAddress("glBindBufferARB");
GL_BufferDataFunc = (PFNGLBUFFERDATAARBPROC) SDL_GL_GetProcAddress("glBufferDataARB");
@@ -984,70 +984,70 @@ static void GL_CheckExtensions(void) {
GL_GenBuffersFunc = (PFNGLGENBUFFERSARBPROC) SDL_GL_GetProcAddress("glGenBuffersARB");
if (GL_BindBufferFunc && GL_BufferDataFunc && GL_BufferSubDataFunc && GL_DeleteBuffersFunc &&
GL_GenBuffersFunc) {
Con_Printf("FOUND: ARB_vertex_buffer_object\n");
console::info("FOUND: ARB_vertex_buffer_object\n");
gl_vbo_able = true;
} else {
Con_Warning("ARB_vertex_buffer_object not available\n");
console::warn("ARB_vertex_buffer_object not available\n");
}
}
// multitexture
//
if (common::check_param("-nomtex").has_value())
Con_Warning("Mutitexture disabled at command line\n");
console::warn("Mutitexture disabled at command line\n");
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_multitexture")) {
GL_MTexCoord2fFunc = (PFNGLMULTITEXCOORD2FARBPROC) SDL_GL_GetProcAddress("glMultiTexCoord2fARB");
GL_SelectTextureFunc = (PFNGLACTIVETEXTUREARBPROC) SDL_GL_GetProcAddress("glActiveTextureARB");
GL_ClientActiveTextureFunc = (PFNGLCLIENTACTIVETEXTUREARBPROC)
SDL_GL_GetProcAddress("glClientActiveTextureARB");
if (GL_MTexCoord2fFunc && GL_SelectTextureFunc && GL_ClientActiveTextureFunc) {
Con_Printf("FOUND: ARB_multitexture\n");
console::info("FOUND: ARB_multitexture\n");
gl_mtexable = true;
glGetIntegerv(GL_MAX_TEXTURE_UNITS, &gl_max_texture_units);
Con_Printf("GL_MAX_TEXTURE_UNITS: %d\n", (int) gl_max_texture_units);
console::info("GL_MAX_TEXTURE_UNITS: %d\n", (int) gl_max_texture_units);
} else {
Con_Warning("Couldn't link to multitexture functions\n");
console::warn("Couldn't link to multitexture functions\n");
}
} else {
Con_Warning("multitexture not supported (extension not found)\n");
console::warn("multitexture not supported (extension not found)\n");
}
// texture_env_combine
//
if (common::check_param("-nocombine").has_value())
Con_Warning("texture_env_combine disabled at command line\n");
console::warn("texture_env_combine disabled at command line\n");
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_env_combine")) {
Con_Printf("FOUND: ARB_texture_env_combine\n");
console::info("FOUND: ARB_texture_env_combine\n");
gl_texture_env_combine = true;
} else if (GL_ParseExtensionList(gl_extensions, "GL_EXT_texture_env_combine")) {
Con_Printf("FOUND: EXT_texture_env_combine\n");
console::info("FOUND: EXT_texture_env_combine\n");
gl_texture_env_combine = true;
} else {
Con_Warning("texture_env_combine not supported\n");
console::warn("texture_env_combine not supported\n");
}
// texture_env_add
//
if (common::check_param("-noadd").has_value())
Con_Warning("texture_env_add disabled at command line\n");
console::warn("texture_env_add disabled at command line\n");
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_env_add")) {
Con_Printf("FOUND: ARB_texture_env_add\n");
console::info("FOUND: ARB_texture_env_add\n");
gl_texture_env_add = true;
} else if (GL_ParseExtensionList(gl_extensions, "GL_EXT_texture_env_add")) {
Con_Printf("FOUND: EXT_texture_env_add\n");
console::info("FOUND: EXT_texture_env_add\n");
gl_texture_env_add = true;
} else {
Con_Warning("texture_env_add not supported\n");
console::warn("texture_env_add not supported\n");
}
// swap control
//
if (!gl_swap_control) {
#if defined(USE_SDL2)
Con_Warning("vertical sync not supported (SDL_GL_SetSwapInterval failed)\n");
console::warn("vertical sync not supported (SDL_GL_SetSwapInterval failed)\n");
#else
Con_Warning("vertical sync not supported (SDL_GL_SetAttribute failed)\n");
console::warn("vertical sync not supported (SDL_GL_SetAttribute failed)\n");
#endif
}
#if defined(USE_SDL2)
@@ -1058,18 +1058,18 @@ static void GL_CheckExtensions(void) {
{
gl_swap_control = false;
#if defined(USE_SDL2)
Con_Warning("vertical sync not supported (SDL_GL_GetSwapInterval failed)\n");
console::warn("vertical sync not supported (SDL_GL_GetSwapInterval failed)\n");
#else
Con_Warning("vertical sync not supported (SDL_GL_GetAttribute failed)\n");
console::warn("vertical sync not supported (SDL_GL_GetAttribute failed)\n");
#endif
} else if ((vid_vsync.value && swap_control != 1) || (!vid_vsync.value && swap_control != 0)) {
gl_swap_control = false;
Con_Warning("vertical sync not supported (swap_control doesn't match vid_vsync)\n");
console::warn("vertical sync not supported (swap_control doesn't match vid_vsync)\n");
} else {
#if defined(USE_SDL2)
Con_Printf("FOUND: SDL_GL_SetSwapInterval\n");
console::info("FOUND: SDL_GL_SetSwapInterval\n");
#else
Con_Printf("FOUND: SDL_GL_SWAP_CONTROL\n");
console::info("FOUND: SDL_GL_SWAP_CONTROL\n");
#endif
}
@@ -1090,10 +1090,10 @@ static void GL_CheckExtensions(void) {
glDeleteTextures(1, &tex);
if (test1 == 1 && test2 == 2) {
Con_Printf("FOUND: EXT_texture_filter_anisotropic\n");
console::info("FOUND: EXT_texture_filter_anisotropic\n");
gl_anisotropy_able = true;
} else {
Con_Warning("anisotropic filtering locked by driver. Current driver setting is %f\n", test1);
console::warn("anisotropic filtering locked by driver. Current driver setting is %f\n", test1);
}
//get max value either way, so the menu and stuff know it
@@ -1101,28 +1101,28 @@ static void GL_CheckExtensions(void) {
if (gl_max_anisotropy < 2) {
gl_anisotropy_able = false;
gl_max_anisotropy = 1;
Con_Warning("anisotropic filtering broken: disabled\n");
console::warn("anisotropic filtering broken: disabled\n");
}
} else {
gl_max_anisotropy = 1;
Con_Warning("texture_filter_anisotropic not supported\n");
console::warn("texture_filter_anisotropic not supported\n");
}
// texture_non_power_of_two
//
if (common::check_param("-notexturenpot").has_value())
Con_Warning("texture_non_power_of_two disabled at command line\n");
console::warn("texture_non_power_of_two disabled at command line\n");
else if (GL_ParseExtensionList(gl_extensions, "GL_ARB_texture_non_power_of_two")) {
Con_Printf("FOUND: ARB_texture_non_power_of_two\n");
console::info("FOUND: ARB_texture_non_power_of_two\n");
gl_texture_NPOT = true;
} else {
Con_Warning("texture_non_power_of_two not supported\n");
console::warn("texture_non_power_of_two not supported\n");
}
// GLSL
//
if (common::check_param("-noglsl").has_value())
Con_Warning("GLSL disabled at command line\n");
console::warn("GLSL disabled at command line\n");
else if (gl_version_major >= 2) {
GL_CreateShaderFunc = (QS_PFNGLCREATESHADERPROC) SDL_GL_GetProcAddress("glCreateShader");
GL_DeleteShaderFunc = (QS_PFNGLDELETESHADERPROC) SDL_GL_GetProcAddress("glDeleteShader");
@@ -1173,70 +1173,70 @@ static void GL_CheckExtensions(void) {
GL_Uniform1fFunc &&
GL_Uniform3fFunc &&
GL_Uniform4fFunc) {
Con_Printf("FOUND: GLSL\n");
console::info("FOUND: GLSL\n");
gl_glsl_able = true;
} else {
Con_Warning("GLSL not available\n");
console::warn("GLSL not available\n");
}
} else {
Con_Warning("OpenGL version < 2, GLSL not available\n");
console::warn("OpenGL version < 2, GLSL not available\n");
}
// GLSL gamma
//
if (common::check_param("-noglslgamma").has_value())
Con_Warning("GLSL gamma disabled at command line\n");
console::warn("GLSL gamma disabled at command line\n");
else if (gl_glsl_able) {
gl_glsl_gamma_able = true;
Con_Printf("Enabled: GLSL gamma\n");
console::info("Enabled: GLSL gamma\n");
} else {
Con_Warning("GLSL gamma not available, using hardware gamma\n");
console::warn("GLSL gamma not available, using hardware gamma\n");
}
// GLSL alias model rendering
//
if (common::check_param("-noglslalias").has_value())
Con_Warning("GLSL alias model rendering disabled at command line\n");
console::warn("GLSL alias model rendering disabled at command line\n");
else if (gl_glsl_able && gl_vbo_able && gl_max_texture_units >= 3) {
gl_glsl_alias_able = true;
Con_Printf("Enabled: GLSL alias model rendering\n");
console::info("Enabled: GLSL alias model rendering\n");
} else {
Con_Warning("GLSL alias model rendering not available, using Fitz renderer\n");
console::warn("GLSL alias model rendering not available, using Fitz renderer\n");
}
// packed_pixels
//
if (common::check_param("-nopackedpixels").has_value())
Con_Warning("EXT_packed_pixels disabled at command line\n");
console::warn("EXT_packed_pixels disabled at command line\n");
else if (gl_glsl_alias_able) {
gl_packed_pixels = true;
Con_Printf("Enabled: EXT_packed_pixels\n");
console::info("Enabled: EXT_packed_pixels\n");
}
#if 0 /* Disabling for non-GLSL path, needs more surgery. */
else if (GL_ParseExtensionList(gl_extensions, "GL_APPLE_packed_pixels")) {
Con_Printf("FOUND: APPLE_packed_pixels\n");
console::info("FOUND: APPLE_packed_pixels\n");
gl_packed_pixels = true;
} else if (GL_ParseExtensionList(gl_extensions, "GL_EXT_packed_pixels")) {
Con_Printf("FOUND: EXT_packed_pixels\n");
console::info("FOUND: EXT_packed_pixels\n");
gl_packed_pixels = true;
} else {
Con_Warning("packed_pixels not supported\n");
console::warn("packed_pixels not supported\n");
}
#endif
// glGenerateMipmap for warp textures
if (common::check_param("-nowarpmipmaps").has_value())
Con_Warning("glGenerateMipmap disabled at command line\n");
console::warn("glGenerateMipmap disabled at command line\n");
else {
if (gl_version_major >= 3 || GL_ParseExtensionList(gl_extensions, "GL_ARB_framebuffer_object")) {
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmap");
if (GL_GenerateMipmap != NULL)
Con_Printf("FOUND: glGenerateMipmap\n");
console::info("FOUND: glGenerateMipmap\n");
} else if (GL_ParseExtensionList(gl_extensions, "GL_EXT_framebuffer_object")) {
GL_GenerateMipmap = (QS_PFNGENERATEMIPMAP) SDL_GL_GetProcAddress("glGenerateMipmapEXT");
if (GL_GenerateMipmap != NULL)
Con_Printf("FOUND: glGenerateMipmapEXT\n");
console::info("FOUND: glGenerateMipmapEXT\n");
}
if (GL_GenerateMipmap == NULL)
Con_Warning("glGenerateMipmap not available, liquids won't have mipmaps\n");
console::warn("glGenerateMipmap not available, liquids won't have mipmaps\n");
}
}
@@ -1278,9 +1278,9 @@ static void GL_Init(void) {
gl_version = (const char *) glGetString(GL_VERSION);
gl_extensions = (const char *) glGetString(GL_EXTENSIONS);
Con_SafePrintf("GL_VENDOR: %s\n", gl_vendor);
Con_SafePrintf("GL_RENDERER: %s\n", gl_renderer);
Con_SafePrintf("GL_VERSION: %s\n", gl_version);
console::safe_print("GL_VENDOR: %s\n", gl_vendor);
console::safe_print("GL_RENDERER: %s\n", gl_renderer);
console::safe_print("GL_VERSION: %s\n", gl_version);
if (gl_version == NULL || sscanf(gl_version, "%d.%d", &gl_version_major, &gl_version_minor) < 2) {
gl_version_major = 0;
@@ -1298,13 +1298,13 @@ static void GL_Init(void) {
// https://developer.apple.com/library/mac/technotes/tn2085/
if (host_parms->numcpus > 1 &&
kCGLNoError != CGLEnable(CGLGetCurrentContext(), kCGLCEMPEngine)) {
Con_Warning("Couldn't enable multi-threaded OpenGL");
console::warn("Couldn't enable multi-threaded OpenGL");
}
#endif
//johnfitz -- intel video workarounds from Baker
if (!strcmp(gl_vendor, "Intel")) {
Con_Printf("Intel Display Adapter detected, enabling gl_clear\n");
console::info("Intel Display Adapter detected, enabling gl_clear\n");
command::buffer::add_text("gl_clear 1");
}
//johnfitz
@@ -1387,7 +1387,7 @@ VID_DescribeCurrentMode_f
*/
static void VID_DescribeCurrentMode_f(void) {
if (draw_context)
Con_Printf("%dx%dx%d %dHz %s\n",
console::info("%dx%dx%d %dHz %s\n",
VID_GetCurrentWidth(),
VID_GetCurrentHeight(),
VID_GetCurrentBPP(),
@@ -1409,8 +1409,8 @@ static void VID_DescribeModes_f(void) {
for (i = 0; i < nummodes; i++) {
if (lastwidth != modelist[i].width || lastheight != modelist[i].height || lastbpp != modelist[i].bpp) {
if (count > 0)
Con_SafePrintf("\n");
Con_SafePrintf(" %4i x %4i x %i : %i", modelist[i].width, modelist[i].height, modelist[i].bpp,
console::safe_print("\n");
console::safe_print(" %4i x %4i x %i : %i", modelist[i].width, modelist[i].height, modelist[i].bpp,
modelist[i].refreshrate);
lastwidth = modelist[i].width;
lastheight = modelist[i].height;
@@ -1418,7 +1418,7 @@ static void VID_DescribeModes_f(void) {
count++;
}
}
Con_Printf("\n%i modes\n", count);
console::info("\n%i modes\n", count);
}
/*
@@ -1429,7 +1429,7 @@ VID_FSAA_f -- ericw -- warn that vid_fsaa requires engine restart
static void VID_FSAA_f(convar *var) {
// don't print the warning if vid_fsaa is set during startup
if (vid_initialized)
Con_Printf("%s %d requires engine restart to take effect\n", var->name.c_str(), (int) var->value);
console::info("%s %d requires engine restart to take effect\n", var->name.c_str(), (int) var->value);
}
//==========================================================================
@@ -1509,7 +1509,7 @@ static void VID_InitModelist(void) {
}
if (nummodes == originalnummodes)
Con_SafePrintf("No fullscreen DIB modes found\n");
console::safe_print("No fullscreen DIB modes found\n");
#endif /* !defined(USE_SDL2) */
}
@@ -1753,7 +1753,7 @@ void VID_Toggle(void) {
}
} else {
vid_toggle_works = false;
Con_DPrintf("SDL_WM_ToggleFullScreen failed, attempting VID_Restart\n");
console::debug("SDL_WM_ToggleFullScreen failed, attempting VID_Restart\n");
vrestart:
vid_fullscreen.set(VID_GetFullscreen() ? "0" : "1");
command::buffer::add_text("vid_restart\n");
+19 -19
View File
@@ -99,7 +99,7 @@ Max_Edicts_f -- johnfitz
static void Max_Edicts_f(convar *var) {
//TODO: clamp it here?
if (cls.state == ca_connected || sv.active)
Con_Printf("Changes to max_edicts will not take effect until the next time a map is loaded.\n");
console::info("Changes to max_edicts will not take effect until the next time a map is loaded.\n");
}
/*
@@ -109,7 +109,7 @@ Max_Fps_f -- ericw
*/
static void Max_Fps_f(convar *var) {
if (var->value > 72)
Con_Warning("host_maxfps above 72 breaks physics.\n");
console::warn("host_maxfps above 72 breaks physics.\n");
}
/*
@@ -124,7 +124,7 @@ void Host_EndGame(const char *message, ...) {
va_start(argptr, message);
q_vsnprintf(string, sizeof(string), message, argptr);
va_end(argptr);
Con_DPrintf("Host_EndGame: %s\n", string);
console::debug("Host_EndGame: %s\n", string);
if (sv.active)
Host_ShutdownServer(false);
@@ -161,7 +161,7 @@ void Host_Error(const char *error, ...) {
va_start(argptr, error);
q_vsnprintf(string, sizeof(string), error, argptr);
va_end(argptr);
Con_Printf("Host_Error: %s\n", string);
console::info("Host_Error: %s\n", string);
if (sv.active)
Host_ShutdownServer(false);
@@ -222,9 +222,9 @@ void Host_FindMaxClients(void) {
}
void Host_Version_f(void) {
Con_Printf("Quake Version %1.2f\n", VERSION);
Con_Printf("QuakeSpasm Version " QUAKESPASM_VER_STRING "\n");
Con_Printf("Exe: " __TIME__ " " __DATE__ "\n");
console::info("Quake Version %1.2f\n", VERSION);
console::info("QuakeSpasm Version " QUAKESPASM_VER_STRING "\n");
console::info("Exe: " __TIME__ " " __DATE__ "\n");
}
/* cvar callback functions : */
@@ -298,7 +298,7 @@ void Host_WriteConfiguration(void) {
if (host_initialized && !isDedicated && !host_parms->errstate) {
f = fopen(va("%s/config.cfg", com_gamedir), "w");
if (!f) {
Con_Printf("Couldn't write config.cfg.\n");
console::info("Couldn't write config.cfg.\n");
return;
}
@@ -487,7 +487,7 @@ void Host_ShutdownServer(bool crash) {
MSG_WriteByte(&buf, svc_disconnect);
count = NET_SendToAll(&buf, 5.0);
if (count)
Con_Printf("Host_ShutdownServer: NET_SendToAll failed for %u clients\n", count);
console::info("Host_ShutdownServer: NET_SendToAll failed for %u clients\n", count);
for (i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++)
if (host_client->active)
@@ -510,7 +510,7 @@ not reinitialize anything.
================
*/
void Host_ClearMemory(void) {
Con_DPrintf("Clearing memory\n");
console::debug("Clearing memory\n");
D_FlushCaches();
Mod_ClearAll();
Sky_ClearAll();
@@ -617,7 +617,7 @@ void Host_ServerFrame(void) {
active++;
}
if (active > 600 && dev_peakstats.edicts <= 600)
Con_DWarning("%i edicts exceeds standard limit of 600 (max = %d).\n", active, sv.max_edicts);
console::dev_warn("%i edicts exceeds standard limit of 600 (max = %d).\n", active, sv.max_edicts);
dev_stats.edicts = active;
dev_peakstats.edicts = std::max(active, dev_peakstats.edicts);
}
@@ -720,7 +720,7 @@ void _Host_Frame(float time) {
time3 = Sys_DoubleTime();
pass2 = (time2 - time1) * 1000;
pass3 = (time3 - time2) * 1000;
Con_Printf("%3i tot %3i server %3i gfx %3i snd\n",
console::info("%3i tot %3i server %3i gfx %3i snd\n",
pass1 + pass2 + pass3, pass1, pass2, pass3);
}
@@ -757,7 +757,7 @@ void Host_Frame(float time) {
c++;
}
Con_Printf("serverprofile: %2i clients %2i msec\n", c, m);
console::info("serverprofile: %2i clients %2i msec\n", c, m);
}
/*
@@ -790,15 +790,15 @@ void Host_Init(void) {
W_LoadWadFile(); //johnfitz -- filename is now hard-coded for honesty
if (cls.state != ca_dedicated) {
Key_Init();
Con_Init();
console::init();
}
PR_Init();
Mod_Init();
NET_Init();
SV_Init();
Con_Printf("Exe: " __TIME__ " " __DATE__ "\n");
Con_Printf("%4.1f megabyte heap\n", host_parms->memsize / (1024 * 1024.0));
console::info("Exe: " __TIME__ " " __DATE__ "\n");
console::info("%4.1f megabyte heap\n", host_parms->memsize / (1024 * 1024.0));
if (cls.state != ca_dedicated) {
host_colormap = (byte *) COM_LoadHunkFile("gfx/colormap.lmp", NULL);
@@ -830,7 +830,7 @@ void Host_Init(void) {
host_hunklevel = Hunk_LowMark();
host_initialized = true;
Con_Printf("\n========= Quake Initialized =========\n\n");
console::info("\n========= Quake Initialized =========\n\n");
if (cls.state != ca_dedicated) {
command::buffer::insert_text("exec quake.rc\n");
@@ -866,7 +866,7 @@ void Host_Shutdown(void) {
}
isdown = true;
// keep Con_Printf from trying to update the screen
// keep console::info from trying to update the screen
scr_disabled_for_loading = true;
Host_WriteConfiguration();
@@ -874,7 +874,7 @@ void Host_Shutdown(void) {
NET_Shutdown();
if (cls.state != ca_dedicated) {
if (con_initialized)
if (console::initialized)
History_Shutdown();
music::shutdown();
CDAudio_Shutdown();
+50 -50
View File
@@ -187,12 +187,12 @@ static void Host_Maps_f(void) {
filelist_item_t *level;
for (level = extralevels, i = 0; level; level = level->next, i++)
Con_SafePrintf(" %s\n", level->name);
console::safe_print(" %s\n", level->name);
if (i)
Con_SafePrintf("%i map(s)\n", i);
console::safe_print("%i map(s)\n", i);
else
Con_SafePrintf("no maps found\n");
console::safe_print("no maps found\n");
}
//==============================================================================
@@ -347,12 +347,12 @@ static void Host_Mods_f(void) {
filelist_item_t *mod;
for (mod = modlist, i = 0; mod; mod = mod->next, i++)
Con_SafePrintf(" %s\n", mod->name);
console::safe_print(" %s\n", mod->name);
if (i)
Con_SafePrintf("%i mod(s)\n", i);
console::safe_print("%i mod(s)\n", i);
else
Con_SafePrintf("no mods found\n");
console::safe_print("no mods found\n");
}
//==============================================================================
@@ -364,16 +364,16 @@ Host_Mapname_f -- johnfitz
*/
static void Host_Mapname_f(void) {
if (sv.active) {
Con_Printf("\"mapname\" is \"%s\"\n", sv.name);
console::info("\"mapname\" is \"%s\"\n", sv.name);
return;
}
if (cls.state == ca_connected) {
Con_Printf("\"mapname\" is \"%s\"\n", cl.mapname);
console::info("\"mapname\" is \"%s\"\n", cl.mapname);
return;
}
Con_Printf("no map loaded\n");
console::info("no map loaded\n");
}
/*
@@ -395,7 +395,7 @@ static void Host_Status_f(void) {
command::forward_to_server();
return;
}
print_fn = Con_Printf;
print_fn = console::info;
} else
print_fn = SV_ClientPrintf;
@@ -460,7 +460,7 @@ static void Host_God_f(void) {
}
break;
default:
Con_Printf("god [value] : toggle god mode. values: 0 = off, 1 = on\n");
console::info("god [value] : toggle god mode. values: 0 = off, 1 = on\n");
break;
}
//johnfitz
@@ -515,7 +515,7 @@ static void Host_Notarget_f(void) {
}
break;
default:
Con_Printf("notarget [value] : toggle notarget mode. values: 0 = off, 1 = on\n");
console::info("notarget [value] : toggle notarget mode. values: 0 = off, 1 = on\n");
break;
}
//johnfitz
@@ -562,7 +562,7 @@ static void Host_Noclip_f(void) {
}
break;
default:
Con_Printf("noclip [value] : toggle noclip mode. values: 0 = off, 1 = on\n");
console::info("noclip [value] : toggle noclip mode. values: 0 = off, 1 = on\n");
break;
}
//johnfitz
@@ -660,7 +660,7 @@ static void Host_Fly_f(void) {
}
break;
default:
Con_Printf("fly [value] : toggle fly mode. values: 0 = off, 1 = on\n");
console::info("fly [value] : toggle fly mode. values: 0 = off, 1 = on\n");
break;
}
//johnfitz
@@ -719,13 +719,13 @@ static void Host_Map_f(void) {
{
if (cls.state == ca_dedicated) {
if (sv.active)
Con_Printf("Current map: %s\n", sv.name);
console::info("Current map: %s\n", sv.name);
else
Con_Printf("Server not active\n");
console::info("Server not active\n");
} else if (cls.state == ca_connected) {
Con_Printf("Current map: %s ( %s )\n", cl.levelname, cl.mapname);
console::info("Current map: %s ( %s )\n", cl.levelname, cl.mapname);
} else {
Con_Printf("map <levelname>: start a new server\n");
console::info("map <levelname>: start a new server\n");
}
return;
}
@@ -783,7 +783,7 @@ static void Host_Randmap_f(void) {
numlevels++;
if (numlevels == 0) {
Con_Printf("no maps\n");
console::info("no maps\n");
return;
}
@@ -791,7 +791,7 @@ static void Host_Randmap_f(void) {
for (level = extralevels, i = 0; level; level = level->next, i++) {
if (i == randlevel) {
Con_Printf("Starting map %s...\n", level->name);
console::info("Starting map %s...\n", level->name);
command::buffer::add_text(va("map %s\n", level->name));
return;
}
@@ -809,11 +809,11 @@ static void Host_Changelevel_f(void) {
char level[MAX_QPATH];
if (command::argc() != 2) {
Con_Printf("changelevel <levelname> : continue game on a new level\n");
console::info("changelevel <levelname> : continue game on a new level\n");
return;
}
if (!sv.active || cls.demoplayback) {
Con_Printf("Only the server may changelevel\n");
console::info("Only the server may changelevel\n");
return;
}
@@ -954,33 +954,33 @@ static void Host_Savegame_f(void) {
return;
if (!sv.active) {
Con_Printf("Not playing a local game.\n");
console::info("Not playing a local game.\n");
return;
}
if (cl.intermission) {
Con_Printf("Can't save in intermission.\n");
console::info("Can't save in intermission.\n");
return;
}
if (svs.maxclients != 1) {
Con_Printf("Can't save multiplayer games.\n");
console::info("Can't save multiplayer games.\n");
return;
}
if (command::argc() != 2) {
Con_Printf("save <savename> : save a game\n");
console::info("save <savename> : save a game\n");
return;
}
if (strstr(command::argv(1)->c_str(), "..")) {
Con_Printf("Relative pathnames are not allowed.\n");
console::info("Relative pathnames are not allowed.\n");
return;
}
for (i = 0; i < svs.maxclients; i++) {
if (svs.clients[i].active && (svs.clients[i].edict->v.health <= 0)) {
Con_Printf("Can't savegame with a dead player\n");
console::info("Can't savegame with a dead player\n");
return;
}
}
@@ -988,10 +988,10 @@ static void Host_Savegame_f(void) {
q_snprintf(name, sizeof(name), "%s/%s", com_gamedir, command::argv(1)->c_str());
COM_AddExtension(name, ".sav", sizeof(name));
Con_Printf("Saving game to %s...\n", name);
console::info("Saving game to %s...\n", name);
f = fopen(name, "w");
if (!f) {
Con_Printf("ERROR: couldn't open.\n");
console::info("ERROR: couldn't open.\n");
return;
}
@@ -1018,7 +1018,7 @@ static void Host_Savegame_f(void) {
fflush(f);
}
fclose(f);
Con_Printf("done.\n");
console::info("done.\n");
}
/*
@@ -1041,12 +1041,12 @@ static void Host_Loadgame_f(void) {
return;
if (command::argc() != 2) {
Con_Printf("load <savename> : load a game\n");
console::info("load <savename> : load a game\n");
return;
}
if (strstr(command::argv(1)->c_str(), "..")) {
Con_Printf("Relative pathnames are not allowed.\n");
console::info("Relative pathnames are not allowed.\n");
return;
}
@@ -1059,7 +1059,7 @@ static void Host_Loadgame_f(void) {
// been used. The menu calls it before stuffing loadgame command
// SCR_BeginLoadingPlaque ();
Con_Printf("Loading game from %s...\n", name);
console::info("Loading game from %s...\n", name);
// avoid leaking if the previous Host_Loadgame_f failed with a Host_Error
if (start != NULL)
@@ -1067,7 +1067,7 @@ static void Host_Loadgame_f(void) {
start = (char *) COM_LoadMallocFile_TextMode_OSPath(name, NULL);
if (start == NULL) {
Con_Printf("ERROR: couldn't open.\n");
console::info("ERROR: couldn't open.\n");
return;
}
@@ -1099,7 +1099,7 @@ static void Host_Loadgame_f(void) {
free(start);
start = NULL;
SCR_EndLoadingPlaque();
Con_Printf("Couldn't load map\n");
console::info("Couldn't load map\n");
return;
}
sv.paused = true; // pause until all clients connect
@@ -1177,7 +1177,7 @@ static void Host_Name_f(void) {
char newName[32];
if (command::argc() == 1) {
Con_Printf("\"name\" is \"%s\"\n", cl_name.string);
console::info("\"name\" is \"%s\"\n", cl_name.string);
return;
}
if (command::argc() == 2)
@@ -1197,7 +1197,7 @@ static void Host_Name_f(void) {
if (host_client->name[0] && strcmp(host_client->name, "unconnected")) {
if (std::strcmp(host_client->name, newName) != 0)
Con_Printf("%s renamed to %s\n", host_client->name, newName);
console::info("%s renamed to %s\n", host_client->name, newName);
}
std::strcpy(host_client->name, newName);
host_client->edict->v.netname = PR_SetEngineString(host_client->name);
@@ -1351,8 +1351,8 @@ static void Host_Color_f(void) {
int playercolor;
if (command::argc() == 1) {
Con_Printf("\"color\" is \"%i %i\"\n", ((int) cl_color.value) >> 4, ((int) cl_color.value) & 0x0f);
Con_Printf("color <0-13> [0-13]\n");
console::info("\"color\" is \"%i %i\"\n", ((int) cl_color.value) >> 4, ((int) cl_color.value) & 0x0f);
console::info("color <0-13> [0-13]\n");
return;
}
@@ -1452,12 +1452,12 @@ Host_PreSpawn_f
*/
static void Host_PreSpawn_f(void) {
if (command::last_source == command::source::command) {
Con_Printf("prespawn is not valid from the console\n");
console::info("prespawn is not valid from the console\n");
return;
}
if (host_client->spawned) {
Con_Printf("prespawn not valid -- already spawned\n");
console::info("prespawn not valid -- already spawned\n");
return;
}
@@ -1476,12 +1476,12 @@ static void Host_Spawn_f(void) {
edict_t *ent;
if (command::last_source == command::source::command) {
Con_Printf("spawn is not valid from the console\n");
console::info("spawn is not valid from the console\n");
return;
}
if (host_client->spawned) {
Con_Printf("Spawn not valid -- already spawned\n");
console::info("Spawn not valid -- already spawned\n");
return;
}
@@ -1584,7 +1584,7 @@ Host_Begin_f
*/
static void Host_Begin_f(void) {
if (command::last_source == command::source::command) {
Con_Printf("begin is not valid from the console\n");
console::info("begin is not valid from the console\n");
return;
}
@@ -1886,7 +1886,7 @@ static edict_t *FindViewthing(void) {
if (!strcmp(PR_GetString(e->v.classname), "viewthing"))
return e;
}
Con_Printf("No viewthing on map\n");
console::info("No viewthing on map\n");
return NULL;
}
@@ -1905,7 +1905,7 @@ static void Host_Viewmodel_f(void) {
m = Mod_ForName(command::argv(1).value_or("").c_str(), false);
if (!m) {
Con_Printf("Can't load %s\n", command::argv(1).value_or("").c_str());
console::info("Can't load %s\n", command::argv(1).value_or("").c_str());
return;
}
@@ -1944,7 +1944,7 @@ static void PrintFrameName(qmodel_t *m, int frame) {
return;
pframedesc = &hdr->frames[frame];
Con_Printf("frame %i: %s\n", frame, pframedesc->name);
console::info("frame %i: %s\n", frame, pframedesc->name);
}
/*
@@ -2011,10 +2011,10 @@ static void Host_Startdemos_f(void) {
c = command::argc() - 1;
if (c > MAX_DEMOS) {
Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS);
console::info("Max %i demos in demoloop\n", MAX_DEMOS);
c = MAX_DEMOS;
}
Con_Printf("%i demo(s) in loop\n", c);
console::info("%i demo(s) in loop\n", c);
for (i = 1; i < c + 1; i++)
q_strlcpy(cls.demos[i - 1], command::argv(i)->c_str(), sizeof(cls.demos[0]));
+1 -1
View File
@@ -586,7 +586,7 @@ bool Image_WritePNG(const char *name, byte *data, int width, int height, int bpp
error = lodepng_encode(&png, &pngsize, flipped, width, height, &state);
if (error == 0) lodepng_save_file(png, pngsize, pathname);
#ifdef LODEPNG_COMPILE_ERROR_TEXT
else Con_Printf("WritePNG: %s\n", lodepng_error_text(error));
else console::info("WritePNG: %s\n", lodepng_error_text(error));
#endif
lodepng_state_cleanup(&state);
+28 -28
View File
@@ -160,16 +160,16 @@ static void IN_DisableOSXMouseAccel(void) {
kIOReturnSuccess) {
if (IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), -1.0) != kIOReturnSuccess) {
convar::set("in_disablemacosxmouseaccel", "0");
Con_Printf("WARNING: Could not disable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
console::info("WARNING: Could not disable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
}
} else {
convar::set("in_disablemacosxmouseaccel", "0");
Con_Printf("WARNING: Could not disable mouse acceleration (failed at IOHIDGetAccelerationWithKey).\n");
console::info("WARNING: Could not disable mouse acceleration (failed at IOHIDGetAccelerationWithKey).\n");
}
IOServiceClose(mouseDev);
} else {
convar::set("in_disablemacosxmouseaccel", "0");
Con_Printf("WARNING: Could not disable mouse acceleration (failed at IO_GetIOHandle).\n");
console::info("WARNING: Could not disable mouse acceleration (failed at IO_GetIOHandle).\n");
}
}
@@ -178,10 +178,10 @@ static void IN_ReenableOSXMouseAccel(void) {
if (mouseDev != 0) {
if (IOHIDSetAccelerationWithKey(mouseDev, CFSTR(kIOHIDMouseAccelerationType), originalMouseSpeed) !=
kIOReturnSuccess)
Con_Printf("WARNING: Could not re-enable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
console::info("WARNING: Could not re-enable mouse acceleration (failed at IOHIDSetAccelerationWithKey).\n");
IOServiceClose(mouseDev);
} else {
Con_Printf("WARNING: Could not re-enable mouse acceleration (failed at IO_GetIOHandle).\n");
console::info("WARNING: Could not re-enable mouse acceleration (failed at IO_GetIOHandle).\n");
}
originalMouseSpeed = -1;
}
@@ -209,19 +209,19 @@ void IN_Activate(void) {
#endif
if (SDL_SetRelativeMouseMode(SDL_TRUE) != 0) {
Con_Printf("WARNING: SDL_SetRelativeMouseMode(SDL_TRUE) failed.\n");
console::info("WARNING: SDL_SetRelativeMouseMode(SDL_TRUE) failed.\n");
}
#else
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_ON) {
SDL_WM_GrabInput(SDL_GRAB_ON);
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_ON)
Con_Printf("WARNING: SDL_WM_GrabInput(SDL_GRAB_ON) failed.\n");
console::info("WARNING: SDL_WM_GrabInput(SDL_GRAB_ON) failed.\n");
}
if (SDL_ShowCursor(SDL_QUERY) != SDL_DISABLE) {
SDL_ShowCursor(SDL_DISABLE);
if (SDL_ShowCursor(SDL_QUERY) != SDL_DISABLE)
Con_Printf("WARNING: SDL_ShowCursor(SDL_DISABLE) failed.\n");
console::info("WARNING: SDL_ShowCursor(SDL_DISABLE) failed.\n");
}
#endif
@@ -247,13 +247,13 @@ void IN_Deactivate(bool free_cursor) {
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_OFF) {
SDL_WM_GrabInput(SDL_GRAB_OFF);
if (SDL_WM_GrabInput(SDL_GRAB_QUERY) != SDL_GRAB_OFF)
Con_Printf("WARNING: SDL_WM_GrabInput(SDL_GRAB_OFF) failed.\n");
console::info("WARNING: SDL_WM_GrabInput(SDL_GRAB_OFF) failed.\n");
}
if (SDL_ShowCursor(SDL_QUERY) != SDL_ENABLE) {
SDL_ShowCursor(SDL_ENABLE);
if (SDL_ShowCursor(SDL_QUERY) != SDL_ENABLE)
Con_Printf("WARNING: SDL_ShowCursor(SDL_ENABLE) failed.\n");
console::info("WARNING: SDL_ShowCursor(SDL_ENABLE) failed.\n");
}
#endif
}
@@ -273,7 +273,7 @@ void IN_StartupJoystick(void) {
return;
if (SDL_InitSubSystem(SDL_INIT_GAMECONTROLLER) == -1) {
Con_Warning("could not initialize SDL Game Controller\n");
console::warn("could not initialize SDL Game Controller\n");
return;
}
@@ -281,14 +281,14 @@ void IN_StartupJoystick(void) {
q_snprintf(controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", com_basedir);
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
if (nummappings > 0)
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
console::info("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
// Also try host_parms->userdir
if (host_parms->userdir != host_parms->basedir) {
q_snprintf(controllerdb, sizeof(controllerdb), "%s/gamecontrollerdb.txt", host_parms->userdir);
nummappings = SDL_GameControllerAddMappingsFromFile(controllerdb);
if (nummappings > 0)
Con_Printf("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
console::info("%d mappings loaded from gamecontrollerdb.txt\n", nummappings);
}
for (i = 0; i < SDL_NumJoysticks(); i++) {
@@ -297,16 +297,16 @@ void IN_StartupJoystick(void) {
const char *controllername = SDL_GameControllerNameForIndex(i);
gamecontroller = SDL_GameControllerOpen(i);
if (gamecontroller) {
Con_Printf("detected controller: %s\n", controllername != NULL ? controllername : "NULL");
console::info("detected controller: %s\n", controllername != NULL ? controllername : "NULL");
joy_active_instaceid = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(gamecontroller));
joy_active_controller = gamecontroller;
break;
} else {
Con_Warning("failed to open controller: %s\n", controllername != NULL ? controllername : "NULL");
console::warn("failed to open controller: %s\n", controllername != NULL ? controllername : "NULL");
}
} else {
Con_Warning("joystick missing controller mappings: %s\n", joyname != NULL ? joyname : "NULL");
console::warn("joystick missing controller mappings: %s\n", joyname != NULL ? joyname : "NULL");
}
}
#endif
@@ -324,7 +324,7 @@ void IN_Init(void) {
#if !defined(USE_SDL2)
SDL_EnableUNICODE(textmode);
if (SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL) == -1)
Con_Printf("Warning: SDL_EnableKeyRepeat() failed.\n");
console::info("Warning: SDL_EnableKeyRepeat() failed.\n");
#else
if (textmode)
SDL_StartTextInput();
@@ -706,16 +706,16 @@ void IN_UpdateInputMode(void) {
#if !defined(USE_SDL2)
SDL_EnableUNICODE(textmode);
if (in_debugkeys.value)
Con_Printf("SDL_EnableUNICODE %d time: %g\n", textmode, Sys_DoubleTime());
console::info("SDL_EnableUNICODE %d time: %g\n", textmode, Sys_DoubleTime());
#else
if (textmode) {
SDL_StartTextInput();
if (in_debugkeys.value)
Con_Printf("SDL_StartTextInput time: %g\n", Sys_DoubleTime());
console::info("SDL_StartTextInput time: %g\n", Sys_DoubleTime());
} else {
SDL_StopTextInput();
if (in_debugkeys.value)
Con_Printf("SDL_StopTextInput time: %g\n", Sys_DoubleTime());
console::info("SDL_StopTextInput time: %g\n", Sys_DoubleTime());
}
#endif
}
@@ -918,20 +918,20 @@ static inline int IN_SDL2_ScancodeToQuakeKey(SDL_Scancode scancode) {
#if defined(USE_SDL2)
static void IN_DebugTextEvent(SDL_Event *event) {
Con_Printf("SDL_TEXTINPUT '%s' time: %g\n", event->text.text, Sys_DoubleTime());
console::info("SDL_TEXTINPUT '%s' time: %g\n", event->text.text, Sys_DoubleTime());
}
#endif
static void IN_DebugKeyEvent(SDL_Event *event) {
const char *eventtype = (event->key.state == SDL_PRESSED) ? "SDL_KEYDOWN" : "SDL_KEYUP";
#if defined(USE_SDL2)
Con_Printf("%s scancode: '%s' keycode: '%s' time: %g\n",
console::info("%s scancode: '%s' keycode: '%s' time: %g\n",
eventtype,
SDL_GetScancodeName(event->key.keysym.scancode),
SDL_GetKeyName(event->key.keysym.sym),
Sys_DoubleTime());
#else
Con_Printf("%s sym: '%s' unicode: %04x time: %g\n",
console::info("%s sym: '%s' unicode: %04x time: %g\n",
eventtype,
SDL_GetKeyName(event->key.keysym.sym),
(int) event->key.keysym.unicode,
@@ -1013,7 +1013,7 @@ void IN_SendKeyEvents(void) {
case SDL_MOUSEBUTTONUP:
if (event.button.button < 1 ||
event.button.button > std::size(buttonremap)) {
Con_Printf("Ignored event for mouse button %d\n",
console::info("Ignored event for mouse button %d\n",
event.button.button);
break;
}
@@ -1041,14 +1041,14 @@ void IN_SendKeyEvents(void) {
if (joy_active_instaceid == -1) {
joy_active_controller = SDL_GameControllerOpen(event.cdevice.which);
if (joy_active_controller == NULL)
Con_DPrintf("Couldn't open game controller\n");
console::debug("Couldn't open game controller\n");
else {
SDL_Joystick *joy;
joy = SDL_GameControllerGetJoystick(joy_active_controller);
joy_active_instaceid = SDL_JoystickInstanceID(joy);
}
} else
Con_DPrintf("Ignoring SDL_CONTROLLERDEVICEADDED\n");
console::debug("Ignoring SDL_CONTROLLERDEVICEADDED\n");
break;
case SDL_CONTROLLERDEVICEREMOVED:
if (joy_active_instaceid != -1 && event.cdevice.which == joy_active_instaceid) {
@@ -1056,10 +1056,10 @@ void IN_SendKeyEvents(void) {
joy_active_controller = NULL;
joy_active_instaceid = -1;
} else
Con_DPrintf("Ignoring SDL_CONTROLLERDEVICEREMOVED\n");
console::debug("Ignoring SDL_CONTROLLERDEVICEREMOVED\n");
break;
case SDL_CONTROLLERDEVICEREMAPPED:
Con_DPrintf("Ignoring SDL_CONTROLLERDEVICEREMAPPED\n");
console::debug("Ignoring SDL_CONTROLLERDEVICEREMAPPED\n");
break;
#endif
+135 -237
View File
@@ -46,8 +46,7 @@ bool consolekeys[MAX_KEYS]; // if true, can't be rebound while in console
bool menubound[MAX_KEYS]; // if true, can't be rebound while in menu
bool keydown[MAX_KEYS];
typedef struct
{
typedef struct {
const char *name;
int keynum;
} keyname_t;
@@ -184,8 +183,7 @@ keyname_t keynames[] =
==============================================================================
*/
static void PasteToConsole (void)
{
static void PasteToConsole(void) {
char *cbd, *p, *workline;
int mvlen, inslen;
@@ -196,10 +194,8 @@ static void PasteToConsole (void)
return;
p = cbd;
while (*p)
{
if (*p == '\n' || *p == '\r' || *p == '\b')
{
while (*p) {
if (*p == '\n' || *p == '\r' || *p == '\b') {
*p = 0;
break;
}
@@ -214,8 +210,7 @@ static void PasteToConsole (void)
workline = key_lines[edit_line];
workline += key_linepos;
mvlen = (int) strlen(workline);
if (mvlen + inslen + key_linepos > MAXCMDLINE - 1)
{
if (mvlen + inslen + key_linepos > MAXCMDLINE - 1) {
mvlen = MAXCMDLINE - 1 - key_linepos - inslen;
if (mvlen < 0) mvlen = 0;
}
@@ -240,21 +235,19 @@ Interactive line editing and console scrollback
extern char *con_text, key_tabpartial[MAXCMDLINE];
extern int con_current, con_linewidth, con_vislines;
void Key_Console (int key)
{
void Key_Console(int key) {
static char current[MAXCMDLINE] = "";
int history_line_last;
size_t len;
char *workline = key_lines[edit_line];
switch (key)
{
switch (key) {
case K_ENTER:
case K_KP_ENTER:
key_tabpartial[0] = 0;
command::buffer::add_text(workline + 1); // skip the prompt
command::buffer::add_text("\n");
Con_Printf ("%s\n", workline);
console::info("%s\n", workline);
// If the last two lines are identical, skip storing this line in history
// by not incrementing edit_line
@@ -275,15 +268,12 @@ void Key_Console (int key)
case K_BACKSPACE:
key_tabpartial[0] = 0;
if (key_linepos > 1)
{
if (key_linepos > 1) {
workline += key_linepos - 1;
if (workline[1])
{
if (workline[1]) {
len = strlen(workline);
memmove(workline, workline + 1, len);
}
else *workline = 0;
} else *workline = 0;
key_linepos--;
}
return;
@@ -291,63 +281,56 @@ void Key_Console (int key)
case K_DEL:
key_tabpartial[0] = 0;
workline += key_linepos;
if (*workline)
{
if (workline[1])
{
if (*workline) {
if (workline[1]) {
len = strlen(workline);
memmove(workline, workline + 1, len);
}
else *workline = 0;
} else *workline = 0;
}
return;
case K_HOME:
if (keydown[K_CTRL])
{
if (keydown[K_CTRL]) {
//skip initial empty lines
int i, x;
char *line;
for (i = con_current - con_totallines + 1; i <= con_current; i++)
{
line = con_text + (i % con_totallines) * con_linewidth;
for (x = 0; x < con_linewidth; x++)
{
for (i = con_current - console::total_lines + 1; i <= con_current; i++) {
line = con_text + (i % console::total_lines) * con_linewidth;
for (x = 0; x < con_linewidth; x++) {
if (line[x] != ' ')
break;
}
if (x != con_linewidth)
break;
}
con_backscroll = std::clamp(con_current-i%con_totallines-2, 0, con_totallines-(glheight>>3)-1);
}
else key_linepos = 1;
console::back_scroll = std::clamp(con_current - i % console::total_lines - 2, 0,
console::total_lines - (glheight >> 3) - 1);
} else key_linepos = 1;
return;
case K_END:
if (keydown[K_CTRL])
con_backscroll = 0;
console::back_scroll = 0;
else key_linepos = strlen(workline);
return;
case K_PGUP:
case K_MWHEELUP:
con_backscroll += keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
if (con_backscroll > con_totallines - (vid.height>>3) - 1)
con_backscroll = con_totallines - (vid.height>>3) - 1;
console::back_scroll += keydown[K_CTRL] ? ((con_vislines >> 3) - 4) : 2;
if (console::back_scroll > console::total_lines - (vid.height >> 3) - 1)
console::back_scroll = console::total_lines - (vid.height >> 3) - 1;
return;
case K_PGDN:
case K_MWHEELDOWN:
con_backscroll -= keydown[K_CTRL] ? ((con_vislines>>3) - 4) : 2;
if (con_backscroll < 0)
con_backscroll = 0;
console::back_scroll -= keydown[K_CTRL] ? ((con_vislines >> 3) - 4) : 2;
if (console::back_scroll < 0)
console::back_scroll = 0;
return;
case K_LEFTARROW:
if (key_linepos > 1)
{
if (key_linepos > 1) {
key_linepos--;
key_blinktime = realtime;
}
@@ -355,8 +338,7 @@ void Key_Console (int key)
case K_RIGHTARROW:
len = strlen(workline);
if ((int)len == key_linepos)
{
if ((int) len == key_linepos) {
len = strlen(key_lines[(edit_line + (CMDLINES - 1)) & (CMDLINES - 1)]);
if ((int) len <= key_linepos)
return; // no character to get
@@ -364,9 +346,7 @@ void Key_Console (int key)
*workline = key_lines[(edit_line + (CMDLINES - 1)) & (CMDLINES - 1)][key_linepos];
workline[1] = 0;
key_linepos++;
}
else
{
} else {
key_linepos++;
key_blinktime = realtime;
}
@@ -377,13 +357,11 @@ void Key_Console (int key)
std::strcpy(current, workline);
history_line_last = history_line;
do
{
do {
history_line = (history_line - 1) & (CMDLINES - 1);
} while (history_line != edit_line && !key_lines[history_line][1]);
if (history_line == edit_line)
{
if (history_line == edit_line) {
history_line = history_line_last;
return;
}
@@ -400,18 +378,14 @@ void Key_Console (int key)
key_tabpartial[0] = 0;
do
{
do {
history_line = (history_line + 1) & (CMDLINES - 1);
} while (history_line != edit_line && !key_lines[history_line][1]);
if (history_line == edit_line)
{
if (history_line == edit_line) {
len = strlen(current);
memcpy(workline, current, len + 1);
}
else
{
} else {
len = strlen(key_lines[history_line]);
memmove(workline, key_lines[history_line], len + 1);
}
@@ -427,12 +401,14 @@ void Key_Console (int key)
case 'v':
case 'V':
#if defined(PLATFORM_OSX) || defined(PLATFORM_MAC)
if (keydown[K_COMMAND]) { /* Cmd+v paste (Mac-only) */
if (keydown[K_COMMAND]) {
/* Cmd+v paste (Mac-only) */
PasteToConsole();
return;
}
#endif
if (keydown[K_CTRL]) { /* Ctrl+v paste */
if (keydown[K_CTRL]) {
/* Ctrl+v paste */
PasteToConsole();
return;
}
@@ -440,8 +416,9 @@ void Key_Console (int key)
case 'c':
case 'C':
if (keydown[K_CTRL]) { /* Ctrl+C: abort the line -- S.A */
Con_Printf ("%s\n", workline);
if (keydown[K_CTRL]) {
/* Ctrl+C: abort the line -- S.A */
console::info("%s\n", workline);
workline[0] = ']';
workline[1] = 0;
key_linepos = 1;
@@ -452,19 +429,16 @@ void Key_Console (int key)
}
}
void Char_Console (int key)
{
void Char_Console(int key) {
size_t len;
char *workline = key_lines[edit_line];
if (key_linepos < MAXCMDLINE-1)
{
if (key_linepos < MAXCMDLINE - 1) {
bool endpos = !workline[key_linepos];
key_tabpartial[0] = 0; //johnfitz
// if inserting, move the text to the right
if (key_insert && !endpos)
{
if (key_insert && !endpos) {
workline[MAXCMDLINE - 2] = 0;
workline += key_linepos;
len = strlen(workline) + 1;
@@ -476,9 +450,7 @@ void Char_Console (int key)
#pragma GCC diagnostic pop
#endif
*workline = key;
}
else
{
} else {
workline += key_linepos;
*workline = key;
// null terminate if at the end
@@ -495,27 +467,22 @@ bool chat_team = false;
static char chat_buffer[MAXCMDLINE];
static int chat_bufferlen = 0;
const char *Key_GetChatBuffer (void)
{
const char *Key_GetChatBuffer(void) {
return chat_buffer;
}
int Key_GetChatMsgLen (void)
{
int Key_GetChatMsgLen(void) {
return chat_bufferlen;
}
void Key_EndChat (void)
{
void Key_EndChat(void) {
key_dest = key_game;
chat_bufferlen = 0;
chat_buffer[0] = 0;
}
void Key_Message (int key)
{
switch (key)
{
void Key_Message(int key) {
switch (key) {
case K_ENTER:
case K_KP_ENTER:
if (chat_team)
@@ -539,8 +506,7 @@ void Key_Message (int key)
}
}
void Char_Message (int key)
{
void Char_Message(int key) {
if (chat_bufferlen == sizeof(chat_buffer) - 1)
return; // all full
@@ -560,8 +526,7 @@ the given string. Single ascii characters return themselves, while
the K_* names are matched up.
===================
*/
int Key_StringToKeynum (const char *str)
{
int Key_StringToKeynum(const char *str) {
keyname_t *kn;
if (!str || !str[0])
@@ -569,8 +534,7 @@ int Key_StringToKeynum (const char *str)
if (!str[1])
return str[0];
for (kn=keynames ; kn->name ; kn++)
{
for (kn = keynames; kn->name; kn++) {
if (!q_strcasecmp(str, kn->name))
return kn->keynum;
}
@@ -586,22 +550,20 @@ given keynum.
FIXME: handle quote special (general escape sequence?)
===================
*/
const char *Key_KeynumToString (int keynum)
{
const char *Key_KeynumToString(int keynum) {
static char tinystr[2];
keyname_t *kn;
if (keynum == -1)
return "<KEY NOT FOUND>";
if (keynum > 32 && keynum < 127)
{ // printable ascii
if (keynum > 32 && keynum < 127) {
// printable ascii
tinystr[0] = keynum;
tinystr[1] = 0;
return tinystr;
}
for (kn = keynames; kn->name; kn++)
{
for (kn = keynames; kn->name; kn++) {
if (keynum == kn->keynum)
return kn->name;
}
@@ -615,14 +577,12 @@ const char *Key_KeynumToString (int keynum)
Key_SetBinding
===================
*/
void Key_SetBinding (int keynum, const char *binding)
{
void Key_SetBinding(int keynum, const char *binding) {
if (keynum == -1)
return;
// free old bindings
if (keybindings[keynum])
{
if (keybindings[keynum]) {
Z_Free(keybindings[keynum]);
keybindings[keynum] = NULL;
}
@@ -638,32 +598,27 @@ void Key_SetBinding (int keynum, const char *binding)
Key_Unbind_f
===================
*/
void Key_Unbind_f (void)
{
void Key_Unbind_f(void) {
int b;
if (command::argc() != 2)
{
Con_Printf ("unbind <key> : remove commands from a key\n");
if (command::argc() != 2) {
console::info("unbind <key> : remove commands from a key\n");
return;
}
b = Key_StringToKeynum(command::argv(1)->c_str());
if (b == -1)
{
Con_Printf ("\"%s\" isn't a valid key\n", command::argv(1)->c_str());
if (b == -1) {
console::info("\"%s\" isn't a valid key\n", command::argv(1)->c_str());
return;
}
Key_SetBinding(b, NULL);
}
void Key_Unbindall_f (void)
{
void Key_Unbindall_f(void) {
int i;
for (i = 0; i < MAX_KEYS; i++)
{
for (i = 0; i < MAX_KEYS; i++) {
if (keybindings[i])
Key_SetBinding(i, NULL);
}
@@ -674,20 +629,17 @@ void Key_Unbindall_f (void)
Key_Bindlist_f -- johnfitz
============
*/
void Key_Bindlist_f (void)
{
void Key_Bindlist_f(void) {
int i, count;
count = 0;
for (i = 0; i < MAX_KEYS; i++)
{
if (keybindings[i] && *keybindings[i])
{
Con_SafePrintf (" %s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
for (i = 0; i < MAX_KEYS; i++) {
if (keybindings[i] && *keybindings[i]) {
console::safe_print(" %s \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
count++;
}
}
Con_SafePrintf ("%i bindings\n", count);
console::safe_print("%i bindings\n", count);
}
/*
@@ -695,38 +647,33 @@ void Key_Bindlist_f (void)
Key_Bind_f
===================
*/
void Key_Bind_f (void)
{
void Key_Bind_f(void) {
int i, c, b;
char cmd[1024];
c = command::argc();
if (c != 2 && c != 3)
{
Con_Printf ("bind <key> [command] : attach a command to a key\n");
if (c != 2 && c != 3) {
console::info("bind <key> [command] : attach a command to a key\n");
return;
}
b = Key_StringToKeynum(command::argv(1)->c_str());
if (b == -1)
{
Con_Printf ("\"%s\" isn't a valid key\n", command::argv(1)->c_str());
if (b == -1) {
console::info("\"%s\" isn't a valid key\n", command::argv(1)->c_str());
return;
}
if (c == 2)
{
if (c == 2) {
if (keybindings[b])
Con_Printf ("\"%s\" = \"%s\"\n", command::argv(1)->c_str(), keybindings[b] );
console::info("\"%s\" = \"%s\"\n", command::argv(1)->c_str(), keybindings[b]);
else
Con_Printf ("\"%s\" is not bound\n", command::argv(1)->c_str() );
console::info("\"%s\" is not bound\n", command::argv(1)->c_str());
return;
}
// copy the rest of the command line
cmd[0] = 0;
for (i = 2; i < c; i++)
{
for (i = 2; i < c; i++) {
q_strlcat(cmd, command::argv(i)->c_str(), sizeof(cmd));
if (i != (c - 1))
q_strlcat(cmd, " ", sizeof(cmd));
@@ -742,49 +689,41 @@ Key_WriteBindings
Writes lines containing "bind key value"
============
*/
void Key_WriteBindings (FILE *f)
{
void Key_WriteBindings(FILE *f) {
int i;
// unbindall before loading stored bindings:
if (cfg_unbindall.value)
fprintf(f, "unbindall\n");
for (i = 0; i < MAX_KEYS; i++)
{
for (i = 0; i < MAX_KEYS; i++) {
if (keybindings[i] && *keybindings[i])
fprintf(f, "bind \"%s\" \"%s\"\n", Key_KeynumToString(i), keybindings[i]);
}
}
void History_Init (void)
{
void History_Init(void) {
int i, c;
FILE *hf;
for (i = 0; i < CMDLINES; i++)
{
for (i = 0; i < CMDLINES; i++) {
key_lines[i][0] = ']';
key_lines[i][1] = 0;
}
key_linepos = 1;
hf = fopen(va("%s/%s", host_parms->userdir, HISTORY_FILE_NAME), "rt");
if (hf != NULL)
{
do
{
if (hf != NULL) {
do {
i = 1;
do
{
do {
c = fgetc(hf);
key_lines[edit_line][i++] = c;
} while (c != '\r' && c != '\n' && c != EOF && i < MAXCMDLINE);
key_lines[edit_line][i - 1] = 0;
edit_line = (edit_line + 1) & (CMDLINES - 1);
/* for people using a windows-generated history file on unix: */
if (c == '\r' || c == '\n')
{
if (c == '\r' || c == '\n') {
do
c = fgetc(hf);
while (c == '\r' || c == '\n');
@@ -801,22 +740,18 @@ void History_Init (void)
}
}
void History_Shutdown (void)
{
void History_Shutdown(void) {
int i;
FILE *hf;
hf = fopen(va("%s/%s", host_parms->userdir, HISTORY_FILE_NAME), "wt");
if (hf != NULL)
{
if (hf != NULL) {
i = edit_line;
do
{
do {
i = (i + 1) & (CMDLINES - 1);
} while (i != edit_line && !key_lines[i][1]);
while (i != edit_line && key_lines[i][1])
{
while (i != edit_line && key_lines[i][1]) {
fprintf(hf, "%s\n", key_lines[i] + 1);
i = (i + 1) & (CMDLINES - 1);
}
@@ -829,8 +764,7 @@ void History_Shutdown (void)
Key_Init
===================
*/
void Key_Init (void)
{
void Key_Init(void) {
int i;
History_Init();
@@ -910,8 +844,7 @@ static struct {
Key_BeginInputGrab
===================
*/
void Key_BeginInputGrab (void)
{
void Key_BeginInputGrab(void) {
Key_ClearStates();
key_inputgrab.active = true;
@@ -926,8 +859,7 @@ void Key_BeginInputGrab (void)
Key_EndInputGrab
===================
*/
void Key_EndInputGrab (void)
{
void Key_EndInputGrab(void) {
Key_ClearStates();
key_inputgrab.active = false;
@@ -940,8 +872,7 @@ void Key_EndInputGrab (void)
Key_GetGrabbedInput
===================
*/
void Key_GetGrabbedInput (int *lastkey, int *lastchar)
{
void Key_GetGrabbedInput(int *lastkey, int *lastchar) {
if (lastkey)
*lastkey = key_inputgrab.lastkey;
if (lastchar)
@@ -956,8 +887,7 @@ Called by the system between frames for both key up and key down events
Should NOT be called during an interrupt!
===================
*/
void Key_Event (int key, bool down)
{
void Key_Event(int key, bool down) {
Key_EventWithKeycode(key, down, 0);
}
@@ -971,8 +901,7 @@ keycode parameter should have the key's actual keycode using the current keyboar
not necessarily the US-keyboard-based scancode. Pass 0 if not applicable.
===================
*/
void Key_EventWithKeycode (int key, bool down, int keycode)
{
void Key_EventWithKeycode(int key, bool down, int keycode) {
char *kb;
char cmd[1024];
@@ -980,32 +909,25 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
return;
// handle fullscreen toggle
if (down && (key == K_ENTER || key == K_KP_ENTER) && keydown[K_ALT])
{
if (down && (key == K_ENTER || key == K_KP_ENTER) && keydown[K_ALT]) {
VID_Toggle();
return;
}
// handle autorepeats and stray key up events
if (down)
{
if (keydown[key])
{
if (key_dest == key_game && !con_forcedup)
if (down) {
if (keydown[key]) {
if (key_dest == key_game && !console::forced_up)
return; // ignore autorepeats in game mode
}
else if (key >= 200 && !keybindings[key])
Con_Printf ("%s is unbound, hit F4 to set.\n", Key_KeynumToString(key));
}
else if (!keydown[key])
} else if (key >= 200 && !keybindings[key])
console::info("%s is unbound, hit F4 to set.\n", Key_KeynumToString(key));
} else if (!keydown[key])
return; // ignore stray key up events
keydown[key] = down;
if (key_inputgrab.active)
{
if (down)
{
if (key_inputgrab.active) {
if (down) {
key_inputgrab.lastkey = key;
if (keycode > 0)
key_inputgrab.lastchar = keycode;
@@ -1014,19 +936,16 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
}
// handle escape specialy, so the user can never unbind it
if (key == K_ESCAPE)
{
if (key == K_ESCAPE) {
if (!down)
return;
if (keydown[K_SHIFT])
{
Con_ToggleConsole_f();
if (keydown[K_SHIFT]) {
console::toggle_console();
return;
}
switch (key_dest)
{
switch (key_dest) {
case key_message:
Key_Message(key);
break;
@@ -1049,11 +968,9 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
// to keep the character from continuing an action started before a console
// switch. Button commands include the kenum as a parameter, so multiple
// downs can be matched with ups
if (!down)
{
if (!down) {
kb = keybindings[key];
if (kb && kb[0] == '+')
{
if (kb && kb[0] == '+') {
sprintf(cmd, "-%s %i\n", kb + 1, key);
command::buffer::add_text(cmd);
}
@@ -1061,8 +978,7 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
}
// during demo playback, most keys bring up the main menu
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game && key != K_TAB)
{
if (cls.demoplayback && down && consolekeys[key] && key_dest == key_game && key != K_TAB) {
M_ToggleMenu_f();
return;
}
@@ -1070,18 +986,14 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
// if not a consolekey, send to the interpreter no matter what mode is
if ((key_dest == key_menu && menubound[key]) ||
(key_dest == key_console && !consolekeys[key]) ||
(key_dest == key_game && (!con_forcedup || !consolekeys[key])))
{
(key_dest == key_game && (!console::forced_up || !consolekeys[key]))) {
kb = keybindings[key];
if (kb)
{
if (kb[0] == '+')
{ // button commands add keynum as a parm
if (kb) {
if (kb[0] == '+') {
// button commands add keynum as a parm
sprintf(cmd, "%s %i\n", kb, key);
command::buffer::add_text(cmd);
}
else
{
} else {
command::buffer::add_text(kb);
command::buffer::add_text("\n");
}
@@ -1092,8 +1004,7 @@ void Key_EventWithKeycode (int key, bool down, int keycode)
if (!down)
return; // other systems only care about key down events
switch (key_dest)
{
switch (key_dest) {
case key_message:
Key_Message(key);
break;
@@ -1117,8 +1028,7 @@ Char_Event
Called by the backend when the user has input a character.
===================
*/
void Char_Event (int key)
{
void Char_Event(int key) {
if (key < 32 || key > 126)
return;
@@ -1129,14 +1039,12 @@ void Char_Event (int key)
if (keydown[K_CTRL])
return;
if (key_inputgrab.active)
{
if (key_inputgrab.active) {
key_inputgrab.lastchar = key;
return;
}
switch (key_dest)
{
switch (key_dest) {
case key_message:
Char_Message(key);
break;
@@ -1144,7 +1052,7 @@ void Char_Event (int key)
M_Charinput(key);
break;
case key_game:
if (!con_forcedup)
if (!console::forced_up)
break;
/* fallthrough */
case key_console:
@@ -1160,17 +1068,14 @@ void Char_Event (int key)
Key_TextEntry
===================
*/
bool Key_TextEntry (void)
{
if (key_inputgrab.active)
{
bool Key_TextEntry(void) {
if (key_inputgrab.active) {
// This path is used for simple single-letter inputs (y/n prompts) that also
// accept controller input, so we don't want an onscreen keyboard for this case.
return false;
}
switch (key_dest)
{
switch (key_dest) {
case key_message:
return true;
case key_menu:
@@ -1192,12 +1097,10 @@ bool Key_TextEntry (void)
Key_ClearStates
===================
*/
void Key_ClearStates (void)
{
void Key_ClearStates(void) {
int i;
for (i = 0; i < MAX_KEYS; i++)
{
for (i = 0; i < MAX_KEYS; i++) {
if (keydown[i])
Key_Event(i, false);
}
@@ -1208,26 +1111,22 @@ void Key_ClearStates (void)
Key_UpdateForDest
===================
*/
void Key_UpdateForDest (void)
{
void Key_UpdateForDest(void) {
static bool forced = false;
if (cls.state == ca_dedicated)
return;
switch (key_dest)
{
switch (key_dest) {
case key_console:
if (forced && cls.state == ca_connected)
{
if (forced && cls.state == ca_connected) {
forced = false;
IN_Activate();
key_dest = key_game;
}
break;
case key_game:
if (cls.state != ca_connected)
{
if (cls.state != ca_connected) {
forced = true;
IN_Deactivate(modestate == MS_WINDOWED);
key_dest = key_console;
@@ -1239,4 +1138,3 @@ void Key_UpdateForDest (void)
break;
}
}
+2 -2
View File
@@ -257,7 +257,7 @@ void M_ToggleMenu_f(void) {
return;
}
if (key_dest == key_console) {
Con_ToggleConsole_f();
console::toggle_console();
} else {
M_Menu_Main_f();
}
@@ -1260,7 +1260,7 @@ void M_Options_Key(int k) {
break;
case OPT_CONSOLE:
m_state = m_none;
Con_ToggleConsole_f();
console::toggle_console();
break;
case OPT_DEFAULTS:
if (SCR_ModalMessage("This will reset all controls\n"
+42 -42
View File
@@ -83,7 +83,7 @@ static void NET_Ban_f(void) {
command::forward_to_server();
return;
}
print_fn = Con_Printf;
print_fn = console::info;
} else {
if (pr_global_struct->deathmatch)
return;
@@ -283,14 +283,14 @@ int Datagram_GetMessage(qsocket_t *sock) {
break;
if (length == (unsigned int) -1) {
Con_Printf("Read error\n");
console::info("Read error\n");
return -1;
}
if (sfunc.AddrCompare(&readaddr, &sock->addr) != 0) {
Con_Printf("Forged packet received\n");
Con_Printf("Expected: %s\n", StrAddr(&sock->addr));
Con_Printf("Received: %s\n", StrAddr(&readaddr));
console::info("Forged packet received\n");
console::info("Expected: %s\n", StrAddr(&sock->addr));
console::info("Received: %s\n", StrAddr(&readaddr));
continue;
}
@@ -311,14 +311,14 @@ int Datagram_GetMessage(qsocket_t *sock) {
if (flags & NETFLAG_UNRELIABLE) {
if (sequence < sock->unreliableReceiveSequence) {
Con_DPrintf("Got a stale datagram\n");
console::debug("Got a stale datagram\n");
ret = 0;
break;
}
if (sequence != sock->unreliableReceiveSequence) {
count = sequence - sock->unreliableReceiveSequence;
droppedDatagrams += count;
Con_DPrintf("Dropped %u datagram(s)\n", count);
console::debug("Dropped %u datagram(s)\n", count);
}
sock->unreliableReceiveSequence = sequence + 1;
@@ -333,15 +333,15 @@ int Datagram_GetMessage(qsocket_t *sock) {
if (flags & NETFLAG_ACK) {
if (sequence != (sock->sendSequence - 1)) {
Con_DPrintf("Stale ACK received\n");
console::debug("Stale ACK received\n");
continue;
}
if (sequence == sock->ackSequence) {
sock->ackSequence++;
if (sock->ackSequence != sock->sendSequence)
Con_DPrintf("ack sequencing error\n");
console::debug("ack sequencing error\n");
} else {
Con_DPrintf("Duplicate ACK received\n");
console::debug("Duplicate ACK received\n");
continue;
}
sock->sendMessageLength -= MAX_DATAGRAM;
@@ -392,26 +392,26 @@ int Datagram_GetMessage(qsocket_t *sock) {
static void PrintStats(qsocket_t *s) {
Con_Printf("canSend = %4u \n", s->canSend);
Con_Printf("sendSeq = %4u ", s->sendSequence);
Con_Printf("recvSeq = %4u \n", s->receiveSequence);
Con_Printf("\n");
console::info("canSend = %4u \n", s->canSend);
console::info("sendSeq = %4u ", s->sendSequence);
console::info("recvSeq = %4u \n", s->receiveSequence);
console::info("\n");
}
static void NET_Stats_f(void) {
qsocket_t *s;
if (command::argc() == 1) {
Con_Printf("unreliable messages sent = %i\n", unreliableMessagesSent);
Con_Printf("unreliable messages recv = %i\n", unreliableMessagesReceived);
Con_Printf("reliable messages sent = %i\n", messagesSent);
Con_Printf("reliable messages received = %i\n", messagesReceived);
Con_Printf("packetsSent = %i\n", packetsSent);
Con_Printf("packetsReSent = %i\n", packetsReSent);
Con_Printf("packetsReceived = %i\n", packetsReceived);
Con_Printf("receivedDuplicateCount = %i\n", receivedDuplicateCount);
Con_Printf("shortPacketCount = %i\n", shortPacketCount);
Con_Printf("droppedDatagrams = %i\n", droppedDatagrams);
console::info("unreliable messages sent = %i\n", unreliableMessagesSent);
console::info("unreliable messages recv = %i\n", unreliableMessagesReceived);
console::info("reliable messages sent = %i\n", messagesSent);
console::info("reliable messages received = %i\n", messagesReceived);
console::info("packetsSent = %i\n", packetsSent);
console::info("packetsReSent = %i\n", packetsReSent);
console::info("packetsReceived = %i\n", packetsReceived);
console::info("receivedDuplicateCount = %i\n", receivedDuplicateCount);
console::info("shortPacketCount = %i\n", shortPacketCount);
console::info("droppedDatagrams = %i\n", droppedDatagrams);
} else if (std::strcmp(command::argv(1)->c_str(), "*") == 0) {
for (s = net_activeSockets; s; s = s->next)
PrintStats(s);
@@ -454,7 +454,7 @@ static const char *Strip_Port(const char *host) {
port = std::atoi(p);
if (port > 0 && port < 65536 && port != net_hostport) {
net_hostport = port;
Con_Printf("Port set to %d\n", net_hostport);
console::info("Port set to %d\n", net_hostport);
}
return noport;
}
@@ -508,7 +508,7 @@ static void Test_Poll(void *unused) {
connectTime = MSG_ReadLong();
std::strcpy(address, MSG_ReadString());
Con_Printf("%s\n frags:%3i colors:%d %d time:%d\n %s\n", name, frags, colors >> 4, colors & 0x0f,
console::info("%s\n frags:%3i colors:%d %d time:%d\n %s\n", name, frags, colors >> 4, colors & 0x0f,
connectTime / 60, address);
}
@@ -558,7 +558,7 @@ static void Test_f(void) {
}
if (net_landriverlevel == net_numlandrivers) {
Con_Printf("Could not resolve %s\n", host);
console::info("Could not resolve %s\n", host);
return;
}
@@ -627,7 +627,7 @@ static void Test2_Poll(void *unused) {
goto Done;
std::strcpy(value, MSG_ReadString());
Con_Printf("%-16.16s %-16.16s\n", name, value);
console::info("%-16.16s %-16.16s\n", name, value);
SZ_Clear(&net_message);
// save space for the header, filled in later
@@ -643,7 +643,7 @@ Reschedule:
return;
Error:
Con_Printf("Unexpected response to Rule Info request\n");
console::info("Unexpected response to Rule Info request\n");
Done:
dfunc.Close_Socket(test2Socket);
test2InProgress = false;
@@ -685,7 +685,7 @@ static void Test2_f(void) {
}
if (net_landriverlevel == net_numlandrivers) {
Con_Printf("Could not resolve %s\n", host);
console::info("Could not resolve %s\n", host);
return;
}
@@ -1135,7 +1135,7 @@ static qsocket_t *_Datagram_Connect(const char *host) {
// see if we can resolve the host name
if (dfunc.GetAddrFromName(host, &sendaddr) == -1) {
Con_Printf("Could not resolve %s\n", host);
console::info("Could not resolve %s\n", host);
return NULL;
}
@@ -1154,7 +1154,7 @@ static qsocket_t *_Datagram_Connect(const char *host) {
goto ErrorReturn;
// send the connection request
Con_Printf("trying...\n");
console::info("trying...\n");
SCR_UpdateScreen();
start_time = net_time;
@@ -1174,9 +1174,9 @@ static qsocket_t *_Datagram_Connect(const char *host) {
if (ret > 0) {
// is it from the right place?
if (sfunc.AddrCompare(&readaddr, &sendaddr) != 0) {
Con_Printf("wrong reply address\n");
Con_Printf("Expected: %s | %s\n", dfunc.AddrToString(&sendaddr), StrAddr(&sendaddr));
Con_Printf("Received: %s | %s\n", dfunc.AddrToString(&readaddr), StrAddr(&readaddr));
console::info("wrong reply address\n");
console::info("Expected: %s | %s\n", dfunc.AddrToString(&sendaddr), StrAddr(&sendaddr));
console::info("Received: %s | %s\n", dfunc.AddrToString(&readaddr), StrAddr(&readaddr));
SCR_UpdateScreen();
ret = 0;
continue;
@@ -1210,21 +1210,21 @@ static qsocket_t *_Datagram_Connect(const char *host) {
if (ret)
break;
Con_Printf("still trying...\n");
console::info("still trying...\n");
SCR_UpdateScreen();
start_time = SetNetTime();
}
if (ret == 0) {
reason = "No Response";
Con_Printf("%s\n", reason);
console::info("%s\n", reason);
std::strcpy(m_return_reason, reason);
goto ErrorReturn;
}
if (ret == -1) {
reason = "Network Error";
Con_Printf("%s\n", reason);
console::info("%s\n", reason);
std::strcpy(m_return_reason, reason);
goto ErrorReturn;
}
@@ -1232,7 +1232,7 @@ static qsocket_t *_Datagram_Connect(const char *host) {
ret = MSG_ReadByte();
if (ret == CCREP_REJECT) {
reason = MSG_ReadString();
Con_Printf("%s\n", reason);
console::info("%s\n", reason);
q_strlcpy(m_return_reason, reason, sizeof(m_return_reason));
goto ErrorReturn;
}
@@ -1242,20 +1242,20 @@ static qsocket_t *_Datagram_Connect(const char *host) {
dfunc.SetSocketPort(&sock->addr, MSG_ReadLong());
} else {
reason = "Bad Response";
Con_Printf("%s\n", reason);
console::info("%s\n", reason);
std::strcpy(m_return_reason, reason);
goto ErrorReturn;
}
dfunc.GetNameFromAddr(&sendaddr, sock->address);
Con_Printf("Connection accepted\n");
console::info("Connection accepted\n");
sock->lastMessageTime = SetNetTime();
// switch the connection to the specified address
if (dfunc.Connect(newsock, &sock->addr) == -1) {
reason = "Connect to Game failed";
Con_Printf("%s\n", reason);
console::info("%s\n", reason);
std::strcpy(m_return_reason, reason);
goto ErrorReturn;
}
+2 -2
View File
@@ -79,7 +79,7 @@ qsocket_t *Loop_Connect (const char *host)
{
if ((loop_client = NET_NewQSocket ()) == NULL)
{
Con_Printf("Loop_Connect: no qsocket available\n");
console::info("Loop_Connect: no qsocket available\n");
return NULL;
}
std::strcpy (loop_client->address, "localhost");
@@ -92,7 +92,7 @@ qsocket_t *Loop_Connect (const char *host)
{
if ((loop_server = NET_NewQSocket ()) == NULL)
{
Con_Printf("Loop_Connect: no qsocket available\n");
console::info("Loop_Connect: no qsocket available\n");
return NULL;
}
std::strcpy (loop_server->address, "LOCAL");
+20 -20
View File
@@ -164,7 +164,7 @@ const char *NET_QSocketGetAddressString(const qsocket_t *s) {
static void NET_Listen_f(void) {
if (command::argc() != 2) {
Con_Printf("\"listen\" is \"%d\"\n", listening ? 1 : 0);
console::info("\"listen\" is \"%d\"\n", listening ? 1 : 0);
return;
}
@@ -182,12 +182,12 @@ static void MaxPlayers_f(void) {
int n;
if (command::argc() != 2) {
Con_Printf("\"maxplayers\" is \"%d\"\n", svs.maxclients);
console::info("\"maxplayers\" is \"%d\"\n", svs.maxclients);
return;
}
if (sv.active) {
Con_Printf("maxplayers can not be changed while a server is running.\n");
console::info("maxplayers can not be changed while a server is running.\n");
return;
}
@@ -196,7 +196,7 @@ static void MaxPlayers_f(void) {
n = 1;
if (n > svs.maxclientslimit) {
n = svs.maxclientslimit;
Con_Printf("\"maxplayers\" set to \"%d\"\n", n);
console::info("\"maxplayers\" set to \"%d\"\n", n);
}
if ((n == 1) && listening)
@@ -217,13 +217,13 @@ static void NET_Port_f(void) {
int n;
if (command::argc() != 2) {
Con_Printf("\"port\" is \"%d\"\n", net_hostport);
console::info("\"port\" is \"%d\"\n", net_hostport);
return;
}
n = std::atoi(command::argv(1)->c_str());
if (n < 1 || n > 65534) {
Con_Printf("Bad value, must be between 1 and 65534\n");
console::info("Bad value, must be between 1 and 65534\n");
return;
}
@@ -239,8 +239,8 @@ static void NET_Port_f(void) {
static void PrintSlistHeader(void) {
Con_Printf("Server Map Users\n");
Con_Printf("--------------- --------------- -----\n");
console::info("Server Map Users\n");
console::info("--------------- --------------- -----\n");
slistLastShown = 0;
}
@@ -250,10 +250,10 @@ static void PrintSlist(void) {
for (n = slistLastShown; n < hostCacheCount; n++) {
if (hostcache[n].maxusers)
Con_Printf("%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users,
console::info("%-15.15s %-15.15s %2u/%2u\n", hostcache[n].name, hostcache[n].map, hostcache[n].users,
hostcache[n].maxusers);
else
Con_Printf("%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map);
console::info("%-15.15s %-15.15s\n", hostcache[n].name, hostcache[n].map);
}
slistLastShown = n;
}
@@ -261,9 +261,9 @@ static void PrintSlist(void) {
static void PrintSlistTrailer(void) {
if (hostCacheCount)
Con_Printf("== end list ==\n\n");
console::info("== end list ==\n\n");
else
Con_Printf("No Quake servers found.\n\n");
console::info("No Quake servers found.\n\n");
}
@@ -272,7 +272,7 @@ void NET_Slist_f(void) {
return;
if (!slistSilent) {
Con_Printf("Looking for Quake servers...\n");
console::info("Looking for Quake servers...\n");
PrintSlistHeader();
}
@@ -414,7 +414,7 @@ qsocket_t *NET_Connect(const char *host) {
if (hostCacheCount != 1)
return NULL;
host = hostcache[0].cname;
Con_Printf("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host);
console::info("Connecting to...\n%s @ %s\n\n", hostcache[0].name, host);
}
if (hostCacheCount) {
@@ -436,7 +436,7 @@ JustDoIt:
}
if (host) {
Con_Printf("\n");
console::info("\n");
PrintSlistHeader();
PrintSlist();
PrintSlistTrailer();
@@ -509,7 +509,7 @@ int NET_GetMessage(qsocket_t *sock) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_GetMessage: disconnected socket\n");
console::info("NET_GetMessage: disconnected socket\n");
return -1;
}
@@ -557,7 +557,7 @@ int NET_SendMessage(qsocket_t *sock, sizebuf_t *data) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_SendMessage: disconnected socket\n");
console::info("NET_SendMessage: disconnected socket\n");
return -1;
}
@@ -577,7 +577,7 @@ int NET_SendUnreliableMessage(qsocket_t *sock, sizebuf_t *data) {
return -1;
if (sock->disconnected) {
Con_Printf("NET_SendMessage: disconnected socket\n");
console::info("NET_SendMessage: disconnected socket\n");
return -1;
}
@@ -743,10 +743,10 @@ void NET_Init(void) {
}
if (*my_ipx_address) {
Con_DPrintf("IPX address %s\n", my_ipx_address);
console::debug("IPX address %s\n", my_ipx_address);
}
if (*my_tcpip_address) {
Con_DPrintf("TCP/IP address %s\n", my_tcpip_address);
console::debug("TCP/IP address %s\n", my_tcpip_address);
}
}
+12 -12
View File
@@ -53,7 +53,7 @@ sys_socket_t UDP_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("UDP_Init: WARNING: gethostname failed (%s)\n",
console::safe_print("UDP_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else
@@ -66,18 +66,18 @@ sys_socket_t UDP_Init (void)
tst = strstr(buff, ".local");
if (tst && tst[6] == '\0')
{
Con_SafePrintf("UDP_Init: skipping gethostbyname for %s\n", buff);
console::safe_print("UDP_Init: skipping gethostbyname for %s\n", buff);
}
else
#endif
if (!(local = gethostbyname(buff)))
{
Con_SafePrintf("UDP_Init: WARNING: gethostbyname failed (%s)\n",
console::safe_print("UDP_Init: WARNING: gethostbyname failed (%s)\n",
hstrerror(h_errno));
}
else if (local->h_addrtype != AF_INET)
{
Con_SafePrintf("UDP_Init: address from gethostbyname not IPv4\n");
console::safe_print("UDP_Init: address from gethostbyname not IPv4\n");
}
else
{
@@ -105,7 +105,7 @@ sys_socket_t UDP_Init (void)
if ((net_controlsocket = UDP_OpenSocket(0)) == INVALID_SOCKET)
{
Con_SafePrintf("UDP_Init: Unable to open control socket, UDP disabled\n");
console::safe_print("UDP_Init: Unable to open control socket, UDP disabled\n");
return INVALID_SOCKET;
}
@@ -118,7 +118,7 @@ sys_socket_t UDP_Init (void)
tst = strrchr(my_tcpip_address, ':');
if (tst) *tst = 0;
Con_SafePrintf("UDP Initialized\n");
console::safe_print("UDP Initialized\n");
tcpipAvailable = true;
return net_controlsocket;
@@ -165,7 +165,7 @@ sys_socket_t UDP_OpenSocket (int port)
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
{
err = SOCKETERRNO;
Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
console::safe_print("UDP_OpenSocket: %s\n", socketerror(err));
return INVALID_SOCKET;
}
@@ -181,7 +181,7 @@ sys_socket_t UDP_OpenSocket (int port)
ErrorReturn:
err = SOCKETERRNO;
Con_SafePrintf("UDP_OpenSocket: %s\n", socketerror(err));
console::safe_print("UDP_OpenSocket: %s\n", socketerror(err));
UDP_CloseSocket (newsocket);
return INVALID_SOCKET;
}
@@ -295,7 +295,7 @@ int UDP_Read (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr)
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK || err == NET_ECONNREFUSED)
return 0;
Con_SafePrintf ("UDP_Read, recvfrom: %s\n", socketerror(err));
console::safe_print ("UDP_Read, recvfrom: %s\n", socketerror(err));
}
return ret;
}
@@ -311,7 +311,7 @@ static int UDP_MakeSocketBroadcastCapable (sys_socket_t socketid)
== SOCKET_ERROR)
{
int err = SOCKETERRNO;
Con_SafePrintf ("UDP, setsockopt: %s\n", socketerror(err));
console::safe_print ("UDP, setsockopt: %s\n", socketerror(err));
return -1;
}
net_broadcastsocket = socketid;
@@ -332,7 +332,7 @@ int UDP_Broadcast (sys_socket_t socketid, byte *buf, int len)
ret = UDP_MakeSocketBroadcastCapable (socketid);
if (ret == -1)
{
Con_Printf("Unable to make socket broadcast capable\n");
console::info("Unable to make socket broadcast capable\n");
return ret;
}
}
@@ -353,7 +353,7 @@ int UDP_Write (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK)
return 0;
Con_SafePrintf ("UDP_Write, sendto: %s\n", socketerror(err));
console::safe_print ("UDP_Write, sendto: %s\n", socketerror(err));
}
return ret;
}
+12 -12
View File
@@ -83,7 +83,7 @@ static void WINS_GetLocalAddress (void)
if (gethostname(buff, MAXHOSTNAMELEN) == SOCKET_ERROR)
{
err = SOCKETERRNO;
Con_SafePrintf("WINS_GetLocalAddress: WARNING: gethostname failed (%s)\n",
console::safe_print("WINS_GetLocalAddress: WARNING: gethostname failed (%s)\n",
socketerror(err));
return;
}
@@ -100,7 +100,7 @@ static void WINS_GetLocalAddress (void)
#endif
if (local == NULL)
{
Con_SafePrintf("WINS_GetLocalAddress: gethostbyname failed (%s)\n",
console::safe_print("WINS_GetLocalAddress: gethostbyname failed (%s)\n",
__WSAE_StrError(err));
return;
}
@@ -125,7 +125,7 @@ sys_socket_t WINS_Init (void)
err = WSAStartup(MAKEWORD(1,1), &winsockdata);
if (err != 0)
{
Con_SafePrintf("Winsock initialization failed (%s)\n",
console::safe_print("Winsock initialization failed (%s)\n",
socketerror(err));
return INVALID_SOCKET;
}
@@ -136,7 +136,7 @@ sys_socket_t WINS_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("WINS_Init: WARNING: gethostname failed (%s)\n",
console::safe_print("WINS_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else
@@ -166,7 +166,7 @@ sys_socket_t WINS_Init (void)
if ((net_controlsocket = WINS_OpenSocket(0)) == INVALID_SOCKET)
{
Con_SafePrintf("WINS_Init: Unable to open control socket, UDP disabled\n");
console::safe_print("WINS_Init: Unable to open control socket, UDP disabled\n");
if (--winsock_initialized == 0)
WSACleanup ();
return INVALID_SOCKET;
@@ -176,7 +176,7 @@ sys_socket_t WINS_Init (void)
broadcastaddr.sin_addr.s_addr = INADDR_BROADCAST;
broadcastaddr.sin_port = htons((unsigned short)net_hostport);
Con_SafePrintf("UDP Initialized\n");
console::safe_print("UDP Initialized\n");
tcpipAvailable = true;
return net_controlsocket;
@@ -226,7 +226,7 @@ sys_socket_t WINS_OpenSocket (int port)
if ((newsocket = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET)
{
err = SOCKETERRNO;
Con_SafePrintf("WINS_OpenSocket: %s\n", socketerror(err));
console::safe_print("WINS_OpenSocket: %s\n", socketerror(err));
return INVALID_SOCKET;
}
@@ -252,7 +252,7 @@ sys_socket_t WINS_OpenSocket (int port)
ErrorReturn:
err = SOCKETERRNO;
Con_SafePrintf("WINS_OpenSocket: %s\n", socketerror(err));
console::safe_print("WINS_OpenSocket: %s\n", socketerror(err));
closesocket (newsocket);
return INVALID_SOCKET;
}
@@ -359,7 +359,7 @@ int WINS_Read (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *addr
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK || err == NET_ECONNREFUSED)
return 0;
Con_SafePrintf ("WINS_Read, recvfrom: %s\n", socketerror(err));
console::safe_print ("WINS_Read, recvfrom: %s\n", socketerror(err));
}
return ret;
}
@@ -375,7 +375,7 @@ static int WINS_MakeSocketBroadcastCapable (sys_socket_t socketid)
== SOCKET_ERROR)
{
int err = SOCKETERRNO;
Con_SafePrintf ("UDP, setsockopt: %s\n", socketerror(err));
console::safe_print ("UDP, setsockopt: %s\n", socketerror(err));
return -1;
}
net_broadcastsocket = socketid;
@@ -397,7 +397,7 @@ int WINS_Broadcast (sys_socket_t socketid, byte *buf, int len)
ret = WINS_MakeSocketBroadcastCapable (socketid);
if (ret == -1)
{
Con_Printf("Unable to make socket broadcast capable\n");
console::info("Unable to make socket broadcast capable\n");
return ret;
}
}
@@ -418,7 +418,7 @@ int WINS_Write (sys_socket_t socketid, byte *buf, int len, struct qsockaddr *add
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK)
return 0;
Con_SafePrintf ("WINS_Write, sendto: %s\n", socketerror(err));
console::safe_print ("WINS_Write, sendto: %s\n", socketerror(err));
}
return ret;
}
+10 -10
View File
@@ -61,7 +61,7 @@ sys_socket_t WIPX_Init (void)
err = WSAStartup(MAKEWORD(1,1), &winsockdata);
if (err != 0)
{
Con_SafePrintf("Winsock initialization failed (%s)\n",
console::safe_print("Winsock initialization failed (%s)\n",
socketerror(err));
return INVALID_SOCKET;
}
@@ -75,7 +75,7 @@ sys_socket_t WIPX_Init (void)
if (gethostname(buff, MAXHOSTNAMELEN) != 0)
{
err = SOCKETERRNO;
Con_SafePrintf("WIPX_Init: WARNING: gethostname failed (%s)\n",
console::safe_print("WIPX_Init: WARNING: gethostname failed (%s)\n",
socketerror(err));
}
else
@@ -85,7 +85,7 @@ sys_socket_t WIPX_Init (void)
if ((net_controlsocket = WIPX_OpenSocket(0)) == INVALID_SOCKET)
{
Con_SafePrintf("WIPX_Init: Unable to open control socket, IPX disabled\n");
console::safe_print("WIPX_Init: Unable to open control socket, IPX disabled\n");
if (--winsock_initialized == 0)
WSACleanup ();
return INVALID_SOCKET;
@@ -102,7 +102,7 @@ sys_socket_t WIPX_Init (void)
if (colon)
*colon = 0;
Con_SafePrintf("IPX Initialized\n");
console::safe_print("IPX Initialized\n");
ipxAvailable = true;
return net_controlsocket;
@@ -155,14 +155,14 @@ sys_socket_t WIPX_OpenSocket (int port)
}
if (handle == IPXSOCKETS)
{
Con_SafePrintf("WIPX_OpenSocket: Out of free IPX handles.\n");
console::safe_print("WIPX_OpenSocket: Out of free IPX handles.\n");
return INVALID_SOCKET;
}
if ((newsocket = socket (AF_IPX, SOCK_DGRAM, NSPROTO_IPX)) == INVALID_SOCKET)
{
err = SOCKETERRNO;
Con_SafePrintf("WIPX_OpenSocket: %s\n", socketerror(err));
console::safe_print("WIPX_OpenSocket: %s\n", socketerror(err));
return INVALID_SOCKET;
}
@@ -194,7 +194,7 @@ sys_socket_t WIPX_OpenSocket (int port)
ErrorReturn:
err = SOCKETERRNO;
Con_SafePrintf("WIPX_OpenSocket: %s\n", socketerror(err));
console::safe_print("WIPX_OpenSocket: %s\n", socketerror(err));
closesocket (newsocket);
return INVALID_SOCKET;
}
@@ -253,7 +253,7 @@ int WIPX_Read (sys_socket_t handle, byte *buf, int len, struct qsockaddr *addr)
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK || err == NET_ECONNREFUSED)
return 0;
Con_SafePrintf ("WIPX_Read, recvfrom: %s\n", socketerror(err));
console::safe_print ("WIPX_Read, recvfrom: %s\n", socketerror(err));
}
if (ret < 4)
@@ -292,7 +292,7 @@ int WIPX_Write (sys_socket_t handle, byte *buf, int len, struct qsockaddr *addr)
int err = SOCKETERRNO;
if (err == NET_EWOULDBLOCK)
return 0;
Con_SafePrintf ("WIPX_Write, sendto: %s\n", socketerror(err));
console::safe_print ("WIPX_Write, sendto: %s\n", socketerror(err));
}
return ret;
@@ -369,7 +369,7 @@ int WIPX_GetSocketAddr (sys_socket_t handle, struct qsockaddr *addr)
{
int err = SOCKETERRNO;
/* FIXME: what action should be taken?... */
Con_SafePrintf ("WIPX, getsockname: %s\n", socketerror(err));
console::safe_print ("WIPX, getsockname: %s\n", socketerror(err));
}
return 0;
+12 -12
View File
@@ -82,7 +82,7 @@ static char *PF_VarString (int first)
s = q_strlcat(out, LOC_GetString(G_STRING(OFS_PARM0+i*3)), sizeof(out));
if (s >= sizeof(out))
{
Con_Warning("PF_VarString: overflow (string truncated)\n");
console::warn("PF_VarString: overflow (string truncated)\n");
return out;
}
}
@@ -91,7 +91,7 @@ static char *PF_VarString (int first)
{
if (!dev_overflows.varstring || dev_overflows.varstring + CONSOLE_RESPAM_TIME < realtime)
{
Con_DWarning("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n",
console::dev_warn("PF_VarString: %i characters exceeds standard limit of 255 (max = %d).\n",
(int) s, (int)(sizeof(out) - 1));
dev_overflows.varstring = realtime;
}
@@ -116,7 +116,7 @@ static void PF_error (void)
edict_t *ed;
s = PF_VarString(0);
Con_Printf ("======SERVER ERROR in %s:\n%s\n",
console::info ("======SERVER ERROR in %s:\n%s\n",
PR_GetString(pr_xfunction->s_name), s);
ed = PROG_TO_EDICT(pr_global_struct->self);
ED_Print (ed);
@@ -140,7 +140,7 @@ static void PF_objerror (void)
edict_t *ed;
s = PF_VarString(0);
Con_Printf ("======OBJECT ERROR in %s:\n%s\n",
console::info ("======OBJECT ERROR in %s:\n%s\n",
PR_GetString(pr_xfunction->s_name), s);
ed = PROG_TO_EDICT(pr_global_struct->self);
ED_Print (ed);
@@ -368,7 +368,7 @@ static void PF_sprint (void)
if (entnum < 1 || entnum > svs.maxclients)
{
Con_Printf ("tried to sprint to a non-client\n");
console::info ("tried to sprint to a non-client\n");
return;
}
@@ -399,7 +399,7 @@ static void PF_centerprint (void)
if (entnum < 1 || entnum > svs.maxclients)
{
Con_Printf ("tried to sprint to a non-client\n");
console::info ("tried to sprint to a non-client\n");
return;
}
@@ -595,7 +595,7 @@ static void PF_ambientsound (void)
if (!*check)
{
Con_Printf ("no precache: %s\n", samp);
console::info ("no precache: %s\n", samp);
return;
}
@@ -676,7 +676,7 @@ break()
*/
static void PF_break (void)
{
Con_Printf ("break statement\n");
console::info ("break statement\n");
*(int *)-4 = 0; // dump to debugger
// PR_RunError ("break statement");
}
@@ -708,7 +708,7 @@ static void PF_traceline (void)
if (developer.value) {
if (IS_NAN(v1[0]) || IS_NAN(v1[1]) || IS_NAN(v1[2]) ||
IS_NAN(v2[0]) || IS_NAN(v2[1]) || IS_NAN(v2[2])) {
Con_Warning ("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %d\n",
console::warn ("NAN in traceline:\nv1(%f %f %f) v2(%f %f %f)\nentity %d\n",
v1[0], v1[1], v1[2], v2[0], v2[1], v2[2], NUM_FOR_EDICT(ent));
}
}
@@ -1008,7 +1008,7 @@ PF_dprint
*/
static void PF_dprint (void)
{
Con_DPrintf ("%s",PF_VarString(0));
console::debug ("%s",PF_VarString(0));
}
static void PF_ftos (void)
@@ -1269,7 +1269,7 @@ static void PF_lightstyle (void)
// bounds check to avoid clobbering sv struct
if (style < 0 || style >= MAX_LIGHTSTYLES)
{
Con_DWarning("PF_lightstyle: invalid style %d\n", style);
console::dev_warn("PF_lightstyle: invalid style %d\n", style);
return;
}
@@ -1733,7 +1733,7 @@ static void PF_localsound (void)
entnum = G_EDICTNUM(OFS_PARM0);
sample = G_STRING(OFS_PARM1);
if (entnum < 1 || entnum > svs.maxclients) {
Con_Printf ("tried to localsound to a non-client\n");
console::info ("tried to localsound to a non-client\n");
return;
}
SV_LocalSound (&svs.clients[entnum-1], sample);
+23 -23
View File
@@ -487,11 +487,11 @@ void ED_Print (edict_t *ed)
if (ed->free)
{
Con_Printf ("FREE\n");
console::info ("FREE\n");
return;
}
Con_SafePrintf("\nEDICT %i:\n", NUM_FOR_EDICT(ed)); //johnfitz -- was Con_Printf
console::safe_print("\nEDICT %i:\n", NUM_FOR_EDICT(ed)); //johnfitz -- was console::info
for (i = 1; i < progs->numfielddefs; i++)
{
d = &pr_fielddefs[i];
@@ -516,11 +516,11 @@ void ED_Print (edict_t *ed)
if (j == type_size[type])
continue;
Con_SafePrintf ("%s", name); //johnfitz -- was Con_Printf
console::safe_print ("%s", name); //johnfitz -- was console::info
while (l++ < 15)
Con_SafePrintf (" "); //johnfitz -- was Con_Printf
console::safe_print (" "); //johnfitz -- was console::info
Con_SafePrintf ("%s\n", PR_ValueString(d->type, (eval_t *)v)); //johnfitz -- was Con_Printf
console::safe_print ("%s\n", PR_ValueString(d->type, (eval_t *)v)); //johnfitz -- was console::info
}
}
@@ -602,7 +602,7 @@ void ED_PrintEdicts (void)
if (!sv.active)
return;
Con_Printf ("%i entities\n", sv.num_edicts);
console::info ("%i entities\n", sv.num_edicts);
for (i = 0; i < sv.num_edicts; i++)
ED_PrintNum (i);
}
@@ -624,7 +624,7 @@ static void ED_PrintEdict_f (void)
i = std::atoi (command::argv(1).value_or("").c_str());
if (i < 0 || i >= sv.num_edicts)
{
Con_Printf("Bad edict number\n");
console::info("Bad edict number\n");
return;
}
ED_PrintNum (i);
@@ -660,11 +660,11 @@ static void ED_Count (void)
step++;
}
Con_Printf ("num_edicts:%3i\n", sv.num_edicts);
Con_Printf ("active :%3i\n", active);
Con_Printf ("view :%3i\n", models);
Con_Printf ("touch :%3i\n", solid);
Con_Printf ("step :%3i\n", step);
console::info ("num_edicts:%3i\n", sv.num_edicts);
console::info ("active :%3i\n", active);
console::info ("view :%3i\n", models);
console::info ("touch :%3i\n", solid);
console::info ("step :%3i\n", step);
}
@@ -743,7 +743,7 @@ void ED_ParseGlobals (std::istringstream &ss)
key = ED_FindGlobal (keyname.c_str());
if (!key)
{
Con_Printf ("'%s' is not a global\n", keyname.c_str());
console::info ("'%s' is not a global\n", keyname.c_str());
continue;
}
@@ -836,7 +836,7 @@ static bool ED_ParseEpair (void *base, ddef_t *key, const char *s)
// before reading 3 floats.
if (i < 3)
{
Con_DWarning ("Avoided reading garbage for \"%s\" \"%s\"\n", PR_GetString(key->s_name), s);
console::dev_warn ("Avoided reading garbage for \"%s\" \"%s\"\n", PR_GetString(key->s_name), s);
for (; i < 3; i++)
((float *)d)[i] = 0.0f;
}
@@ -852,7 +852,7 @@ static bool ED_ParseEpair (void *base, ddef_t *key, const char *s)
{
//johnfitz -- HACK -- suppress error becuase fog/sky fields might not be mentioned in defs.qc
if (strncmp(s, "sky", 3) && strcmp(s, "fog"))
Con_DPrintf ("Can't find field %s\n", s);
console::debug ("Can't find field %s\n", s);
return false;
}
*(int *)d = G_INT(def->ofs);
@@ -862,7 +862,7 @@ static bool ED_ParseEpair (void *base, ddef_t *key, const char *s)
func = ED_FindFunction (s);
if (!func)
{
Con_Printf ("Can't find function %s\n", s);
console::info ("Can't find function %s\n", s);
return false;
}
*(func_t *)d = func - pr_functions;
@@ -962,7 +962,7 @@ void ED_ParseEdict(std::istringstream &ss, edict_t *ent)
{
//johnfitz -- HACK -- suppress error becuase fog/sky/alpha fields might not be mentioned in defs.qc
if (keyname != "sky" && keyname != "fog" && keyname != "alpha")
Con_DPrintf ("\"%s\" is not a field\n", keyname.c_str()); //johnfitz -- was Con_Printf
console::debug ("\"%s\" is not a field\n", keyname.c_str()); //johnfitz -- was console::info
continue;
}
@@ -1046,7 +1046,7 @@ void ED_LoadFromFile (const char *data)
//
if (!ent->v.classname)
{
Con_SafePrintf ("No classname for:\n"); //johnfitz -- was Con_Printf
console::safe_print ("No classname for:\n"); //johnfitz -- was console::info
ED_Print (ent);
ED_Free (ent);
continue;
@@ -1057,7 +1057,7 @@ void ED_LoadFromFile (const char *data)
if (!func)
{
Con_SafePrintf ("No spawn function for:\n"); //johnfitz -- was Con_Printf
console::safe_print ("No spawn function for:\n"); //johnfitz -- was console::info
ED_Print (ent);
ED_Free (ent);
continue;
@@ -1069,7 +1069,7 @@ void ED_LoadFromFile (const char *data)
PR_ExecuteProgram (func - pr_functions);
}
Con_DPrintf ("%i entities inhibited\n", inhibit);
console::debug ("%i entities inhibited\n", inhibit);
}
@@ -1178,7 +1178,7 @@ void PR_LoadProgs (void)
progs = (dprograms_t *)COM_LoadHunkFile ("progs.dat", NULL);
if (!progs)
Host_Error ("PR_LoadProgs: couldn't load progs.dat");
Con_DPrintf ("Programs occupy %iK.\n", com_filesize/1024);
console::debug ("Programs occupy %iK.\n", com_filesize/1024);
for (i = 0; i < com_filesize; i++)
CRC_ProcessByte (&pr_crc, ((byte *)progs)[i]);
@@ -1322,7 +1322,7 @@ int NUM_FOR_EDICT(edict_t *e)
static void PR_AllocStringSlots (void)
{
pr_maxknownstrings += PR_STRING_ALLOCSLOTS;
Con_DPrintf2("PR_AllocStringSlots: realloc'ing for %d slots\n", pr_maxknownstrings);
console::trace("PR_AllocStringSlots: realloc'ing for %d slots\n", pr_maxknownstrings);
pr_knownstrings = (const char **) Z_Realloc ((void *)pr_knownstrings, pr_maxknownstrings * sizeof(char *));
}
@@ -1365,7 +1365,7 @@ int PR_SetEngineString (const char *s)
return -1 - i;
}
// new unknown engine string
//Con_DPrintf ("PR_SetEngineString: new engine string %p\n", s);
//console::debug ("PR_SetEngineString: new engine string %p\n", s);
#if 0
for (i = 0; i < pr_numknownstrings; i++)
{
+15 -15
View File
@@ -146,33 +146,33 @@ static void PR_PrintStatement (dstatement_t *s)
if ((unsigned int)s->op < std::size(pr_opnames))
{
Con_Printf("%s ", pr_opnames[s->op]);
console::info("%s ", pr_opnames[s->op]);
i = strlen(pr_opnames[s->op]);
for ( ; i < 10; i++)
Con_Printf(" ");
console::info(" ");
}
if (s->op == OP_IF || s->op == OP_IFNOT)
Con_Printf("%sbranch %i", PR_GlobalString(s->a), s->b);
console::info("%sbranch %i", PR_GlobalString(s->a), s->b);
else if (s->op == OP_GOTO)
{
Con_Printf("branch %i", s->a);
console::info("branch %i", s->a);
}
else if ((unsigned int)(s->op-OP_STORE_F) < 6)
{
Con_Printf("%s", PR_GlobalString(s->a));
Con_Printf("%s", PR_GlobalStringNoContents(s->b));
console::info("%s", PR_GlobalString(s->a));
console::info("%s", PR_GlobalStringNoContents(s->b));
}
else
{
if (s->a)
Con_Printf("%s", PR_GlobalString(s->a));
console::info("%s", PR_GlobalString(s->a));
if (s->b)
Con_Printf("%s", PR_GlobalString(s->b));
console::info("%s", PR_GlobalString(s->b));
if (s->c)
Con_Printf("%s", PR_GlobalStringNoContents(s->c));
console::info("%s", PR_GlobalStringNoContents(s->c));
}
Con_Printf("\n");
console::info("\n");
}
/*
@@ -187,7 +187,7 @@ static void PR_StackTrace (void)
if (pr_depth == 0)
{
Con_Printf("<NO STACK>\n");
console::info("<NO STACK>\n");
return;
}
@@ -197,11 +197,11 @@ static void PR_StackTrace (void)
f = pr_stack[i].f;
if (!f)
{
Con_Printf("<NO FUNCTION>\n");
console::info("<NO FUNCTION>\n");
}
else
{
Con_Printf("%12s : %s\n", PR_GetString(f->s_file), PR_GetString(f->s_name));
console::info("%12s : %s\n", PR_GetString(f->s_file), PR_GetString(f->s_name));
}
}
}
@@ -239,7 +239,7 @@ void PR_Profile_f (void)
if (best)
{
if (num < 10)
Con_Printf("%7i %s\n", best->profile, PR_GetString(best->s_name));
console::info("%7i %s\n", best->profile, PR_GetString(best->s_name));
num++;
best->profile = 0;
}
@@ -266,7 +266,7 @@ void PR_RunError (const char *error, ...)
PR_PrintStatement(pr_statements + pr_xstatement);
PR_StackTrace();
Con_Printf("%s\n", string);
console::info("%s\n", string);
pr_depth = 0; // dump the stack so host_error can shutdown functions
+2 -2
View File
@@ -412,7 +412,7 @@ void R_SetupAliasFrame (aliashdr_t *paliashdr, int frame, lerpdata_t *lerpdata)
if ((frame >= paliashdr->numframes) || (frame < 0))
{
Con_DPrintf ("R_AliasSetupFrame: no such frame %d for '%s'\n", frame, e->model->name);
console::debug ("R_AliasSetupFrame: no such frame %d for '%s'\n", frame, e->model->name);
frame = 0;
}
@@ -705,7 +705,7 @@ void R_DrawAliasModel (entity_t *e)
skinnum = e->skinnum;
if ((skinnum >= paliashdr->numskins) || (skinnum < 0))
{
Con_DPrintf ("R_DrawAliasModel: no such skin # %d for '%s'\n", skinnum, e->model->name);
console::debug ("R_DrawAliasModel: no such skin # %d for '%s'\n", skinnum, e->model->name);
// ericw -- display skin 0 for winquake compatibility
skinnum = 0;
}
+1 -1
View File
@@ -604,7 +604,7 @@ void GL_BuildLightmaps (void)
//given that we are using lightmap_count of LMBLOCK_WIDTH x LMBLOCK_HEIGHT
i = lightmap_count * ((LMBLOCK_WIDTH / 128) * (LMBLOCK_HEIGHT / 128));
if (i > 64)
Con_DWarning("%i lightmaps exceeds standard limit of 64.\n",i);
console::dev_warn("%i lightmaps exceeds standard limit of 64.\n",i);
//johnfitz
}
+4 -4
View File
@@ -275,11 +275,11 @@ void R_ReadPointFile_f (void)
COM_FOpenFile (name, &f, NULL);
if (!f)
{
Con_Printf ("couldn't open %s\n", name);
console::info ("couldn't open %s\n", name);
return;
}
Con_Printf ("Reading %s...\n", name);
console::info ("Reading %s...\n", name);
c = 0;
org[0] = org[1] = org[2] = 0; // silence pesky compiler warnings
for ( ;; )
@@ -291,7 +291,7 @@ void R_ReadPointFile_f (void)
if (!free_particles)
{
Con_Printf ("Not enough free particles\n");
console::info ("Not enough free particles\n");
break;
}
p = free_particles;
@@ -307,7 +307,7 @@ void R_ReadPointFile_f (void)
}
fclose (f);
Con_Printf ("%i points read\n", c);
console::info ("%i points read\n", c);
}
/*
+1 -1
View File
@@ -41,7 +41,7 @@ mspriteframe_t *R_GetSpriteFrame (entity_t *currentent)
if ((frame >= psprite->numframes) || (frame < 0))
{
Con_DPrintf ("R_DrawSprite: no such frame %d for '%s'\n", frame, currentent->model->name);
console::debug ("R_DrawSprite: no such frame %d for '%s'\n", frame, currentent->model->name);
frame = 0;
}
+1 -1
View File
@@ -388,7 +388,7 @@ static void R_BatchSurface (msurface_t *s)
if (num_surf_indices <= 0)
{
// Con_DWarning ("bad numedges for surface\n");
// console::dev_warn ("bad numedges for surface\n");
return;
}
+6 -6
View File
@@ -128,7 +128,7 @@ snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type, bo
if (type == CODECTYPE_NONE)
{
Con_Printf("Bad type for %s\n", filename);
console::info("Bad type for %s\n", filename);
return NULL;
}
@@ -141,7 +141,7 @@ snd_stream_t *S_CodecOpenStreamType (const char *filename, unsigned int type, bo
}
if (!codec)
{
Con_Printf("Unknown type for %s\n", filename);
console::info("Unknown type for %s\n", filename);
return NULL;
}
stream = S_CodecUtilOpen(filename, codec, loop);
@@ -162,7 +162,7 @@ snd_stream_t *S_CodecOpenStreamExt (const char *filename, bool loop)
ext = COM_FileGetExtension(filename);
if (! *ext)
{
Con_Printf("No extension for %s\n", filename);
console::info("No extension for %s\n", filename);
return NULL;
}
@@ -175,7 +175,7 @@ snd_stream_t *S_CodecOpenStreamExt (const char *filename, bool loop)
}
if (!codec)
{
Con_Printf("Unknown extension for %s\n", filename);
console::info("Unknown extension for %s\n", filename);
return NULL;
}
stream = S_CodecUtilOpen(filename, codec, loop);
@@ -226,7 +226,7 @@ snd_stream_t *S_CodecOpenStreamAny (const char *filename, bool loop)
}
if (!codec)
{
Con_Printf("Unknown extension for %s\n", filename);
console::info("Unknown extension for %s\n", filename);
return NULL;
}
stream = S_CodecUtilOpen(filename, codec, loop);
@@ -292,7 +292,7 @@ snd_stream_t *S_CodecUtilOpen(const char *filename, snd_codec_t *codec, bool loo
pak = file_from_pak;
if (length == -1)
{
Con_DPrintf("Couldn't open %s\n", filename);
console::debug("Couldn't open %s\n", filename);
return NULL;
}
+23 -23
View File
@@ -102,17 +102,17 @@ static convar _snd_mixahead = {"_snd_mixahead", "0.1", {.archive = true}};
static void S_SoundInfo_f(void) {
if (!sound_started || !shm) {
Con_Printf("sound system not started\n");
console::info("sound system not started\n");
return;
}
Con_Printf("%d bit, %s, %d Hz\n", shm->samplebits,
console::info("%d bit, %s, %d Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed);
Con_Printf("%5d samples\n", shm->samples);
Con_Printf("%5d samplepos\n", shm->samplepos);
Con_Printf("%5d submission_chunk\n", shm->submission_chunk);
Con_Printf("%5d total_channels\n", total_channels);
Con_Printf("%p dma buffer\n", shm->buffer);
console::info("%5d samples\n", shm->samples);
console::info("%5d samplepos\n", shm->samplepos);
console::info("%5d submission_chunk\n", shm->submission_chunk);
console::info("%5d total_channels\n", total_channels);
console::info("%p dma buffer\n", shm->buffer);
}
@@ -122,7 +122,7 @@ static void SND_Callback_sfxvolume(convar *var) {
static void SND_Callback_snd_filterquality(convar *var) {
if (snd_filterquality.value < 1 || snd_filterquality.value > 5) {
Con_Printf("snd_filterquality must be between 1 and 5\n");
console::info("snd_filterquality must be between 1 and 5\n");
snd_filterquality.set(SND_FILTERQUALITY_DEFAULT);
}
}
@@ -139,9 +139,9 @@ void S_Startup(void) {
sound_started = SNDDMA_Init(&sn);
if (!sound_started) {
Con_Printf("Failed initializing sound\n");
console::info("Failed initializing sound\n");
} else {
Con_Printf("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
console::info("Audio: %d bit, %s, %d Hz\n", shm->samplebits,
(shm->channels == 2) ? "stereo" : "mono", shm->speed);
}
}
@@ -154,7 +154,7 @@ S_Init
*/
void S_Init(void) {
if (snd_initialized) {
Con_Printf("Sound is already initialized\n");
console::info("Sound is already initialized\n");
return;
}
@@ -175,7 +175,7 @@ void S_Init(void) {
if (safemode || common::check_param("-nosound").has_value())
return;
Con_Printf("\nSound Initialization\n");
console::info("\nSound Initialization\n");
command::add("play", S_Play);
command::add("playvol", S_PlayVol);
@@ -195,7 +195,7 @@ void S_Init(void) {
if (host_parms->memsize < 0x800000) {
loadas8bit.set("1");
Con_Printf("loading all sounds as 8bit\n");
console::info("loading all sounds as 8bit\n");
}
sfxvolume.set_callback(SND_Callback_sfxvolume);
@@ -554,7 +554,7 @@ void S_StaticSound(sfx_t *sfx, vec3_t origin, float vol, float attenuation) {
return;
if (total_channels == MAX_CHANNELS) {
Con_Printf("total_channels == MAX_CHANNELS\n");
console::info("total_channels == MAX_CHANNELS\n");
return;
}
@@ -566,7 +566,7 @@ void S_StaticSound(sfx_t *sfx, vec3_t origin, float vol, float attenuation) {
return;
if (sc->loopstart == -1) {
Con_Printf("Sound %s not looped\n", sfx->name);
console::info("Sound %s not looped\n", sfx->name);
return;
}
@@ -777,12 +777,12 @@ void S_Update(vec3_t origin, vec3_t forward, vec3_t right, vec3_t up) {
ch = snd_channels;
for (i = 0; i < total_channels; i++, ch++) {
if (ch->sfx && (ch->leftvol || ch->rightvol)) {
// Con_Printf ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
// console::info ("%3i %3i %s\n", ch->leftvol, ch->rightvol, ch->sfx->name);
total++;
}
}
Con_Printf("----(%i)----\n", total);
console::info("----(%i)----\n", total);
}
// add raw data from streamed samples
@@ -841,7 +841,7 @@ static void S_Update_(void) {
// check to make sure that we haven't overshot
if (paintedtime < soundtime) {
// Con_Printf ("S_Update_ : overflow\n");
// console::info ("S_Update_ : overflow\n");
paintedtime = soundtime;
}
@@ -939,12 +939,12 @@ static void S_SoundList(void) {
size = sc->length * sc->width * (sc->stereo + 1);
total += size;
if (sc->loopstart >= 0)
Con_SafePrintf("L"); //johnfitz -- was Con_Printf
console::safe_print("L"); //johnfitz -- was console::info
else
Con_SafePrintf(" "); //johnfitz -- was Con_Printf
Con_SafePrintf("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); //johnfitz -- was Con_Printf
console::safe_print(" "); //johnfitz -- was console::info
console::safe_print("(%2db) %6i : %s\n", sc->width * 8, size, sfx->name); //johnfitz -- was console::info
}
Con_Printf("%i sounds, %i bytes\n", num_sfx, total); //johnfitz -- added count
console::info("%i sounds, %i bytes\n", num_sfx, total); //johnfitz -- added count
}
@@ -958,7 +958,7 @@ void S_LocalSound(const char *name) {
sfx = S_PrecacheSound(name);
if (!sfx) {
Con_Printf("S_LocalSound: can't cache %s\n", name);
console::info("S_LocalSound: can't cache %s\n", name);
return;
}
S_StartSound(cl.viewentity, -1, sfx, vec3_origin, 1, 1);
+9 -9
View File
@@ -82,7 +82,7 @@ flac_error_func (const FLAC__StreamDecoder *decoder,
{
flacfile_t *ff = (flacfile_t *) client_data;
ff->error = -1;
Con_Printf ("FLAC: decoder error %i\n", status);
console::info ("FLAC: decoder error %i\n", status);
}
static FLAC__StreamDecoderReadStatus
@@ -151,7 +151,7 @@ flac_write_func (const FLAC__StreamDecoder *decoder,
ff->buffer = (byte *) malloc (ff->info->blocksize * ff->info->channels * ff->info->width);
if (!ff->buffer) {
ff->error = -1; /* needn't set this here, but... */
Con_Printf("Insufficient memory for fLaC audio\n");
console::info("Insufficient memory for fLaC audio\n");
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
}
@@ -243,7 +243,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
ff->decoder = FLAC__stream_decoder_new ();
if (ff->decoder == NULL)
{
Con_Printf("Unable to create fLaC decoder\n");
console::info("Unable to create fLaC decoder\n");
goto _fail;
}
@@ -277,7 +277,7 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
#endif
if (rc != FLAC__STREAM_DECODER_INIT_STATUS_OK) /* unlikely */
{
Con_Printf ("FLAC: decoder init error %i\n", rc);
console::info ("FLAC: decoder init error %i\n", rc);
goto _fail;
}
@@ -285,24 +285,24 @@ static bool S_FLAC_CodecOpenStream (snd_stream_t *stream)
if (rc == false || ff->error)
{
rc = FLAC__stream_decoder_get_state(ff->decoder);
Con_Printf("%s not a valid flac file? (decoder state %i)\n",
console::info("%s not a valid flac file? (decoder state %i)\n",
stream->name, rc);
goto _fail;
}
if (ff->info->dataofs < 0)
{
Con_Printf("%s has no STREAMINFO\n", stream->name);
console::info("%s has no STREAMINFO\n", stream->name);
goto _fail;
}
if (ff->info->bits != 8 && ff->info->bits != 16)
{
Con_Printf("%s is not 8 or 16 bit\n", stream->name);
console::info("%s is not 8 or 16 bit\n", stream->name);
goto _fail;
}
if (ff->info->channels != 1 && ff->info->channels != 2)
{
Con_Printf("Unsupported number of channels %d in %s\n",
console::info("Unsupported number of channels %d in %s\n",
ff->info->channels, stream->name);
goto _fail;
}
@@ -342,7 +342,7 @@ static int S_FLAC_CodecReadStream (snd_stream_t *stream, int len, void *buffer)
} else if (res < 0) { /* error */
return -1;
} else {
Con_DPrintf ("FLAC: EOF\n");
console::debug ("FLAC: EOF\n");
break;
}
}
+15 -15
View File
@@ -107,32 +107,32 @@ sfxcache_t *S_LoadSound (sfx_t *s)
if (sc)
return sc;
// Con_Printf ("S_LoadSound: %x\n", (int)stackbuf);
// console::info ("S_LoadSound: %x\n", (int)stackbuf);
// load it in
q_strlcpy(namebuffer, "sound/", sizeof(namebuffer));
q_strlcat(namebuffer, s->name, sizeof(namebuffer));
// Con_Printf ("loading %s\n",namebuffer);
// console::info ("loading %s\n",namebuffer);
data = COM_LoadStackFile(namebuffer, stackbuf, sizeof(stackbuf), NULL);
if (!data)
{
Con_Printf ("Couldn't load %s\n", namebuffer);
console::info ("Couldn't load %s\n", namebuffer);
return NULL;
}
info = GetWavinfo (s->name, data, com_filesize);
if (info.channels != 1)
{
Con_Printf ("%s is a stereo sample\n",s->name);
console::info ("%s is a stereo sample\n",s->name);
return NULL;
}
if (info.width != 1 && info.width != 2)
{
Con_Printf("%s is not 8 or 16 bit\n", s->name);
console::info("%s is not 8 or 16 bit\n", s->name);
return NULL;
}
@@ -143,7 +143,7 @@ sfxcache_t *S_LoadSound (sfx_t *s)
if (info.samples == 0 || len == 0)
{
Con_Printf("%s has zero samples\n", s->name);
console::info("%s has zero samples\n", s->name);
return NULL;
}
@@ -214,7 +214,7 @@ static void FindNextChunk (const char *name)
if (iff_chunk_len < 0 || iff_chunk_len > iff_end - data_p)
{
data_p = NULL;
Con_DPrintf2("bad \"%s\" chunk length (%d)\n", name, iff_chunk_len);
console::trace("bad \"%s\" chunk length (%d)\n", name, iff_chunk_len);
return;
}
last_chunk = data_p + ((iff_chunk_len + 1) & ~1);
@@ -242,7 +242,7 @@ static void DumpChunks (void)
memcpy (str, data_p, 4);
data_p += 4;
iff_chunk_len = GetLittleLong();
Con_Printf ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
console::info ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end);
}
@@ -272,7 +272,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("RIFF");
if (!(data_p && !strncmp((char *)data_p + 8, "WAVE", 4)))
{
Con_Printf("%s missing RIFF/WAVE chunks\n", name);
console::info("%s missing RIFF/WAVE chunks\n", name);
return info;
}
@@ -285,14 +285,14 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("fmt ");
if (!data_p)
{
Con_Printf("%s is missing fmt chunk\n", name);
console::info("%s is missing fmt chunk\n", name);
return info;
}
data_p += 8;
format = GetLittleShort();
if (format != WAV_FORMAT_PCM)
{
Con_Printf("%s is not Microsoft PCM format\n", name);
console::info("%s is not Microsoft PCM format\n", name);
return info;
}
@@ -310,7 +310,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
{
data_p += 32;
info.loopstart = GetLittleLong();
// Con_Printf("loopstart=%d\n", sfx->loopstart);
// console::info("loopstart=%d\n", sfx->loopstart);
// if the next chunk is a LIST chunk, look for a cue length marker
FindNextChunk ("LIST");
@@ -321,7 +321,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
data_p += 24;
i = GetLittleLong(); // samples in loop
info.samples = info.loopstart + i;
// Con_Printf("looped length: %i\n", i);
// console::info("looped length: %i\n", i);
}
}
}
@@ -332,7 +332,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
FindChunk("data");
if (!data_p)
{
Con_Printf("%s is missing data chunk\n", name);
console::info("%s is missing data chunk\n", name);
return info;
}
@@ -349,7 +349,7 @@ wavinfo_t GetWavinfo (const char *name, byte *wav, int wavlength)
if (info.loopstart >= info.samples)
{
Con_Warning ("%s has loop start >= end\n", name);
console::warn ("%s has loop start >= end\n", name);
info.loopstart = -1;
info.samples = samples;
}
+3 -3
View File
@@ -109,7 +109,7 @@ static bool S_MIKMOD_CodecInitialize (void)
MikMod_RegisterAllLoaders();
if (S_MIKMOD_initlib(NULL))
{
Con_DPrintf("Could not initialize MikMod: %s\n", MikMod_strerror(MikMod_errno));
console::debug("Could not initialize MikMod: %s\n", MikMod_strerror(MikMod_errno));
return false;
}
@@ -145,7 +145,7 @@ static bool S_MIKMOD_CodecOpenStream (snd_stream_t *stream)
priv->module = Player_LoadGeneric((MREADER *)stream->priv, 64, 0);
if (!priv->module)
{
Con_DPrintf("Could not load module: %s\n", MikMod_strerror(MikMod_errno));
console::debug("Could not load module: %s\n", MikMod_strerror(MikMod_errno));
Z_Free(stream->priv);
return false;
}
@@ -166,7 +166,7 @@ static bool S_MIKMOD_CodecOpenStream (snd_stream_t *stream)
stream->info.bits = (md_mode & DMODE_16BITS)? 16: 8;
stream->info.width = stream->info.bits / 8;
stream->info.channels = (md_mode & DMODE_STEREO)? 2 : 1;
/* Con_DPrintf("Playing %s (%d chn)\n", priv->module->songname, priv->module->numchn);*/
/* console::debug("Playing %s (%d chn)\n", priv->module->songname, priv->module->numchn);*/
return true;
}
+2 -2
View File
@@ -435,9 +435,9 @@ void S_PaintChannels (int endtime)
paintbuffer[i - paintedtime].right += s_rawsamples[s].right / 2;
}
// if (i != end)
// Con_Printf ("partial stream\n");
// console::info ("partial stream\n");
// else
// Con_Printf ("full stream\n");
// console::info ("full stream\n");
}
// transfer out according to DMA format
+1 -1
View File
@@ -74,7 +74,7 @@ static bool S_MODPLUG_CodecOpenStream (snd_stream_t *stream)
Hunk_FreeToLowMark(mark); /* free original file data */
if (!stream->priv)
{
Con_DPrintf("Could not load module %s\n", stream->name);
console::debug("Could not load module %s\n", stream->name);
return false;
}
+12 -12
View File
@@ -139,7 +139,7 @@ static int mp3_startread(snd_stream_t *stream)
if (p->Stream.error)
{
Con_Printf("MP3: No valid MP3 frame found\n");
console::info("MP3: No valid MP3 frame found\n");
return -1;
}
@@ -152,7 +152,7 @@ static int mp3_startread(snd_stream_t *stream)
stream->info.channels = MAD_NCHANNELS(&p->Frame.header);
break;
default:
Con_Printf("MP3: Cannot determine number of channels\n");
console::info("MP3: Cannot determine number of channels\n");
return -1;
}
@@ -225,7 +225,7 @@ static int mp3_decode(snd_stream_t *stream, byte *buf, int len)
if (mp3_inputdata(stream) == -1)
{
/* check feof() ?? */
Con_DPrintf("mp3 EOF\n");
console::debug("mp3 EOF\n");
break;
}
}
@@ -243,7 +243,7 @@ static int mp3_decode(snd_stream_t *stream, byte *buf, int len)
continue;
else
{
Con_Printf("MP3: unrecoverable frame level error (%s)\n",
console::info("MP3: unrecoverable frame level error (%s)\n",
mad_stream_errorstr(&p->Stream));
break;
}
@@ -305,7 +305,7 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
MP3_BUFFER_SIZE - leftover, &stream->fh);
if (bytes_read <= 0)
{
Con_DPrintf("seek failure. unexpected EOF (frames=%lu leftover=%lu)\n",
console::debug("seek failure. unexpected EOF (frames=%lu leftover=%lu)\n",
(unsigned long)p->FrameCount, (unsigned long)leftover);
break;
}
@@ -326,16 +326,16 @@ static int mp3_madseek(snd_stream_t *stream, unsigned long offset)
break; /* Normal behaviour; get some more data from the file */
if (!MAD_RECOVERABLE(p->Stream.error))
{
Con_DPrintf("unrecoverable MAD error\n");
console::debug("unrecoverable MAD error\n");
break;
}
if (p->Stream.error == MAD_ERROR_LOSTSYNC)
{
Con_DPrintf("MAD lost sync\n");
console::debug("MAD lost sync\n");
}
else
{
Con_DPrintf("recoverable MAD error\n");
console::debug("recoverable MAD error\n");
}
continue;
}
@@ -391,24 +391,24 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
if (mp3_skiptags(stream) < 0)
{
Con_Printf("Corrupt mp3 file (bad tags.)\n");
console::info("Corrupt mp3 file (bad tags.)\n");
return false;
}
stream->priv = calloc(1, sizeof(mp3_priv_t));
if (!stream->priv)
{
Con_Printf("Insufficient memory for MP3 audio\n");
console::info("Insufficient memory for MP3 audio\n");
return false;
}
err = mp3_startread(stream);
if (err != 0)
{
Con_Printf("%s is not a valid mp3 file\n", stream->name);
console::info("%s is not a valid mp3 file\n", stream->name);
}
else if (stream->info.channels != 1 && stream->info.channels != 2)
{
Con_Printf("Unsupported number of channels %d in %s\n",
console::info("Unsupported number of channels %d in %s\n",
stream->info.channels, stream->name);
}
else
+7 -7
View File
@@ -251,7 +251,7 @@ static int probe_id3v1(snd_stream_t *stream, unsigned char *buf, int atend) {
}
}
stream->fh.length -= 128;
Con_DPrintf("MP3: skipped %ld bytes ID3v1 tag\n", 128L);
console::debug("MP3: skipped %ld bytes ID3v1 tag\n", 128L);
return 1;
/* FIXME: handle possible double-ID3v1 tags? */
}
@@ -269,7 +269,7 @@ static int probe_mmtag(snd_stream_t *stream, unsigned char *buf) {
if (len < 0) return -1;
if (len >= stream->fh.length) return -1;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes MusicMatch tag\n", len);
console::debug("MP3: skipped %ld bytes MusicMatch tag\n", len);
return 1;
}
}
@@ -285,7 +285,7 @@ static int probe_apetag(snd_stream_t *stream, unsigned char *buf) {
len = get_ape_len(buf);
if (len >= stream->fh.length) return -1;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes APE tag\n", len);
console::debug("MP3: skipped %ld bytes APE tag\n", len);
return 1;
}
}
@@ -307,14 +307,14 @@ static int probe_lyrics3(snd_stream_t *stream, unsigned char *buf) {
return -1;
if (!verify_lyrics3v2(buf, 11)) return -1;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len);
console::debug("MP3: skipped %ld bytes Lyrics3 tag\n", len);
return 1;
}
else if (len == 1) {
len = get_lyrics3v1_len(stream);
if (len < 0) return -1;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes Lyrics3 tag\n", len);
console::debug("MP3: skipped %ld bytes Lyrics3 tag\n", len);
return 1;
}
}
@@ -348,7 +348,7 @@ int mp3_skiptags(snd_stream_t *stream)
if (len >= stream->fh.length) goto fail;
stream->fh.start += len;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes ID3v2 tag\n", len);
console::debug("MP3: skipped %ld bytes ID3v2 tag\n", len);
}
/* APE tag _might_ be at the start (discouraged
* but not forbidden, either.) read the header. */
@@ -357,7 +357,7 @@ int mp3_skiptags(snd_stream_t *stream)
if (len >= stream->fh.length) goto fail;
stream->fh.start += len;
stream->fh.length -= len;
Con_DPrintf("MP3: skipped %ld bytes APE tag\n", len);
console::debug("MP3: skipped %ld bytes APE tag\n", len);
}
/* it's not impossible that _old_ MusicMatch tag
+8 -8
View File
@@ -61,7 +61,7 @@ static bool S_MP3_CodecInitialize (void)
{
if (mpg123_init() != MPG123_OK)
{
Con_Printf ("Could not initialize mpg123\n");
console::info ("Could not initialize mpg123\n");
return false;
}
mp3_codec.initialized = true;
@@ -86,7 +86,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
if (mp3_skiptags(stream) < 0)
{
Con_Printf("Corrupt mp3 file (bad tags.)\n");
console::info("Corrupt mp3 file (bad tags.)\n");
return false;
}
@@ -95,21 +95,21 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
priv->handle = mpg123_new(NULL, NULL);
if (priv->handle == NULL)
{
Con_Printf("Unable to allocate mpg123 handle\n");
console::info("Unable to allocate mpg123 handle\n");
goto _fail;
}
if (mpg123_replace_reader_handle(priv->handle, mp3_read, mp3_seek, NULL) != MPG123_OK ||
mpg123_open_handle(priv->handle, &stream->fh) != MPG123_OK)
{
Con_Printf("Unable to open mpg123 handle\n");
console::info("Unable to open mpg123 handle\n");
goto _fail;
}
priv->handle_open = 1;
if (mpg123_getformat(priv->handle, &rate, &channels, &encoding) != MPG123_OK)
{
Con_Printf("Unable to retrieve mpg123 format for %s\n", stream->name);
console::info("Unable to retrieve mpg123 format for %s\n", stream->name);
goto _fail;
}
@@ -121,7 +121,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
stream->info.channels = 2;
break;
default:
Con_Printf("Unsupported number of channels %d in %s\n", channels, stream->name);
console::info("Unsupported number of channels %d in %s\n", channels, stream->name);
goto _fail;
}
@@ -152,7 +152,7 @@ static bool S_MP3_CodecOpenStream (snd_stream_t *stream)
}
if (mpg123_format_support(priv->handle, rate, encoding) == 0)
{
Con_Printf("Unsupported format for %s\n", stream->name);
console::info("Unsupported format for %s\n", stream->name);
goto _fail;
}
mpg123_format_none(priv->handle);
@@ -180,7 +180,7 @@ static int S_MP3_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer)
int res = mpg123_read (priv->handle, (unsigned char *)buffer, (size_t)bytes, &bytes_read);
switch (res) {
case MPG123_DONE:
Con_DPrintf("mp3 EOF\n");
console::debug("mp3 EOF\n");
case MPG123_OK:
return (int)bytes_read;
}
+5 -5
View File
@@ -93,7 +93,7 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
opFile = op_open_callbacks(&stream->fh, &opc_qfs, NULL, 0, &res);
if (!opFile)
{
Con_Printf("%s is not a valid Opus file (error %i).\n",
console::info("%s is not a valid Opus file (error %i).\n",
stream->name, res);
goto _fail;
}
@@ -102,14 +102,14 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
if (!op_seekable(opFile))
{
Con_Printf("Opus stream %s not seekable.\n", stream->name);
console::info("Opus stream %s not seekable.\n", stream->name);
goto _fail;
}
op_info = op_head(opFile, -1);
if (!op_info)
{
Con_Printf("Unable to get stream information for %s.\n", stream->name);
console::info("Unable to get stream information for %s.\n", stream->name);
goto _fail;
}
@@ -117,14 +117,14 @@ static bool S_OPUS_CodecOpenStream (snd_stream_t *stream)
numstreams = op_info->stream_count;
if (numstreams != 1)
{
Con_Printf("More than one (%ld) stream in %s\n",
console::info("More than one (%ld) stream in %s\n",
(long)op_info->stream_count, stream->name);
goto _fail;
}
if (op_info->channel_count != 1 && op_info->channel_count != 2)
{
Con_Printf("Unsupported number of channels %d in %s\n",
console::info("Unsupported number of channels %d in %s\n",
op_info->channel_count, stream->name);
goto _fail;
}
+6 -6
View File
@@ -86,7 +86,7 @@ bool SNDDMA_Init (dma_t *dma)
if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0)
{
Con_Printf("Couldn't init SDL audio: %s\n", SDL_GetError());
console::info("Couldn't init SDL audio: %s\n", SDL_GetError());
return false;
}
@@ -110,7 +110,7 @@ bool SNDDMA_Init (dma_t *dma)
/* Open the audio device */
if (SDL_OpenAudio(&desired, NULL) == -1)
{
Con_Printf("Couldn't open SDL audio: %s\n", SDL_GetError());
console::info("Couldn't open SDL audio: %s\n", SDL_GetError());
SDL_QuitSubSystem(SDL_INIT_AUDIO);
return false;
}
@@ -139,7 +139,7 @@ bool SNDDMA_Init (dma_t *dma)
shm->samplepos = 0;
shm->submission_chunk = 1;
Con_Printf ("SDL audio spec : %d Hz, %d samples, %d channels\n",
console::info ("SDL audio spec : %d Hz, %d samples, %d channels\n",
desired.freq, desired.samples, desired.channels);
#if defined(USE_SDL2)
{
@@ -154,7 +154,7 @@ bool SNDDMA_Init (dma_t *dma)
strcpy(drivername, "(UNKNOWN)");
#endif
buffersize = shm->samples * (shm->samplebits / 8);
Con_Printf ("SDL audio driver: %s, %d bytes buffer\n", drivername, buffersize);
console::info ("SDL audio driver: %s, %d bytes buffer\n", drivername, buffersize);
shm->buffer = (unsigned char *) calloc (1, buffersize);
if (!shm->buffer)
@@ -162,7 +162,7 @@ bool SNDDMA_Init (dma_t *dma)
SDL_CloseAudio();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
shm = NULL;
Con_Printf ("Failed allocating memory for SDL audio\n");
console::info ("Failed allocating memory for SDL audio\n");
return false;
}
@@ -180,7 +180,7 @@ void SNDDMA_Shutdown (void)
{
if (shm)
{
Con_Printf ("Shutting down SDL sound\n");
console::info ("Shutting down SDL sound\n");
SDL_CloseAudio();
SDL_QuitSubSystem(SDL_INIT_AUDIO);
if (shm->buffer)
+6 -6
View File
@@ -234,7 +234,7 @@ static int probe_umx (fshandle_t *f, const struct upkg_hdr *hdr,
if (hdr->name_offset >= fsiz ||
hdr->export_offset >= fsiz ||
hdr->import_offset >= fsiz) {
Con_DPrintf("Illegal values in header.\n");
console::debug("Illegal values in header.\n");
return -1;
}
@@ -292,7 +292,7 @@ static int32_t probe_header (fshandle_t *f, struct upkg_hdr *hdr)
hdr->import_offset = LittleLong(hdr->import_offset);
if (hdr->tag != UPKG_HDR_TAG) {
Con_DPrintf("Unknown header tag 0x%x\n", hdr->tag);
console::debug("Unknown header tag 0x%x\n", hdr->tag);
return -1;
}
if (hdr->name_count < 0 ||
@@ -301,7 +301,7 @@ static int32_t probe_header (fshandle_t *f, struct upkg_hdr *hdr)
hdr->name_offset < 36 ||
hdr->export_offset < 36 ||
hdr->import_offset < 36) {
Con_DPrintf("Illegal values in header.\n");
console::debug("Illegal values in header.\n");
return -1;
}
@@ -324,7 +324,7 @@ static int32_t probe_header (fshandle_t *f, struct upkg_hdr *hdr)
return 0;
}
Con_DPrintf("Unknown upkg version %d\n", hdr->file_version);
console::debug("Unknown upkg version %d\n", hdr->file_version);
return -1;
#endif /* #if 0 */
}
@@ -356,11 +356,11 @@ static bool S_UMX_CodecOpenStream (snd_stream_t *stream)
type = process_upkg(&stream->fh, &ofs, &size);
if (type < 0) {
Con_DPrintf("%s: unrecognized umx\n", stream->name);
console::debug("%s: unrecognized umx\n", stream->name);
return false;
}
Con_DPrintf("%s: %s data @ 0x%x, %d bytes\n", stream->name, mustype[type], ofs, size);
console::debug("%s: %s data @ 0x%x, %d bytes\n", stream->name, mustype[type], ofs, size);
/* hack the fshandle_t start pos and length members so
* that only the relevant data is accessed from now on */
stream->fh.start += ofs;
+5 -5
View File
@@ -85,21 +85,21 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream)
res = ov_open_callbacks(&stream->fh, ovFile, NULL, 0, ovc_qfs);
if (res != 0)
{
Con_Printf("%s is not a valid Ogg Vorbis file (error %i).\n",
console::info("%s is not a valid Ogg Vorbis file (error %i).\n",
stream->name, res);
goto _fail;
}
if (!ov_seekable(ovFile))
{
Con_Printf("Stream %s not seekable.\n", stream->name);
console::info("Stream %s not seekable.\n", stream->name);
goto _fail;
}
ovf_info = ov_info(ovFile, 0);
if (!ovf_info)
{
Con_Printf("Unable to get stream info for %s.\n", stream->name);
console::info("Unable to get stream info for %s.\n", stream->name);
goto _fail;
}
@@ -107,14 +107,14 @@ static bool S_VORBIS_CodecOpenStream (snd_stream_t *stream)
numstreams = ov_streams(ovFile);
if (numstreams != 1)
{
Con_Printf("More than one (%ld) stream in %s.\n",
console::info("More than one (%ld) stream in %s.\n",
numstreams, stream->name);
goto _fail;
}
if (ovf_info->channels != 1 && ovf_info->channels != 2)
{
Con_Printf("Unsupported number of channels %d in %s\n",
console::info("Unsupported number of channels %d in %s\n",
ovf_info->channels, stream->name);
goto _fail;
}
+9 -9
View File
@@ -72,7 +72,7 @@ static int WAV_ReadChunkInfo(FILE *f, char *name)
len = FGetLittleLong(f);
if (len < 0)
{
Con_Printf("WAV: Negative chunk length\n");
console::info("WAV: Negative chunk length\n");
return -1;
}
@@ -120,14 +120,14 @@ static bool WAV_ReadRIFFHeader(const char *name, FILE *file, snd_info_t *info)
strncmp(dump, "RIFF", 4) != 0 ||
strncmp(&dump[8], "WAVE", 4) != 0)
{
Con_Printf("%s is missing RIFF/WAVE chunks\n", name);
console::info("%s is missing RIFF/WAVE chunks\n", name);
return false;
}
/* Scan for the format chunk */
if ((fmtlen = WAV_FindRIFFChunk(file, "fmt ")) < 0)
{
Con_Printf("%s is missing fmt chunk\n", name);
console::info("%s is missing fmt chunk\n", name);
return false;
}
@@ -135,7 +135,7 @@ static bool WAV_ReadRIFFHeader(const char *name, FILE *file, snd_info_t *info)
wav_format = FGetLittleShort(file);
if (wav_format != WAV_FORMAT_PCM)
{
Con_Printf("%s is not Microsoft PCM format\n", name);
console::info("%s is not Microsoft PCM format\n", name);
return false;
}
@@ -147,7 +147,7 @@ static bool WAV_ReadRIFFHeader(const char *name, FILE *file, snd_info_t *info)
if (info->bits != 8 && info->bits != 16)
{
Con_Printf("%s is not 8 or 16 bit\n", name);
console::info("%s is not 8 or 16 bit\n", name);
return false;
}
@@ -164,20 +164,20 @@ static bool WAV_ReadRIFFHeader(const char *name, FILE *file, snd_info_t *info)
/* Scan for the data chunk */
if ((info->size = WAV_FindRIFFChunk(file, "data")) < 0)
{
Con_Printf("%s is missing data chunk\n", name);
console::info("%s is missing data chunk\n", name);
return false;
}
if (info->channels != 1 && info->channels != 2)
{
Con_Printf("Unsupported number of channels %d in %s\n",
console::info("Unsupported number of channels %d in %s\n",
info->channels, name);
return false;
}
info->samples = (info->size / info->width) / info->channels;
if (info->samples == 0)
{
Con_Printf("%s has zero samples\n", name);
console::info("%s has zero samples\n", name);
return false;
}
@@ -203,7 +203,7 @@ static bool S_WAV_CodecOpenStream(snd_stream_t *stream)
stream->fh.start = ftell(stream->fh.file); /* reset to data position */
if (stream->fh.start - start + stream->info.size > stream->fh.length)
{
Con_Printf("%s data size mismatch\n", stream->name);
console::info("%s data size mismatch\n", stream->name);
return false;
}
+3 -3
View File
@@ -84,7 +84,7 @@ static bool S_XMP_CodecOpenStream (snd_stream_t *stream)
#if (XMP_VERCODE >= 0x040500)
if (xmp_load_module_from_callbacks(c, &stream->fh, file_callbacks) < 0) {
Con_DPrintf("Could not load module %s\n", stream->name);
console::debug("Could not load module %s\n", stream->name);
goto err1;
}
#else
@@ -94,7 +94,7 @@ static bool S_XMP_CodecOpenStream (snd_stream_t *stream)
FS_fread(moddata, 1, len, &stream->fh);
if (xmp_load_module_from_memory(c, moddata, len) < 0) {
Hunk_FreeToLowMark(mark);
Con_DPrintf("Could not load module %s\n", stream->name);
console::debug("Could not load module %s\n", stream->name);
goto err1;
}
Hunk_FreeToLowMark(mark); /* free original file data */
@@ -141,7 +141,7 @@ static int S_XMP_CodecReadStream (snd_stream_t *stream, int bytes, void *buffer)
return bytes;
}
if (r == -XMP_END) {
Con_DPrintf("XMP EOF\n");
console::debug("XMP EOF\n");
return 0;
}
return -1;
+14 -14
View File
@@ -47,20 +47,20 @@ void SV_Protocol_f(void) {
switch (command::argc()) {
case 1:
Con_Printf("\"sv_protocol\" is \"%i\"\n", sv_protocol);
console::info("\"sv_protocol\" is \"%i\"\n", sv_protocol);
break;
case 2:
i = atoi(command::argv(1)->c_str());
if (i != PROTOCOL_NETQUAKE && i != PROTOCOL_FITZQUAKE && i != PROTOCOL_RMQ)
Con_Printf("sv_protocol must be %i or %i or %i\n", PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
console::info("sv_protocol must be %i or %i or %i\n", PROTOCOL_NETQUAKE, PROTOCOL_FITZQUAKE, PROTOCOL_RMQ);
else {
sv_protocol = i;
if (sv.active)
Con_Printf("changes will not take effect until the next level load.\n");
console::info("changes will not take effect until the next level load.\n");
}
break;
default:
Con_SafePrintf("usage: sv_protocol <protocol>\n");
console::safe_print("usage: sv_protocol <protocol>\n");
break;
}
}
@@ -202,7 +202,7 @@ void SV_StartSound(edict_t *entity, int channel, const char *sample, int volume,
}
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
Con_Printf("SV_StartSound: %s not precached\n", sample);
console::info("SV_StartSound: %s not precached\n", sample);
return;
}
@@ -268,7 +268,7 @@ void SV_LocalSound(client_t *client, const char *sample) {
break;
}
if (sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num]) {
Con_Printf("SV_LocalSound: %s not precached\n", sample);
console::info("SV_LocalSound: %s not precached\n", sample);
return;
}
@@ -383,7 +383,7 @@ void SV_ConnectClient(int clientnum) {
client = svs.clients + clientnum;
Con_DPrintf("Client %s connected\n", NET_QSocketGetAddressString(client->netconnection));
console::debug("Client %s connected\n", NET_QSocketGetAddressString(client->netconnection));
edictnum = clientnum + 1;
@@ -619,7 +619,7 @@ void SV_WriteEntitiesToClient(edict_t *clent, sizebuf_t *msg) {
if (msg->cursize + 40 > msg->maxsize) {
//johnfitz -- less spammy overflow message
if (!dev_overflows.packetsize || dev_overflows.packetsize + CONSOLE_RESPAM_TIME < realtime) {
Con_Printf("Packet overflow!\n");
console::info("Packet overflow!\n");
dev_overflows.packetsize = realtime;
}
goto stats;
@@ -759,7 +759,7 @@ void SV_WriteEntitiesToClient(edict_t *clent, sizebuf_t *msg) {
//johnfitz -- devstats
stats:
if (msg->cursize > 1024 && dev_peakstats.packetsize <= 1024)
Con_DWarning("%i byte packet exceeds standard limit of 1024 (max = %d).\n", msg->cursize, msg->maxsize);
console::dev_warn("%i byte packet exceeds standard limit of 1024 (max = %d).\n", msg->cursize, msg->maxsize);
dev_stats.packetsize = msg->cursize;
dev_peakstats.packetsize = std::max(msg->cursize, dev_peakstats.packetsize);
//johnfitz
@@ -1380,7 +1380,7 @@ void SV_SpawnServer(const char *server) {
convar::set("hostname", "UNNAMED");
scr_centertime_off = 0;
Con_DPrintf("SpawnServer: %s\n", server);
console::debug("SpawnServer: %s\n", server);
svs.changelevel_issued = false; // now safe to issue another
//
@@ -1454,7 +1454,7 @@ void SV_SpawnServer(const char *server) {
q_snprintf(sv.modelname, sizeof(sv.modelname), "maps/%s.bsp", server);
sv.worldmodel = Mod_ForName(sv.modelname, false);
if (!sv.worldmodel) {
Con_Printf("Couldn't spawn server %s\n", sv.modelname);
console::info("Couldn't spawn server %s\n", sv.modelname);
sv.active = false;
return;
}
@@ -1513,10 +1513,10 @@ void SV_SpawnServer(const char *server) {
for (i = 0, signonsize = 0; i < sv.num_signon_buffers; i++)
signonsize += sv.signon_buffers[i]->cursize;
if (signonsize > 64000 - 2)
Con_DWarning("%i byte signon buffer exceeds QS limit of 63998.\n", signonsize);
console::dev_warn("%i byte signon buffer exceeds QS limit of 63998.\n", signonsize);
else if (signonsize > 8000 - 2)
//max size that will fit into 8000-sized client->message buffer with 2 extra bytes on the end
Con_DWarning("%i byte signon buffer exceeds standard limit of 7998.\n", signonsize);
console::dev_warn("%i byte signon buffer exceeds standard limit of 7998.\n", signonsize);
//johnfitz
// send serverinfo to all connected clients
@@ -1524,5 +1524,5 @@ void SV_SpawnServer(const char *server) {
if (host_client->active)
SV_SendServerinfo(host_client);
Con_DPrintf("Server spawned.\n");
console::debug("Server spawned.\n");
}
+3 -3
View File
@@ -183,7 +183,7 @@ bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
if (relink)
SV_LinkEdict (ent, true);
ent->v.flags = (int)ent->v.flags & ~FL_ONGROUND;
// Con_Printf ("fall down\n");
// console::info ("fall down\n");
return true;
}
@@ -208,7 +208,7 @@ bool SV_movestep (edict_t *ent, vec3_t move, bool relink)
if ( (int)ent->v.flags & FL_PARTIALGROUND )
{
// Con_Printf ("back on ground\n");
// console::info ("back on ground\n");
ent->v.flags = (int)ent->v.flags & ~FL_PARTIALGROUND;
}
ent->v.groundentity = EDICT_TO_PROG(trace.ent);
@@ -269,7 +269,7 @@ SV_FixCheckBottom
*/
void SV_FixCheckBottom (edict_t *ent)
{
// Con_Printf ("SV_FixCheckBottom\n");
// console::info ("SV_FixCheckBottom\n");
ent->v.flags = (int)ent->v.flags | FL_PARTIALGROUND;
}
+8 -8
View File
@@ -75,7 +75,7 @@ void SV_CheckAllEnts (void)
continue;
if (SV_TestEntityPosition (check))
Con_Printf ("entity in invalid position\n");
console::info ("entity in invalid position\n");
}
}
@@ -95,12 +95,12 @@ void SV_CheckVelocity (edict_t *ent)
{
if (IS_NAN(ent->v.velocity[i]))
{
Con_Printf ("Got a NaN velocity on %s\n", PR_GetString(ent->v.classname));
console::info ("Got a NaN velocity on %s\n", PR_GetString(ent->v.classname));
ent->v.velocity[i] = 0;
}
if (IS_NAN(ent->v.origin[i]))
{
Con_Printf ("Got a NaN origin on %s\n", PR_GetString(ent->v.classname));
console::info ("Got a NaN origin on %s\n", PR_GetString(ent->v.classname));
ent->v.origin[i] = 0;
}
if (ent->v.velocity[i] > sv_maxvelocity.value)
@@ -340,7 +340,7 @@ int SV_FlyMove (edict_t *ent, float time, trace_t *steptrace)
{ // go along the crease
if (numplanes != 2)
{
// Con_Printf ("clip velocity, numplanes == %i\n",numplanes);
// console::info ("clip velocity, numplanes == %i\n",numplanes);
VectorCopy (vec3_origin, ent->v.velocity);
return 7;
}
@@ -630,7 +630,7 @@ void SV_CheckStuck (edict_t *ent)
VectorCopy (ent->v.oldorigin, ent->v.origin);
if (!SV_TestEntityPosition(ent))
{
Con_DPrintf ("Unstuck.\n");
console::debug ("Unstuck.\n");
SV_LinkEdict (ent, true);
return;
}
@@ -644,14 +644,14 @@ void SV_CheckStuck (edict_t *ent)
ent->v.origin[2] = org[2] + z;
if (!SV_TestEntityPosition(ent))
{
Con_DPrintf ("Unstuck.\n");
console::debug ("Unstuck.\n");
SV_LinkEdict (ent, true);
return;
}
}
VectorCopy (org, ent->v.origin);
Con_DPrintf ("player is stuck.\n");
console::debug ("player is stuck.\n");
}
@@ -768,7 +768,7 @@ int SV_TryUnstick (edict_t *ent, vec3_t oldvel)
if ( fabs(oldorg[1] - ent->v.origin[1]) > 4
|| fabs(oldorg[0] - ent->v.origin[0]) > 4 )
{
// Con_DPrintf ("unstuck!\n");
// console::debug ("unstuck!\n");
return clip;
}
+1 -1
View File
@@ -572,7 +572,7 @@ nextmsg:
if (ret == 1)
command::execute_string (s, command::source::client);
else
Con_DPrintf("%s tried to %s\n", host_client->name, s);
console::debug("%s tried to %s\n", host_client->name, s);
break;
case clc_disconnect:
+3 -3
View File
@@ -125,7 +125,7 @@ float V_CalcBob(void) {
// (don't count Z, or jumping messes it up)
bob = sqrt(cl.velocity[0] * cl.velocity[0] + cl.velocity[1] * cl.velocity[1]) * cl_bob.value;
//Con_Printf ("speed: %5.1f\n", VectorLength(cl.velocity));
//console::info ("speed: %5.1f\n", VectorLength(cl.velocity));
bob = bob * 0.3 + bob * 0.7 * sin(cycle);
if (bob > 4)
bob = 4;
@@ -209,7 +209,7 @@ void V_DriftPitch(void) {
move = host_frametime * cl.pitchvel;
cl.pitchvel += host_frametime * v_centerspeed.value;
//Con_Printf ("move: %f (%f)\n", move, host_frametime);
//console::info ("move: %f (%f)\n", move, host_frametime);
if (delta > 0) {
if (move > delta) {
@@ -842,7 +842,7 @@ the entity origin, so any view position inside that will be valid
extern vrect_t scr_vrect;
void V_RenderView(void) {
if (con_forcedup)
if (console::forced_up)
return;
if (cl.intermission)
+1 -1
View File
@@ -125,7 +125,7 @@ lumpinfo_t *W_GetLumpinfo (const char *name)
return lump_p;
}
Con_SafePrintf ("W_GetLumpinfo: %s not found\n", name); //johnfitz -- was Sys_Error
console::safe_print ("W_GetLumpinfo: %s not found\n", name); //johnfitz -- was Sys_Error
return NULL;
}
+2 -2
View File
@@ -686,7 +686,7 @@ bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t
if (SV_HullPointContents (sv_hullmodel, mid, node->children[side])
== CONTENTS_SOLID)
{
Con_Printf ("mid PointInHullSolid\n");
console::info ("mid PointInHullSolid\n");
return false;
}
#endif
@@ -721,7 +721,7 @@ bool SV_RecursiveHullCheck (hull_t *hull, int num, float p1f, float p2f, vec3_t
{
trace->fraction = midf;
VectorCopy (mid, trace->endpos);
Con_DPrintf ("backup past 0\n");
console::debug ("backup past 0\n");
return false;
}
midf = p1f + (p2f - p1f)*frac;
+19 -19
View File
@@ -265,21 +265,21 @@ void Z_Print (memzone_t *zone)
{
memblock_t *block;
Con_Printf ("zone size: %i location: %p\n",mainzone->size,mainzone);
console::info ("zone size: %i location: %p\n",mainzone->size,mainzone);
for (block = zone->blocklist.next ; ; block = block->next)
{
Con_Printf ("block:%p size:%7i tag:%3i\n",
console::info ("block:%p size:%7i tag:%3i\n",
block, block->size, block->tag);
if (block->next == &zone->blocklist)
break; // all blocks have been hit
if ( (byte *)block + block->size != (byte *)block->next)
Con_Printf ("ERROR: block size does not touch the next block\n");
console::info ("ERROR: block size does not touch the next block\n");
if ( block->next->prev != block)
Con_Printf ("ERROR: next block doesn't have proper back link\n");
console::info ("ERROR: next block doesn't have proper back link\n");
if (!block->tag && !block->next->tag)
Con_Printf ("ERROR: two consecutive free blocks\n");
console::info ("ERROR: two consecutive free blocks\n");
}
}
@@ -350,8 +350,8 @@ void Hunk_Print (bool all)
starthigh = (hunk_t *)(hunk_base + hunk_size - hunk_high_used);
endhigh = (hunk_t *)(hunk_base + hunk_size);
Con_Printf (" :%8i total hunk size\n", hunk_size);
Con_Printf ("-------------------------\n");
console::info (" :%8i total hunk size\n", hunk_size);
console::info ("-------------------------\n");
while (1)
{
@@ -360,9 +360,9 @@ void Hunk_Print (bool all)
//
if ( h == endlow )
{
Con_Printf ("-------------------------\n");
Con_Printf (" :%8i REMAINING\n", hunk_size - hunk_low_used - hunk_high_used);
Con_Printf ("-------------------------\n");
console::info ("-------------------------\n");
console::info (" :%8i REMAINING\n", hunk_size - hunk_low_used - hunk_high_used);
console::info ("-------------------------\n");
h = starthigh;
}
@@ -390,7 +390,7 @@ void Hunk_Print (bool all)
//
memcpy (name, h->name, HUNKNAME_LEN);
if (all)
Con_Printf ("%8p :%8i %8s\n",h, h->size, name);
console::info ("%8p :%8i %8s\n",h, h->size, name);
//
// print the total
@@ -399,7 +399,7 @@ void Hunk_Print (bool all)
strncmp (h->name, next->name, HUNKNAME_LEN - 1))
{
if (!all)
Con_Printf (" :%8i %8s (TOTAL)\n",sum, name);
console::info (" :%8i %8s (TOTAL)\n",sum, name);
count = 0;
sum = 0;
}
@@ -407,8 +407,8 @@ void Hunk_Print (bool all)
h = next;
}
Con_Printf ("-------------------------\n");
Con_Printf ("%8i total blocks\n", totalblocks);
console::info ("-------------------------\n");
console::info ("%8i total blocks\n", totalblocks);
}
@@ -531,7 +531,7 @@ void *Hunk_HighAllocName (int size, const char *name)
if (hunk_size - hunk_low_used - hunk_high_used < size)
{
Con_Printf ("Hunk_HighAlloc: failed on %i bytes\n",size);
console::info ("Hunk_HighAlloc: failed on %i bytes\n",size);
return NULL;
}
@@ -620,7 +620,7 @@ void Cache_Move ( cache_system_t *c)
new_cs = Cache_TryAlloc (c->size, true);
if (new_cs)
{
// Con_Printf ("cache_move ok\n");
// console::info ("cache_move ok\n");
std::memcpy ( new_cs+1, c+1, c->size - sizeof(cache_system_t) );
new_cs->user = c->user;
@@ -630,7 +630,7 @@ void Cache_Move ( cache_system_t *c)
}
else
{
// Con_Printf ("cache_move failed\n");
// console::info ("cache_move failed\n");
Cache_Free (c->user, true); // tough luck... //johnfitz -- added second argument
}
@@ -814,7 +814,7 @@ void Cache_Print (void)
for (cd = cache_head.next ; cd != &cache_head ; cd = cd->next)
{
Con_Printf ("%8i : %s\n", cd->size, cd->name);
console::info ("%8i : %s\n", cd->size, cd->name);
}
}
@@ -826,7 +826,7 @@ Cache_Report
*/
void Cache_Report (void)
{
Con_DPrintf ("%4.1f megabyte data cache\n", (hunk_size - hunk_high_used - hunk_low_used) / (float)(1024*1024) );
console::debug ("%4.1f megabyte data cache\n", (hunk_size - hunk_high_used - hunk_low_used) / (float)(1024*1024) );
}
/*