From 26b7776f437d962d7d4be561db1530d2fa249dcf Mon Sep 17 00:00:00 2001 From: GravisZro Date: Thu, 23 May 2024 23:07:26 -0400 Subject: [PATCH] Replace "ubyte" with "uint8_t" --- 2dlib/font.cpp | 34 +- 2dlib/pentext.cpp | 12 +- 2dlib/surface.cpp | 8 +- Descent3/AIGoal.cpp | 4 +- Descent3/AIGoal.h | 4 +- Descent3/AIMain.h | 4 +- Descent3/AImain.cpp | 6 +- Descent3/BOA.cpp | 10 +- Descent3/Controls.cpp | 4 +- Descent3/CtlCfgElem.cpp | 34 +- Descent3/CtlCfgElem.h | 8 +- Descent3/Game2DLL.cpp | 8 +- Descent3/GameCheat.cpp | 8 +- Descent3/GameLoop.cpp | 2 +- Descent3/LoadLevel.cpp | 98 +-- Descent3/Mission.h | 6 +- Descent3/OsirisLoadandBind.cpp | 46 +- Descent3/PilotPicsAPI.cpp | 42 +- Descent3/Player.cpp | 6 +- Descent3/TelCom.cpp | 14 +- Descent3/TelCom.h | 6 +- Descent3/TelComAutoMap.cpp | 12 +- Descent3/TelComAutoMap.h | 2 +- Descent3/TelComCargo.cpp | 2 +- Descent3/TelComEffects.h | 10 +- Descent3/TelComEfxStructs.h | 4 +- Descent3/TelComGoals.cpp | 4 +- Descent3/TelcomEffectsRender.cpp | 8 +- Descent3/TerrainSearch.cpp | 14 +- Descent3/WeaponFire.cpp | 8 +- Descent3/aistruct.h | 10 +- Descent3/aiterrain.cpp | 2 +- Descent3/ambient.cpp | 2 +- Descent3/audiotaunts.cpp | 14 +- Descent3/bsp.cpp | 10 +- Descent3/bsp.h | 8 +- Descent3/buddymenu.cpp | 14 +- Descent3/config.h | 6 +- Descent3/credits.cpp | 2 +- Descent3/ctlconfig.cpp | 12 +- Descent3/debuggraph.cpp | 2 +- Descent3/demofile.cpp | 38 +- Descent3/difficulty.h | 2 +- Descent3/door.h | 6 +- Descent3/doorway.h | 6 +- Descent3/fireball.cpp | 14 +- Descent3/fireball.h | 10 +- Descent3/game.h | 2 +- Descent3/gamecinematics.cpp | 72 +-- Descent3/gamecinematics.h | 2 +- Descent3/gameevent.h | 2 +- Descent3/gamefile.h | 2 +- Descent3/gamepath.h | 2 +- Descent3/gamesave.cpp | 36 +- Descent3/gamesave.h | 2 +- Descent3/gamesequence.cpp | 6 +- Descent3/gametexture.h | 26 +- Descent3/gauges.cpp | 20 +- Descent3/hotspotmap.cpp | 4 +- Descent3/hud.cpp | 38 +- Descent3/hud.h | 16 +- Descent3/huddisplay.cpp | 14 +- Descent3/hudmessage.cpp | 6 +- Descent3/init.cpp | 10 +- Descent3/levelgoal.cpp | 2 +- Descent3/lighting.cpp | 10 +- Descent3/lighting.h | 8 +- Descent3/lightmap_info.h | 8 +- Descent3/loadstate.cpp | 62 +- Descent3/localization.cpp | 2 +- Descent3/matcen.h | 2 +- Descent3/menu.h | 2 +- Descent3/mission_download.cpp | 8 +- Descent3/mission_download.h | 4 +- Descent3/mmItem.cpp | 2 +- Descent3/multi.cpp | 626 ++++++++++---------- Descent3/multi.h | 144 ++--- Descent3/multi_client.cpp | 12 +- Descent3/multi_connect.cpp | 28 +- Descent3/multi_dll_mgr.cpp | 4 +- Descent3/multi_dll_mgr.h | 2 +- Descent3/multi_external.h | 72 +-- Descent3/multi_server.cpp | 60 +- Descent3/multi_server.h | 2 +- Descent3/multisafe.cpp | 24 +- Descent3/multisafe.h | 4 +- Descent3/multisafe_server.cpp | 12 +- Descent3/newui.cpp | 4 +- Descent3/newui.h | 2 +- Descent3/newui_core.cpp | 4 +- Descent3/object.cpp | 6 +- Descent3/object.h | 4 +- Descent3/object_lighting.cpp | 2 +- Descent3/objinfo.h | 4 +- Descent3/osiris_dll.h | 6 +- Descent3/osiris_predefs.cpp | 20 +- Descent3/osiris_predefs.h | 24 +- Descent3/pilot.cpp | 20 +- Descent3/pilot.h | 8 +- Descent3/pilot_class.cpp | 26 +- Descent3/pilot_class.h | 18 +- Descent3/postrender.h | 2 +- Descent3/procedurals.cpp | 66 +-- Descent3/procedurals.h | 12 +- Descent3/program.cpp | 2 +- Descent3/program.h | 4 +- Descent3/render.cpp | 48 +- Descent3/render.h | 4 +- Descent3/renderobject.cpp | 14 +- Descent3/robotfirestruct.h | 18 +- Descent3/room.cpp | 6 +- Descent3/room.h | 2 +- Descent3/room_external.h | 26 +- Descent3/scorch.cpp | 4 +- Descent3/screens.cpp | 2 +- Descent3/ship.h | 4 +- Descent3/special_face.h | 8 +- Descent3/spew.h | 2 +- Descent3/terrain.cpp | 22 +- Descent3/terrain.h | 52 +- Descent3/terrainrender.cpp | 20 +- Descent3/vclip.cpp | 2 +- Descent3/vclip.h | 4 +- Descent3/viseffect.cpp | 4 +- Descent3/viseffect.h | 4 +- Descent3/viseffect_external.h | 12 +- Descent3/voice.cpp | 4 +- Descent3/weapon.h | 10 +- Descent3/weather.h | 2 +- Descent3/winmain.cpp | 4 +- bitmap/bitmain.cpp | 6 +- bitmap/bumpmap.cpp | 4 +- bitmap/iff.cpp | 28 +- bitmap/pcx.cpp | 26 +- bitmap/tga.cpp | 30 +- cfile/cfile.cpp | 34 +- cfile/cfile.h | 4 +- czip/BitIO.cpp | 6 +- czip/CZip.cpp | 52 +- czip/HuffmanAdapt.cpp | 4 +- ddebug/winmono.cpp | 2 +- ddio_common/key.cpp | 6 +- ddio_lnx/lnxkey.cpp | 18 +- ddio_lnx/lnxkey_null.cpp | 6 +- ddio_lnx/lnxkey_sdl.cpp | 12 +- ddio_lnx/lnxmouse.cpp | 4 +- ddio_win/winjoy.cpp | 4 +- ddio_win/winkey.cpp | 18 +- ddio_win/winmouse.cpp | 4 +- grtext/grfont.cpp | 84 +-- grtext/grtext.cpp | 32 +- legacy/D3Launch/D3Launch.cpp | 4 +- legacy/D3Launch/DirectXTab.cpp | 4 +- legacy/D3Launch/OS_Config.cpp | 8 +- legacy/FontEditor/FontCreate.cpp | 14 +- legacy/FontEditor/FontKern.cpp | 36 +- legacy/editor/BriefEdit.cpp | 8 +- legacy/editor/BriefEdit.h | 6 +- legacy/editor/DallasMainDlg.cpp | 8 +- legacy/editor/EPath.cpp | 2 +- legacy/editor/EPath.h | 2 +- legacy/editor/Erooms.cpp | 4 +- legacy/editor/GrFontDialog.cpp | 16 +- legacy/editor/GrFontDialog.h | 2 +- legacy/editor/Group.cpp | 4 +- legacy/editor/HFile.cpp | 2 +- legacy/editor/HRoom.cpp | 4 +- legacy/editor/LevelDialog.cpp | 4 +- legacy/editor/LightingDialog.cpp | 2 +- legacy/editor/MegacellDialog.cpp | 2 +- legacy/editor/ObjectDialog.cpp | 2 +- legacy/editor/ProceduralDialog.cpp | 6 +- legacy/editor/ProceduralDialog.h | 10 +- legacy/editor/Read3ds.cpp | 4 +- legacy/editor/ScriptCompilerAPI.cpp | 18 +- legacy/editor/ScriptCompilerAPI.h | 4 +- legacy/editor/ScriptLevelInterface.cpp | 2 +- legacy/editor/ScriptMassCompile.cpp | 4 +- legacy/editor/ScriptMassCompile.h | 2 +- legacy/editor/ScriptSyncDialog.cpp | 2 +- legacy/editor/TableFileFilterMng.cpp | 20 +- legacy/editor/TableFileFilterMng.h | 16 +- legacy/editor/TableManage.cpp | 4 +- legacy/editor/TerrainDialog.cpp | 28 +- legacy/editor/TextureDialog.cpp | 2 +- legacy/editor/WaterProceduralDialog.cpp | 4 +- legacy/editor/WaterProceduralDialog.h | 8 +- legacy/editor/WireframeGrWnd.cpp | 2 +- legacy/editor/WorldObjectsGenericDialog.cpp | 2 +- legacy/editor/drawworld.cpp | 6 +- legacy/editor/editor_lighting.cpp | 32 +- legacy/editor/editor_lighting.h | 2 +- legacy/editor/editor_object_lighting.cpp | 6 +- legacy/editor/rad_cast.cpp | 2 +- legacy/editor/rad_hemicube.cpp | 2 +- legacy/editor/radiosity.h | 20 +- legacy/editor/rotateroom.cpp | 2 +- legacy/hogedit/HogEditDoc.cpp | 4 +- legacy/hogmaker/hog.cpp | 4 +- legacy/mtclient/mt_net.cpp | 6 +- legacy/mtclient/mtclient.cpp | 4 +- legacy/mtclient/mtclient.h | 4 +- legacy/mtclient/mtgametrack.cpp | 4 +- legacy/mtclient/mtgametrack.h | 2 +- legacy/mtclient/mtpilottrack.h | 2 +- legacy/mtclient/mtpilottracker.cpp | 4 +- legacy/musicutils/musicutilsDlg.cpp | 8 +- legacy/musicutils/musicutilsDlg.h | 4 +- legacy/powerball/powerball.cpp | 16 +- legacy/powerball/powerball.h | 10 +- legacy/renderer/Direct3D.cpp | 10 +- legacy/renderer/opengl.cpp | 18 +- legacy/renderer/renderer.cpp | 14 +- lib/3d.h | 14 +- lib/CZip.h | 24 +- lib/Controller.h | 16 +- lib/Ddgr.h | 4 +- lib/PHYSICS.H | 6 +- lib/bitmap.h | 6 +- lib/bumpmap.h | 8 +- lib/collide.h | 4 +- lib/d3music.h | 8 +- lib/ddio.h | 6 +- lib/ddio_common.h | 2 +- lib/demofile.h | 8 +- lib/directplay.h | 2 +- lib/game2dll.h | 2 +- lib/gameos.h | 12 +- lib/gr.h | 14 +- lib/grtext.h | 26 +- lib/lightmap.h | 8 +- lib/manage.h | 16 +- lib/megacell.h | 2 +- lib/networking.h | 30 +- lib/polymodel.h | 12 +- lib/polymodel_external.h | 12 +- lib/pstypes.h | 2 +- lib/rend_d3d.h | 2 +- lib/rend_opengl.h | 2 +- lib/renderer.h | 20 +- lib/texture.h | 6 +- lib/ui.h | 2 +- lib/uidraw.h | 6 +- lib/uires.h | 36 +- lib/unzip.h | 10 +- lib/win/wincontroller.h | 30 +- linux/lnxcontroller.cpp | 24 +- linux/lnxcontroller.h | 30 +- manage/doorpage.cpp | 4 +- manage/gamefilepage.cpp | 2 +- manage/generic.cpp | 2 +- manage/manage.cpp | 24 +- manage/megapage.cpp | 2 +- manage/pagelock.cpp | 2 +- manage/shippage.cpp | 10 +- manage/soundpage.cpp | 4 +- manage/texpage.cpp | 16 +- manage/texpage.h | 18 +- manage/weaponpage.cpp | 6 +- model/newstyle.cpp | 6 +- model/polymodel.cpp | 12 +- music/music.h | 16 +- music/sequencer.cpp | 2 +- music/streamer.cpp | 4 +- netcon/includes/con_dll.h | 12 +- netcon/includes/mdllinit.h | 2 +- netcon/lanclient/lanclient.cpp | 2 +- netcon/lanclient/lanclient.h | 4 +- netgames/anarchy/Anarchy.h | 10 +- netgames/anarchy/anarchy.cpp | 8 +- netgames/coop/coop.cpp | 18 +- netgames/coop/coop.h | 10 +- netgames/ctf/ctf.cpp | 74 +-- netgames/ctf/ctf.h | 12 +- netgames/dmfc/dmfcbase.cpp | 22 +- netgames/dmfc/dmfcclient.cpp | 6 +- netgames/dmfc/dmfcdllinit.h | 2 +- netgames/dmfc/dmfcfunctions.cpp | 44 +- netgames/dmfc/dmfcinputcommand.cpp | 6 +- netgames/dmfc/dmfcinterface.cpp | 40 +- netgames/dmfc/dmfcinternal.h | 102 ++-- netgames/dmfc/dmfcmenu.cpp | 12 +- netgames/dmfc/dmfcpackets.cpp | 70 +-- netgames/dmfc/dmfcpinfo.cpp | 4 +- netgames/dmfc/dmfcprecord.cpp | 24 +- netgames/dmfc/dmfcremote.cpp | 80 +-- netgames/dmfc/dmfcstats.cpp | 2 +- netgames/dmfc/dmfcvirtual.cpp | 4 +- netgames/dmfc/encryption.cpp | 14 +- netgames/dmfc/encryption.h | 6 +- netgames/dmfc/idmfc.cpp | 2 +- netgames/entropy/Entropy.h | 12 +- netgames/entropy/EntropyAux.h | 12 +- netgames/entropy/EntropyBase.cpp | 18 +- netgames/entropy/EntropyPackets.cpp | 22 +- netgames/hoard/Hoard.h | 10 +- netgames/hoard/hoard.cpp | 32 +- netgames/hyperanarchy/HyperAnarchy.h | 10 +- netgames/hyperanarchy/hyperanarchy.cpp | 32 +- netgames/includes/DMFC.h | 4 +- netgames/includes/gamedll_header.h | 54 +- netgames/includes/idmfc.h | 88 +-- netgames/monsterball/monsterball.cpp | 30 +- netgames/monsterball/monsterball.h | 10 +- netgames/roboanarchy/roboAnarchy.h | 10 +- netgames/roboanarchy/roboanarchy.cpp | 8 +- netgames/tanarchy/tanDMFC.h | 10 +- netgames/tanarchy/tanarchy.cpp | 10 +- networking/directplay.cpp | 6 +- networking/networking.cpp | 100 ++-- physics/Collide.cpp | 14 +- physics/FindIntersection.cpp | 12 +- physics/physics.cpp | 4 +- renderer/HardwareBaseGPU.cpp | 14 +- renderer/HardwareClipper.cpp | 4 +- renderer/HardwareDraw.cpp | 6 +- renderer/HardwareGlobalVars.cpp | 2 +- renderer/HardwareInternal.h | 4 +- renderer/HardwareOpenGL.cpp | 16 +- renderer/HardwarePoints.cpp | 8 +- scripts/AIGame.cpp | 12 +- scripts/AIGame3.cpp | 20 +- scripts/BatteriesIncluded.cpp | 8 +- scripts/BossCamera.cpp | 8 +- scripts/CanyonsCTF.cpp | 8 +- scripts/CellTestLevel.cpp | 8 +- scripts/ChrisTest.cpp | 8 +- scripts/DallasFuncs.cpp | 12 +- scripts/Geodomes.cpp | 8 +- scripts/HalfPipe.cpp | 8 +- scripts/InfernalBolt.cpp | 8 +- scripts/Inversion.cpp | 8 +- scripts/LEVEL0.cpp | 8 +- scripts/LEVEL15.cpp | 8 +- scripts/Level12.cpp | 8 +- scripts/Level16.cpp | 8 +- scripts/Level6.cpp | 8 +- scripts/Level9.cpp | 8 +- scripts/LevelS1.cpp | 8 +- scripts/Merc02.cpp | 8 +- scripts/Merc1.cpp | 8 +- scripts/Merc3.cpp | 8 +- scripts/Merc4.cpp | 8 +- scripts/Merc6.cpp | 8 +- scripts/Merc7.cpp | 18 +- scripts/Mysterious_Isle.cpp | 8 +- scripts/Paranoia.cpp | 8 +- scripts/PiccuStation.cpp | 8 +- scripts/Polaris.cpp | 8 +- scripts/Quadsomniac.cpp | 8 +- scripts/RudeAwakening.cpp | 8 +- scripts/SewerRat.cpp | 8 +- scripts/TrainingMission.cpp | 8 +- scripts/Y2K.cpp | 8 +- scripts/aigame2.cpp | 24 +- scripts/aigame4.cpp | 12 +- scripts/barney.cpp | 8 +- scripts/clutter.cpp | 8 +- scripts/generic.cpp | 10 +- scripts/level1.cpp | 8 +- scripts/level10.cpp | 8 +- scripts/level11.cpp | 8 +- scripts/level13.cpp | 8 +- scripts/level14.cpp | 8 +- scripts/level17.cpp | 8 +- scripts/level2.cpp | 8 +- scripts/level3.cpp | 8 +- scripts/level4.cpp | 8 +- scripts/level5.cpp | 8 +- scripts/level7.cpp | 8 +- scripts/level8.cpp | 8 +- scripts/levelS2.cpp | 8 +- scripts/lnx/osiris_common.h | 34 +- scripts/lnx/osiris_import.h | 44 +- scripts/merc5.cpp | 12 +- scripts/myPowerHouse.cpp | 8 +- scripts/orbital.cpp | 8 +- scripts/osiris_common.h | 2 +- scripts/osiris_import.h | 46 +- scripts/testscript.cpp | 8 +- sndlib/ddsoundload.cpp | 2 +- sndlib/ds3dlib_internal.h | 10 +- sndlib/dsound3d.cpp | 4 +- sndlib/hlsoundlib.h | 2 +- sndlib/ssl_lib.h | 4 +- stream_audio/osfarchive.cpp | 24 +- stream_audio/streamaudio.cpp | 10 +- stream_audio/streamaudio.h | 30 +- ui/UIConsole.cpp | 2 +- ui/UIDraw.cpp | 8 +- ui/UIListBox.cpp | 4 +- ui/UIRes.cpp | 10 +- unzip/unzip.cpp | 16 +- win32/WinController.cpp | 24 +- 394 files changed, 2888 insertions(+), 2888 deletions(-) diff --git a/2dlib/font.cpp b/2dlib/font.cpp index e1fb8088..35aab78e 100644 --- a/2dlib/font.cpp +++ b/2dlib/font.cpp @@ -143,7 +143,7 @@ typedef CFILE *FONTFILE; static inline int READ_FONT_INT(FONTFILE ffile); static inline short READ_FONT_SHORT(FONTFILE ffile); -static inline ubyte READ_FONT_BYTE(FONTFILE ffile); +static inline uint8_t READ_FONT_BYTE(FONTFILE ffile); static inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem); static inline FONTFILE OPEN_FONT(char *filename, bool &success); static inline void CLOSE_FONT(FONTFILE ffile); @@ -155,12 +155,12 @@ inline int READ_FONT_INT(FONTFILE ffile) { return cf_ReadInt(ffile); } inline short READ_FONT_SHORT(FONTFILE ffile) { return cf_ReadShort(ffile); } -inline ubyte READ_FONT_BYTE(FONTFILE ffile) { return (ubyte)cf_ReadByte(ffile); } +inline uint8_t READ_FONT_BYTE(FONTFILE ffile) { return (uint8_t)cf_ReadByte(ffile); } inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem) { int i; - i = cf_ReadBytes((ubyte *)buf, size * nelem, ffile); + i = cf_ReadBytes((uint8_t *)buf, size * nelem, ffile); ASSERT(i == (size * nelem)); @@ -420,8 +420,8 @@ void grFont::load(char *filename, int slot) { // generate character data pointer table int bytesize = READ_FONT_INT(ff); - ft->raw_data = (ubyte *)mem_malloc(bytesize); - ft->char_data = (ubyte **)mem_malloc(num_char * sizeof(ubyte *)); + ft->raw_data = (uint8_t *)mem_malloc(bytesize); + ft->char_data = (uint8_t **)mem_malloc(num_char * sizeof(uint8_t *)); READ_FONT_DATA(ff, ft->raw_data, bytesize, 1); @@ -436,7 +436,7 @@ void grFont::load(char *filename, int slot) { off += (ft->width * ft->height * BITS_TO_BYTES(BPP_16)); } } else { // Monochrome - ubyte *ptr = ft->raw_data; + uint8_t *ptr = ft->raw_data; mprintf((0, "::mono")); for (i = 0; i < num_char; i++) { ft->char_data[i] = ptr; @@ -474,18 +474,18 @@ void grFont::translate_to_surfaces(int slot) { // create a 128x128 surface first. // draw each character into surface until we need to create another // surface. - ubyte u = 0, v = 0, w; + uint8_t u = 0, v = 0, w; int ch, num_ch; - ubyte surf_index = 0; + uint8_t surf_index = 0; num_ch = fntfile->max_ascii - fntfile->min_ascii + 1; // initialize memory - fnt->ch_w = new ubyte[num_ch]; - fnt->ch_h = new ubyte[num_ch]; - fnt->ch_u = new ubyte[num_ch]; - fnt->ch_v = new ubyte[num_ch]; - fnt->ch_surf = new ubyte[num_ch]; + fnt->ch_w = new uint8_t[num_ch]; + fnt->ch_h = new uint8_t[num_ch]; + fnt->ch_u = new uint8_t[num_ch]; + fnt->ch_v = new uint8_t[num_ch]; + fnt->ch_surf = new uint8_t[num_ch]; fnt->ch_uf = new float[num_ch]; fnt->ch_vf = new float[num_ch]; fnt->ch_wf = new float[num_ch]; @@ -554,8 +554,8 @@ void grFont::translate_to_surfaces(int slot) { void grFont::translate_mono_char(grSurface *sf, int x, int y, int index, gr_font_file_record *ft, int width) { int row, col; // byte width of char int rowsize; - ubyte bit_mask = 0, byte; - ubyte *fp; + uint8_t bit_mask = 0, byte; + uint8_t *fp; fp = ft->char_data[index]; @@ -704,9 +704,9 @@ int grFont::get_char_info(int ch, int *width) { return 0; } -ubyte *grFont::get_kern_info(ubyte c1, ubyte c2) { +uint8_t *grFont::get_kern_info(uint8_t c1, uint8_t c2) { // gr_font_file_record *ft; - // ubyte *p; + // uint8_t *p; // p = ft->kern_data; // ft = &grFont::m_FontList[m_FontHandle].font; diff --git a/2dlib/pentext.cpp b/2dlib/pentext.cpp index bdcf32d3..c6892fe5 100644 --- a/2dlib/pentext.cpp +++ b/2dlib/pentext.cpp @@ -288,9 +288,9 @@ void grViewport::draw_text_line_clip(int x, int y, char *str) { cur_x = x; for (i = 0; i < (int)strlen(str); i++) { - ubyte ch; + uint8_t ch; int w; - ch = (ubyte)str[i]; + ch = (uint8_t)str[i]; text_Font.get_char_info((int)ch, &w); if (ch == GR_COLOR_CHAR) { @@ -300,7 +300,7 @@ void grViewport::draw_text_line_clip(int x, int y, char *str) { i += 4; if (i >= (int)strlen(str)) Int3(); // This shouldn't happen too. - ch = (ubyte)str[i]; + ch = (uint8_t)str[i]; } else if (ch == '\t') { // tab char int space_width; text_Font.get_char_info(' ', &space_width); @@ -342,9 +342,9 @@ void grViewport::draw_text_line(int x, int y, char *str) { */ cur_x = x; for (i = 0; i < (int)strlen(str); i++) { - ubyte ch; + uint8_t ch; - ch = (ubyte)str[i]; + ch = (uint8_t)str[i]; if (ch == GR_COLOR_CHAR) { if ((i + 3) >= (int)strlen(str)) @@ -353,7 +353,7 @@ void grViewport::draw_text_line(int x, int y, char *str) { i += 4; if (i >= (int)strlen(str)) Int3(); // This shouldn't happen too. - ch = (ubyte)str[i]; + ch = (uint8_t)str[i]; } else if (ch == '\t') { // tab char int space_width; text_Font.get_char_info(' ', &space_width); diff --git a/2dlib/surface.cpp b/2dlib/surface.cpp index 8dc977f6..7ecfe351 100644 --- a/2dlib/surface.cpp +++ b/2dlib/surface.cpp @@ -460,7 +460,7 @@ char *grSurface::lock(int *rowsize) { surf_Locked++; // increment lock counter for this surface - rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (ubyte *)m_OrigDataPtr); + rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (uint8_t *)m_OrigDataPtr); return m_DataPtr; } @@ -507,7 +507,7 @@ char *grSurface::lock(int x, int y, int *rowsize) { surf_Locked++; // increment lock counter for this surface - rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (ubyte *)m_OrigDataPtr); + rend_SetSoftwareParameters(ddgr_GetAspectRatio(), ddsfObj.w, ddsfObj.h, m_DataRowsize, (uint8_t *)m_OrigDataPtr); return m_DataPtr; } @@ -555,7 +555,7 @@ void grSurface::xlat8_16(char *data, int w, int h, char *pal) { int row, col; int rowsize_w; int height, width; - ubyte *upal = (ubyte *)pal; + uint8_t *upal = (uint8_t *)pal; dptr = (ushort *)m_DataPtr; sptr = (char *)data; @@ -566,7 +566,7 @@ void grSurface::xlat8_16(char *data, int w, int h, char *pal) { for (row = 0; row < height; row++) { for (col = 0; col < width; col++) { - ubyte spix = sptr[col]; + uint8_t spix = sptr[col]; if (spix != 0) { int r = upal[spix * 3] >> 3; int g = upal[spix * 3 + 1] >> 2; diff --git a/Descent3/AIGoal.cpp b/Descent3/AIGoal.cpp index 437c05ed..0e019e4d 100644 --- a/Descent3/AIGoal.cpp +++ b/Descent3/AIGoal.cpp @@ -1100,7 +1100,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl gi_fire *attack_info = (gi_fire *)arg_struct; if ((ai_info->animation_type == AS_ALERT) || (ai_info->animation_type == AS_MELEE1 + 1) || (ai_info->animation_type == AS_MELEE2 + 1)) { - ubyte m_num = attack_info->melee_number; + uint8_t m_num = attack_info->melee_number; char new_anim; if (m_num) @@ -1231,7 +1231,7 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *arg_struct, int level, fl return goal_index; } -int GoalAddEnabler(object *obj, int goal_index, ubyte enabler_type, void *arg_struct, float percent, float interval) { +int GoalAddEnabler(object *obj, int goal_index, uint8_t enabler_type, void *arg_struct, float percent, float interval) { ai_frame *ai_info = obj->ai_info; goal_enabler *e_info; diff --git a/Descent3/AIGoal.h b/Descent3/AIGoal.h index 62d3598f..b824ed81 100644 --- a/Descent3/AIGoal.h +++ b/Descent3/AIGoal.h @@ -114,11 +114,11 @@ int GoalAddGoal(object *obj, uint32_t goal_type, void *args, int level = 0, floa int guid = -1, char subtype = 0); // Adds a ending condition to a goal -int GoalAddDisabler(object *obj, int goal_index, ubyte ender_type, void *args, float percent = 1.0f, +int GoalAddDisabler(object *obj, int goal_index, uint8_t ender_type, void *args, float percent = 1.0f, float interval = 0.0f); // Adds a enabler condition to a goal -int GoalAddEnabler(object *obj, int goal_index, ubyte enabler_type, void *arg_struct, float percent, float interval); +int GoalAddEnabler(object *obj, int goal_index, uint8_t enabler_type, void *arg_struct, float percent, float interval); // Clears one goal void GoalClearGoal(object *obj, goal *goal_ptr, int notify_reason = AI_INVALID_INDEX); diff --git a/Descent3/AIMain.h b/Descent3/AIMain.h index 2a64f662..819ba56a 100644 --- a/Descent3/AIMain.h +++ b/Descent3/AIMain.h @@ -169,10 +169,10 @@ extern int AI_debug_robot_index; // Is my buddy in the level? (no if the handle is invalid) extern int Buddy_handle[MAX_PLAYERS]; -bool AINotify(object *obj, ubyte notify_type, void *info = NULL); +bool AINotify(object *obj, uint8_t notify_type, void *info = NULL); void AIDoFrame(object *obj); void AIFrameAll(void); -bool AIInit(object *obj, ubyte ai_class, ubyte ai_type, ubyte ai_movement); +bool AIInit(object *obj, uint8_t ai_class, uint8_t ai_type, uint8_t ai_movement); void AIInitAll(void); void AIPowerSwitch(object *obj, bool f_on); void AITurnTowardsDir(object *obj, /*velocity *new_vel,*/ vector *goal_dir /*, bool remain_level*/, float turn_rate); diff --git a/Descent3/AImain.cpp b/Descent3/AImain.cpp index 737d36b9..59aadfde 100644 --- a/Descent3/AImain.cpp +++ b/Descent3/AImain.cpp @@ -2888,7 +2888,7 @@ void AISeeTarget(object *obj, bool f_see) { } } -bool AINotify(object *obj, ubyte notify_type, void *info) { +bool AINotify(object *obj, uint8_t notify_type, void *info) { int next_anim; ai_frame *ai_info = obj->ai_info; //@$-tD3XEventArgs evtargs; @@ -3669,7 +3669,7 @@ void ObjSetAIInfo(object *objp) { dest->biased_flight_max = src->biased_flight_max; } -bool AIInit(object *obj, ubyte ai_class, ubyte ai_type, ubyte ai_movement) { +bool AIInit(object *obj, uint8_t ai_class, uint8_t ai_type, uint8_t ai_movement) { ai_frame *ai_info = obj->ai_info; ASSERT(ai_info); ASSERT(obj->control_type == CT_AI && obj->type != OBJ_NONE); @@ -5368,7 +5368,7 @@ void ai_fire(object *obj) { obj->dynamic_wb[i].norm_turret_angle[j] = ta[best_dot]; - ubyte last_t_d = obj->dynamic_wb[i].turret_direction[j]; + uint8_t last_t_d = obj->dynamic_wb[i].turret_direction[j]; if (dot[WB_MOVE_RIGHT] > dot[WB_MOVE_LEFT]) obj->dynamic_wb[i].turret_direction[j] = WB_MOVE_RIGHT; diff --git a/Descent3/BOA.cpp b/Descent3/BOA.cpp index 4ecb8f5f..ad21b4c4 100644 --- a/Descent3/BOA.cpp +++ b/Descent3/BOA.cpp @@ -141,7 +141,7 @@ #define BOA_VERSION 25 -static const ubyte bbf_lookup[27] = {(0), +static const uint8_t bbf_lookup[27] = {(0), (0x01), (0x02), (0x04), @@ -1560,8 +1560,8 @@ void MakeBOAVisTable(bool from_lighting) { int cur_check = BOAGetMineChecksum(); int vis_stack[MAX_ROOMS * 10]; int stack_count = 0; - ubyte already_checked[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS]; - ubyte precomputed[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS][MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS]; + uint8_t already_checked[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS]; + uint8_t precomputed[MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS][MAX_ROOMS + MAX_BOA_TERRAIN_REGIONS]; // Removed this as we have to make a better checksum @@ -2514,7 +2514,7 @@ void ComputeAABB(bool f_full) { f_part = true; } - ubyte sector = 0; + uint8_t sector = 0; if (f_part == false) { if (r_struct_list[i][count] == 0) @@ -2934,7 +2934,7 @@ void ComputeAABB(bool f_full) { list[5] = true; } - ubyte sector = 0; + uint8_t sector = 0; for (x = 0; x < 6; x++) { if (list[x]) { diff --git a/Descent3/Controls.cpp b/Descent3/Controls.cpp index 49a4ec7c..f7499042 100644 --- a/Descent3/Controls.cpp +++ b/Descent3/Controls.cpp @@ -1357,7 +1357,7 @@ void LoadControlConfig(pilot *plt) { int id = Current_pilot.controls[i].id; ct_type type[2]; ct_config_data ccfgdata; - ubyte flags[2]; + uint8_t flags[2]; type[0] = plt->controls[i].type[0]; type[1] = plt->controls[i].type[1]; @@ -1387,7 +1387,7 @@ void SaveControlConfig(pilot *plt) { for (int i = 0; i < NUM_CONTROLLER_FUNCTIONS; i++) { ct_type ctype[2]; ct_config_data ccfgdata; - ubyte flags[2]; + uint8_t flags[2]; Controller->get_controller_function(Controller_needs[i].id, ctype, &ccfgdata, flags); plt->controls[i].id = Controller_needs[i].id; diff --git a/Descent3/CtlCfgElem.cpp b/Descent3/CtlCfgElem.cpp index d08eb6d9..70239f60 100644 --- a/Descent3/CtlCfgElem.cpp +++ b/Descent3/CtlCfgElem.cpp @@ -473,7 +473,7 @@ void Localize_ctl_bindings() { } ////////////////////////////////////////////////////////////////////////////// -const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding) { +const char *cfg_binding_text(ct_type ctype, uint8_t ctrl, uint8_t binding) { const char *str; if (ctrl == NULL_CONTROLLER) { @@ -511,15 +511,15 @@ const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding) { ////////////////////////////////////////////////////////////////////////////// // class cfg_element_ui : public newuiMessageBox { - ubyte m_element; // element passed and returned. - ubyte m_controller; // controller. + uint8_t m_element; // element passed and returned. + uint8_t m_controller; // controller. int8_t m_alpha; // used for fx. ct_type m_type; public: - void Create(const char *title, ct_type type, ubyte controller, ubyte element); - ubyte GetElement() const { return m_element; }; - ubyte GetController() const { return m_controller; }; + void Create(const char *title, ct_type type, uint8_t controller, uint8_t element); + uint8_t GetElement() const { return m_element; }; + uint8_t GetController() const { return m_controller; }; ct_type GetType() const { return m_type; }; int DoUI(); @@ -537,7 +537,7 @@ UIBitmapItem *cfg_element::m_xbtn_bmp = NULL; short cfg_element::m_count = 0; // MTS: unused? -bool key_cfg_element(ubyte *element, ubyte *flags); +bool key_cfg_element(uint8_t *element, uint8_t *flags); ////////////////////////////////////////////////////////////////////////////// // @@ -597,7 +597,7 @@ void cfg_element::OnDraw() { if (m_fnid != -1) { ct_type ctype[CTLBINDS_PER_FUNC]; - ubyte cfgflags[CTLBINDS_PER_FUNC]; + uint8_t cfgflags[CTLBINDS_PER_FUNC]; ct_config_data cfgdata; tCfgDataParts cfgparts; @@ -608,8 +608,8 @@ void cfg_element::OnDraw() { for (i = 0; i < N_CFGELEM_SLOTS; i++) { const char *txt; - ubyte one_binding = (i == 0) ? cfgparts.bind_0 : cfgparts.bind_1; - ubyte one_ctrlbind = (i == 0) ? cfgparts.ctrl_0 : cfgparts.ctrl_1; + uint8_t one_binding = (i == 0) ? cfgparts.bind_0 : cfgparts.bind_1; + uint8_t one_ctrlbind = (i == 0) ? cfgparts.ctrl_0 : cfgparts.ctrl_1; txt = cfg_binding_text(ctype[i], one_ctrlbind, one_binding); @@ -654,7 +654,7 @@ void cfg_element::OnKeyDown(int key) { // clear binding. tCfgDataParts cfgparts; ct_type ctype_fn[CTLBINDS_PER_FUNC]; - ubyte cfgflags_fn[CTLBINDS_PER_FUNC]; + uint8_t cfgflags_fn[CTLBINDS_PER_FUNC]; ct_config_data ccfgdata_fn; Controller->get_controller_function(m_fnid, ctype_fn, &ccfgdata_fn, cfgflags_fn); @@ -759,13 +759,13 @@ void cfg_element::OnDestroy() { } // calls configuration routines -bool cfg_element::Configure(ct_type *new_elem_type, ubyte *controller, ubyte *new_cfg_element, int8_t *cfg_slot) { +bool cfg_element::Configure(ct_type *new_elem_type, uint8_t *controller, uint8_t *new_cfg_element, int8_t *cfg_slot) { cfg_element_ui cfg_box; ct_type ctype_fn[CTLBINDS_PER_FUNC]; - ubyte cfgflags_fn[CTLBINDS_PER_FUNC]; + uint8_t cfgflags_fn[CTLBINDS_PER_FUNC]; ct_config_data ccfgdata_fn; tCfgDataParts cfgparts; - ubyte element, ctrl; + uint8_t element, ctrl; bool configure = false; int8_t fnid = m_fnid; @@ -844,13 +844,13 @@ bool cfg_element::Configure(ct_type *new_elem_type, ubyte *controller, ubyte *ne } ////////////////////////////////////////////////////////////////////////////// -bool key_cfg_element(ubyte *element, ubyte *flags) { +bool key_cfg_element(uint8_t *element, uint8_t *flags) { // put up configuration dialog return true; } -void cfg_element_ui::Create(const char *title, ct_type type, ubyte controller, ubyte element) { +void cfg_element_ui::Create(const char *title, ct_type type, uint8_t controller, uint8_t element) { m_controller = controller; m_element = element; m_type = type; @@ -1039,7 +1039,7 @@ int cfg_element_ui::DoUI() { } void cfg_element_ui::OnDraw() { - UITextItem prompt(MONITOR9_NEWUI_FONT, "?", NEWUI_MONITORFONT_COLOR, (ubyte)(m_alpha * 8) + 127); + UITextItem prompt(MONITOR9_NEWUI_FONT, "?", NEWUI_MONITORFONT_COLOR, (uint8_t)(m_alpha * 8) + 127); newuiMessageBox::OnDraw(); diff --git a/Descent3/CtlCfgElem.h b/Descent3/CtlCfgElem.h index f52a5163..b89758e9 100644 --- a/Descent3/CtlCfgElem.h +++ b/Descent3/CtlCfgElem.h @@ -95,13 +95,13 @@ class cfg_element : public UIGadget { const char *m_title; int8_t m_fnid, m_flags; // fnflags : 1 if invert btn visible int8_t m_slot, m_curslot; // what slow is in focus and number of slots. - ubyte m_slot_alpha; + uint8_t m_slot_alpha; int8_t m_blink_state; public: void Create(UIWindow *wnd, int str_i, int x, int y, int fnid, int id); int8_t GetActiveSlot() const { return m_slot; }; - bool Configure(ct_type *elem_type, ubyte *controller, ubyte *new_elem, + bool Configure(ct_type *elem_type, uint8_t *controller, uint8_t *new_elem, int8_t *slot); // calls configuration routines (returns true if approved) protected: @@ -116,7 +116,7 @@ protected: }; typedef struct tCfgDataParts { - ubyte bind_0, bind_1, ctrl_0, ctrl_1; + uint8_t bind_0, bind_1, ctrl_0, ctrl_1; } tCfgDataParts; static inline void parse_config_data(tCfgDataParts *parts, ct_type type0, ct_type type1, ct_config_data cfgdata) { @@ -165,6 +165,6 @@ static inline ct_config_data unify_config_data(tCfgDataParts *parts) { CONTROLLER_CTL_VALUE(parts->bind_0, parts->bind_1)); } -extern const char *cfg_binding_text(ct_type ctype, ubyte ctrl, ubyte binding); +extern const char *cfg_binding_text(ct_type ctype, uint8_t ctrl, uint8_t binding); #endif diff --git a/Descent3/Game2DLL.cpp b/Descent3/Game2DLL.cpp index fff2a14b..754c1f94 100644 --- a/Descent3/Game2DLL.cpp +++ b/Descent3/Game2DLL.cpp @@ -94,14 +94,14 @@ typedef struct { // The exported DLL function call prototypes #if defined(__LINUX__) typedef void DLLFUNCCALL (*DLLGameCall_fp)(int eventnum, dllinfo *data); -typedef void DLLFUNCCALL (*DLLGameInit_fp)(int *api_func, ubyte *all_ok, int num_teams_to_use); +typedef void DLLFUNCCALL (*DLLGameInit_fp)(int *api_func, uint8_t *all_ok, int num_teams_to_use); typedef void DLLFUNCCALL (*DLLGameClose_fp)(); typedef void DLLFUNCCALL (*DLLGameGetName_fp)(char *buffer, int maxsize); typedef void DLLFUNCCALL (*DLLGameGetDesc_fp)(char **buffer, int maxsize, int lines); typedef void DLLFUNCCALL (*DLLGetGameInfo_fp)(tDLLOptions *options); #else typedef void(DLLFUNCCALL *DLLGameCall_fp)(int eventnum, dllinfo *data); -typedef void(DLLFUNCCALL *DLLGameInit_fp)(int *api_func, ubyte *all_ok, int num_teams_to_use); +typedef void(DLLFUNCCALL *DLLGameInit_fp)(int *api_func, uint8_t *all_ok, int num_teams_to_use); typedef void(DLLFUNCCALL *DLLGameClose_fp)(); typedef void(DLLFUNCCALL *DLLGameGetName_fp)(char *buffer, int maxsize); typedef void(DLLFUNCCALL *DLLGameGetDesc_fp)(char **buffer, int maxsize, int lines); @@ -703,7 +703,7 @@ int LoadGameDLL(const char *name, int num_teams_to_use) { first = 0; } void *api_fp; - ubyte ok = 1; + uint8_t ok = 1; api_fp = (void *)GetGameAPI; DLLGameInit((int *)api_fp, &ok, num_teams_to_use); @@ -738,7 +738,7 @@ void CallGameDLL(int eventnum, dllinfo *data) { // Call this function right after a player connects to the game to see if a player is banned bool GameDLLIsAddressBanned(network_address *addr, const char *tracker_id) { ASSERT(addr); - DLLInfo.special_data = (ubyte *)addr; + DLLInfo.special_data = (uint8_t *)addr; // This used to be tracker_id, but storing a pointer as an int is a problem in 64 bit // and no code ever was populating the tracker id that I know of. -Kevin DLLInfo.iParam = 0; diff --git a/Descent3/GameCheat.cpp b/Descent3/GameCheat.cpp index 06f126a8..fe8fd01a 100644 --- a/Descent3/GameCheat.cpp +++ b/Descent3/GameCheat.cpp @@ -153,12 +153,12 @@ #define CHEATSPOT 14 bool IsCheater = false; bool Display_renderer_stats = false; -ubyte Outline_release_mode = 0; +uint8_t Outline_release_mode = 0; char CheatBuffer[] = "AAAAAAAAAAAAAAA"; char OldCheatBuffer[] = "AAAAAAAAAAAAAAA"; extern bool Force_one_texture; -extern ubyte AutomapVisMap[MAX_ROOMS]; +extern uint8_t AutomapVisMap[MAX_ROOMS]; const char *LamerCheats[] = { "?E9FI=()", // gabbagabbahey @@ -406,7 +406,7 @@ void DemoCheats(int key) { static int state = 0; if (!(memcmp(cryptstring, OutlineModeCheat, 8))) { - ubyte new_mode; + uint8_t new_mode; char buffer[128]; switch (state) { case 0: @@ -638,7 +638,7 @@ void DemoCheats(int key) { if (!(memcmp(cryptstring, SuicideCheat, 8))) { //"ZOD Strikes Revenge" - static ubyte buffer[20] = {0x80, 0x95, 0x9E, 0xFA, 0x89, 0xAE, 0xA8, 0xB3, 0xB1, 0xBF, + static uint8_t buffer[20] = {0x80, 0x95, 0x9E, 0xFA, 0x89, 0xAE, 0xA8, 0xB3, 0xB1, 0xBF, 0xA9, 0xFA, 0x88, 0xBF, 0xAC, 0xBF, 0xB4, 0xBD, 0xBF, 0xDA}; char tb[20]; diff --git a/Descent3/GameLoop.cpp b/Descent3/GameLoop.cpp index 0588f230..68220389 100644 --- a/Descent3/GameLoop.cpp +++ b/Descent3/GameLoop.cpp @@ -1331,7 +1331,7 @@ void ProcessNormalKey(int key) { // decode the text macro by sending it off to the DLL // for processesing DLLInfo.input_string = Current_pilot.taunts[index]; - DLLInfo.special_data = (ubyte *)HudInputMessage; + DLLInfo.special_data = (uint8_t *)HudInputMessage; DLLInfo.iParam = MAX_HUD_INPUT_LEN; CallGameDLL(EVT_CLIENT_DECODETEXTMACRO, &DLLInfo); diff --git a/Descent3/LoadLevel.cpp b/Descent3/LoadLevel.cpp index cafb19e7..6bcb2a93 100644 --- a/Descent3/LoadLevel.cpp +++ b/Descent3/LoadLevel.cpp @@ -1413,7 +1413,7 @@ void WriteAllDoorways(CFILE *ofile); typedef struct { int type, id; const char *name; - ubyte flag; + uint8_t flag; } tConvertObject; tConvertObject object_convert[] = { @@ -1581,7 +1581,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) { if (fileversion >= 34) id = cf_ReadShort(ifile); else - id = (ubyte)cf_ReadByte(ifile); + id = (uint8_t)cf_ReadByte(ifile); // Translate id old_id = id; @@ -1730,7 +1730,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) { i = cf_ReadByte(ifile); if (i > 0) { objp->custom_default_script_name = (char *)mem_malloc(i + 1); - cf_ReadBytes((ubyte *)objp->custom_default_script_name, i, ifile); + cf_ReadBytes((uint8_t *)objp->custom_default_script_name, i, ifile); objp->custom_default_script_name[i] = '\0'; } else { objp->custom_default_script_name = NULL; @@ -1739,7 +1739,7 @@ int ReadObject(CFILE *ifile, object *objp, int handle, int fileversion) { i = cf_ReadByte(ifile); if (i > 0) { objp->custom_default_module_name = (char *)mem_malloc(i + 1); - cf_ReadBytes((ubyte *)objp->custom_default_module_name, i, ifile); + cf_ReadBytes((uint8_t *)objp->custom_default_module_name, i, ifile); objp->custom_default_module_name[i] = '\0'; } else { objp->custom_default_module_name = NULL; @@ -2032,7 +2032,7 @@ int ReadFace(CFILE *ifile, face *fp, int version) { // Check to see if there is a lightmap if ((fp->flags & FF_LIGHTMAP) && (version >= 19)) { if (version <= 29) { - ubyte w, h; + uint8_t w, h; w = cf_ReadByte(ifile); h = cf_ReadByte(ifile); @@ -2102,7 +2102,7 @@ int ReadFace(CFILE *ifile, face *fp, int version) { fp->light_multiple = 4; if (version >= 71) { - ubyte special = cf_ReadByte(ifile); + uint8_t special = cf_ReadByte(ifile); if (special) { if (version < 77) // Ignore old specular data { @@ -2113,10 +2113,10 @@ int ReadFace(CFILE *ifile, face *fp, int version) { } else { vector center; - ubyte smooth = 0; - ubyte num_smooth_verts = 0; - ubyte type = cf_ReadByte(ifile); - ubyte num = cf_ReadByte(ifile); + uint8_t smooth = 0; + uint8_t num_smooth_verts = 0; + uint8_t type = cf_ReadByte(ifile); + uint8_t num = cf_ReadByte(ifile); if (version >= 117) { // Read if smoothed @@ -2224,7 +2224,7 @@ void RemoveDegenerateFaces(room *rp) { #define COMPRESS 1 // Does a RLE compression run of the values given the byte array 'val'. -int WriteCompressionByte(CFILE *fp, ubyte *val, int total, int just_count, int compress) { +int WriteCompressionByte(CFILE *fp, uint8_t *val, int total, int just_count, int compress) { int done = 0; int written = 0; int curptr = 0; @@ -2254,8 +2254,8 @@ int WriteCompressionByte(CFILE *fp, ubyte *val, int total, int just_count, int c ASSERT(curptr < total); - ubyte curval = val[curptr]; - ubyte count = 1; + uint8_t curval = val[curptr]; + uint8_t count = 1; while ((curptr + count) < total && val[curptr + count] == curval && count < 250) count++; @@ -2315,7 +2315,7 @@ int WriteCompressionShort(CFILE *fp, ushort *val, int total, int just_count, int ASSERT(curptr < total); ushort curval = val[curptr]; - ubyte count = 1; + uint8_t count = 1; while ((curptr + count) < total && val[curptr + count] == curval && count < 250) count++; @@ -2343,7 +2343,7 @@ int WriteCompressionShort(CFILE *fp, ushort *val, int total, int just_count, int // Given an array of values, checks to see if it would be better to write it out // as a raw array or RLE array -void CheckToWriteCompressByte(CFILE *fp, ubyte *vals, int total) { +void CheckToWriteCompressByte(CFILE *fp, uint8_t *vals, int total) { int count = WriteCompressionByte(fp, vals, total, 1, COMPRESS); if (count >= total) @@ -2363,9 +2363,9 @@ void CheckToWriteCompressShort(CFILE *fp, ushort *vals, int total) { WriteCompressionShort(fp, vals, total, 0, COMPRESS); } -void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) { +void ReadCompressionByte(CFILE *fp, uint8_t *vals, int total) { int count = 0; - ubyte compressed = cf_ReadByte(fp); + uint8_t compressed = cf_ReadByte(fp); if (compressed == 0) { for (int i = 0; i < total; i++) @@ -2376,17 +2376,17 @@ void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) { while (count != total) { ASSERT(count < total); - ubyte command = cf_ReadByte(fp); + uint8_t command = cf_ReadByte(fp); if (command == 0) // next byte is raw { - ubyte height = cf_ReadByte(fp); + uint8_t height = cf_ReadByte(fp); vals[count] = height; count++; } else if (command >= 2 && command <= 250) // next pixel is run of pixels { - ubyte height = cf_ReadByte(fp); + uint8_t height = cf_ReadByte(fp); for (int k = 0; k < command; k++) { vals[count] = height; count++; @@ -2399,7 +2399,7 @@ void ReadCompressionByte(CFILE *fp, ubyte *vals, int total) { void ReadCompressionShort(CFILE *fp, ushort *vals, int total) { int count = 0; - ubyte compressed = cf_ReadByte(fp); + uint8_t compressed = cf_ReadByte(fp); if (compressed == 0) { for (int i = 0; i < total; i++) @@ -2410,7 +2410,7 @@ void ReadCompressionShort(CFILE *fp, ushort *vals, int total) { while (count != total) { ASSERT(count < total); - ubyte command = cf_ReadByte(fp); + uint8_t command = cf_ReadByte(fp); if (command == 0) // next byte is raw { @@ -2576,7 +2576,7 @@ int ReadRoom(CFILE *ifile, room *rp, int version) { if (size) { - rp->volume_lights = (ubyte *)mem_malloc(size); + rp->volume_lights = (uint8_t *)mem_malloc(size); ASSERT(rp->volume_lights); // ran out of memory! } else rp->volume_lights = NULL; @@ -2606,7 +2606,7 @@ int ReadRoom(CFILE *ifile, room *rp, int version) { rp->ambient_sound = -1; // read reverb value for room. - rp->env_reverb = (version >= 98) ? ((ubyte)cf_ReadByte(ifile)) : 0; + rp->env_reverb = (version >= 98) ? ((uint8_t)cf_ReadByte(ifile)) : 0; // Read damage if (version >= 108) { @@ -2702,7 +2702,7 @@ void ReadNewLightmapChunk(CFILE *fp, int version) { for (i = 0; i < nummaps; i++) { int w, h, lmi; - ubyte type; + uint8_t type; if (nummaps >= 50) { if ((i % (nummaps / 50)) == 0) { LoadLevelProgress(LOAD_PROGRESS_LOADING_LEVEL, @@ -2784,7 +2784,7 @@ void ReadLightmapChunk(CFILE *fp, int version) { CHUNK_LIGHTMAPS); } int w, h, lmi; - ubyte type; + uint8_t type; w = cf_ReadInt(fp); h = cf_ReadInt(fp); @@ -2882,7 +2882,7 @@ void ReadTerrainHeightChunk(CFILE *fp, int version) { for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) Terrain_seg[i].ypos = cf_ReadByte(fp); } else { - ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); + uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); ReadCompressionByte(fp, byte_vals, TERRAIN_DEPTH * TERRAIN_WIDTH); for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) { @@ -3324,7 +3324,7 @@ void ReadTerrainSkyAndLightChunk(CFILE *fp, int version) { Terrain_dynamic_table[i] = cf_ReadByte(fp); } } else { - ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); + uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); ReadCompressionByte(fp, byte_vals, TERRAIN_DEPTH * TERRAIN_WIDTH); for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) @@ -3388,7 +3388,7 @@ void ReadTerrainTmapFlagChunk(CFILE *fp, int version) { } } } else { - ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); + uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); ushort *short_vals = (ushort *)mem_malloc(2 * TERRAIN_DEPTH * TERRAIN_WIDTH); if (version < 102) { @@ -3443,7 +3443,7 @@ void ReadTerrainChunks(CFILE *fp, int version) { ResetTerrain(); while (!done) { - cf_ReadBytes((ubyte *)chunk_name, 4, fp); + cf_ReadBytes((uint8_t *)chunk_name, 4, fp); terr_chunk_start = cftell(fp); terr_chunk_size = cf_ReadInt(fp); @@ -3493,7 +3493,7 @@ void ReadPlayerStarts(CFILE *infile, int fileversion) { void VerifyObjectList() { int i; - ubyte already_listed[MAX_OBJECTS]; + uint8_t already_listed[MAX_OBJECTS]; memset(already_listed, 0, MAX_OBJECTS); for (i = 0; i <= Highest_room_index; i++) { @@ -3619,7 +3619,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { filelen = cfilelength(ifile); // Read & check tag - cf_ReadBytes((ubyte *)tag, 4, ifile); + cf_ReadBytes((uint8_t *)tag, 4, ifile); if (strncmp(tag, LEVEL_FILE_TAG, 4)) { cfclose(ifile); retval = 0; @@ -3718,7 +3718,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { while (!cfeof(ifile)) { char chunk_name[4]; - cf_ReadBytes((ubyte *)chunk_name, 4, ifile); + cf_ReadBytes((uint8_t *)chunk_name, 4, ifile); chunk_start = cftell(ifile); chunk_size = cf_ReadInt(ifile); mprintf( @@ -3779,7 +3779,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { } else if (ISCHUNK(CHUNK_OBJECT_HANDLES)) { // Read in any non-zero handles for deleted objects int handle, objnum; - ubyte already_loaded[MAX_OBJECTS]; + uint8_t already_loaded[MAX_OBJECTS]; memset(already_loaded, 0, MAX_OBJECTS); // Get the number of handles in the file @@ -3910,7 +3910,7 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { strcat(path, name); strcat(path, ".scr"); CFILE *ofile = cfopen(path, "wb"); - ubyte buf[1000]; + uint8_t buf[1000]; int n = chunk_size, r; while (n) { r = cf_ReadBytes(buf, std::min(n, sizeof(buf)), ifile); @@ -4077,8 +4077,8 @@ int LoadLevel(char *filename, void (*cb_fn)(const char *, int, int)) { // share 1 lightmap if (version >= 34 && !Dedicated_server) { - ubyte *lightmap_spoken_for = (ubyte *)mem_malloc(MAX_LIGHTMAPS); - ubyte *free_lightmap_info = (ubyte *)mem_malloc(MAX_LIGHTMAP_INFOS); + uint8_t *lightmap_spoken_for = (uint8_t *)mem_malloc(MAX_LIGHTMAPS); + uint8_t *free_lightmap_info = (uint8_t *)mem_malloc(MAX_LIGHTMAP_INFOS); ASSERT(lightmap_spoken_for); memset(lightmap_spoken_for, 0, MAX_LIGHTMAPS); @@ -4212,12 +4212,12 @@ int WriteObject(CFILE *ofile, object *objp) { i = (objp->custom_default_script_name) ? strlen(objp->custom_default_script_name) : 0; cf_WriteByte(ofile, i); if (i > 0) - cf_WriteBytes((ubyte *)objp->custom_default_script_name, i, ofile); + cf_WriteBytes((uint8_t *)objp->custom_default_script_name, i, ofile); i = (objp->custom_default_module_name) ? strlen(objp->custom_default_module_name) : 0; cf_WriteByte(ofile, i); if (i > 0) - cf_WriteBytes((ubyte *)objp->custom_default_module_name, i, ofile); + cf_WriteBytes((uint8_t *)objp->custom_default_module_name, i, ofile); // If there is lightmap data for this object, write it out. if (objp->lighting_render_type == LRT_LIGHTMAPS) { @@ -4322,7 +4322,7 @@ int WriteFace(CFILE *ofile, face *fp) { if (fp->special_handle != BAD_SPECIAL_FACE_INDEX) { // Write out special face stuff - ubyte smooth = 0; + uint8_t smooth = 0; cf_WriteByte(ofile, 1); cf_WriteByte(ofile, SpecialFaces[fp->special_handle].type); cf_WriteByte(ofile, 4); @@ -4458,7 +4458,7 @@ int WriteRoom(CFILE *ofile, room *rp) { int StartChunk(CFILE *ofile, char *chunk_name) { int chunk_start_pos; - cf_WriteBytes((ubyte *)chunk_name, 4, ofile); + cf_WriteBytes((uint8_t *)chunk_name, 4, ofile); chunk_start_pos = cftell(ofile); cf_WriteInt(ofile, 0); // placeholder for chunk len @@ -4487,7 +4487,7 @@ void EndChunk(CFILE *ofile, int chunk_start_pos) { void WriteTerrainHeightChunk(CFILE *fp) { int i; - ubyte heightvals[TERRAIN_WIDTH * TERRAIN_DEPTH]; + uint8_t heightvals[TERRAIN_WIDTH * TERRAIN_DEPTH]; int start_pos; start_pos = StartChunk(fp, CHUNK_TERRAIN_HEIGHT); @@ -4795,7 +4795,7 @@ void WriteTerrainSkyAndLightChunk(CFILE *fp) { } // Write lighting - ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); + uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); // l for (i = 0; i < TERRAIN_DEPTH * TERRAIN_WIDTH; i++) @@ -4840,7 +4840,7 @@ void WriteTerrainSkyAndLightChunk(CFILE *fp) { void WriteTerrainTmapChunk(CFILE *fp) { int i; - ubyte *byte_vals = (ubyte *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); + uint8_t *byte_vals = (uint8_t *)mem_malloc(TERRAIN_DEPTH * TERRAIN_WIDTH); ushort *short_vals = (ushort *)mem_malloc(2 * TERRAIN_DEPTH * TERRAIN_WIDTH); int start_pos; @@ -4884,7 +4884,7 @@ void WriteLightmapChunk(CFILE *fp) { int lightmap_count = 0; ushort *lightmap_remap = (ushort *)mem_malloc(MAX_LIGHTMAPS * sizeof(ushort)); - ubyte *lightmap_spoken_for = (ubyte *)mem_malloc(MAX_LIGHTMAPS); + uint8_t *lightmap_spoken_for = (uint8_t *)mem_malloc(MAX_LIGHTMAPS); ASSERT(lightmap_remap); ASSERT(lightmap_spoken_for); @@ -5055,7 +5055,7 @@ int SaveLevel(char *filename, bool f_save_room_AABB) { try { // catch cfile errors // Write tag & version number - cf_WriteBytes((ubyte *)LEVEL_FILE_TAG, 4, ofile); + cf_WriteBytes((uint8_t *)LEVEL_FILE_TAG, 4, ofile); cf_WriteInt(ofile, LEVEL_FILE_VERSION); WriteGamePathsChunk(ofile); @@ -5318,9 +5318,9 @@ int need_to_page_in = 0; int need_to_page_num = 0; void AlmostPageInGeneric(int id); -ubyte texture_counted[MAX_BITMAPS]; -ubyte sound_counted[MAX_SOUNDS]; -ubyte poly_counted[MAX_POLY_MODELS]; +uint8_t texture_counted[MAX_BITMAPS]; +uint8_t sound_counted[MAX_SOUNDS]; +uint8_t poly_counted[MAX_POLY_MODELS]; void AlmostPageInLevelTexture(int id) { if (id == -1 || id == 0) diff --git a/Descent3/Mission.h b/Descent3/Mission.h index c03e3d53..cb1869fc 100644 --- a/Descent3/Mission.h +++ b/Descent3/Mission.h @@ -225,9 +225,9 @@ typedef struct tLevelNode { char *progress; // File name containing the progress background screen // level branching - ubyte lvlbranch0, lvlbranch1; // FORK or BRANCH command - ubyte secretlvl; // SECRET command - ubyte pad; + uint8_t lvlbranch0, lvlbranch1; // FORK or BRANCH command + uint8_t secretlvl; // SECRET command + uint8_t pad; } tLevelNode; // predefine mission state flags diff --git a/Descent3/OsirisLoadandBind.cpp b/Descent3/OsirisLoadandBind.cpp index f50e278c..b8dd2941 100644 --- a/Descent3/OsirisLoadandBind.cpp +++ b/Descent3/OsirisLoadandBind.cpp @@ -441,23 +441,23 @@ bool Show_osiris_debug = false; #if defined(__LINUX__) typedef char DLLFUNCCALL (*InitializeDLL_fp)(tOSIRISModuleInit *function_list); typedef void DLLFUNCCALL (*ShutdownDLL_fp)(void); -typedef int DLLFUNCCALL (*GetGOScriptID_fp)(const char *name, ubyte isdoor); +typedef int DLLFUNCCALL (*GetGOScriptID_fp)(const char *name, uint8_t isdoor); typedef void DLLFUNCCALL *(*CreateInstance_fp)(int id); typedef void DLLFUNCCALL (*DestroyInstance_fp)(int id, void *ptr); typedef short DLLFUNCCALL (*CallInstanceEvent_fp)(int id, void *ptr, int event, tOSIRISEventInfo *data); typedef int DLLFUNCCALL (*GetTriggerScriptID_fp)(int trigger_room, int trigger_face); typedef int DLLFUNCCALL (*GetCOScriptList_fp)(int **list, int **id_list); -typedef int DLLFUNCCALL (*SaveRestoreState_fp)(void *file_ptr, ubyte saving_state); +typedef int DLLFUNCCALL (*SaveRestoreState_fp)(void *file_ptr, uint8_t saving_state); #else typedef char(DLLFUNCCALL *InitializeDLL_fp)(tOSIRISModuleInit *function_list); typedef void(DLLFUNCCALL *ShutdownDLL_fp)(void); -typedef int(DLLFUNCCALL *GetGOScriptID_fp)(const char *name, ubyte isdoor); +typedef int(DLLFUNCCALL *GetGOScriptID_fp)(const char *name, uint8_t isdoor); typedef void *(DLLFUNCCALL *CreateInstance_fp)(int id); typedef void(DLLFUNCCALL *DestroyInstance_fp)(int id, void *ptr); typedef short(DLLFUNCCALL *CallInstanceEvent_fp)(int id, void *ptr, int event, tOSIRISEventInfo *data); typedef int(DLLFUNCCALL *GetTriggerScriptID_fp)(int trigger_room, int trigger_face); typedef int(DLLFUNCCALL *GetCOScriptList_fp)(int **list, int **id_list); -typedef int(DLLFUNCCALL *SaveRestoreState_fp)(void *file_ptr, ubyte saving_state); +typedef int(DLLFUNCCALL *SaveRestoreState_fp)(void *file_ptr, uint8_t saving_state); #endif typedef struct tRefObj { @@ -468,8 +468,8 @@ typedef struct tRefObj { } tRefObj; typedef struct { - ubyte flags; - ubyte extracted_id; + uint8_t flags; + uint8_t extracted_id; ushort reference_count; InitializeDLL_fp InitializeDLL; ShutdownDLL_fp ShutdownDLL; @@ -508,7 +508,7 @@ struct { #define OESF_USED 0x0001 #define OESF_MISSION 0x0002 // mission dlls typedef struct { - ubyte flags; + uint8_t flags; char *temp_filename; char *real_filename; } tExtractedScriptInfo; @@ -545,7 +545,7 @@ static void Osiris_ForceUnloadModules(void); uint32_t Osiris_game_checksum; -static ubyte Osiris_event_mask = OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS; +static uint8_t Osiris_event_mask = OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS; static bool Osiris_create_events_disabled = false; static bool Osiris_level_script_loaded = false; @@ -2075,12 +2075,12 @@ bool Osiris_CallTriggerEvent(int trignum, int event, tOSIRISEventInfo *ei) { // Osiris_EnableEvents // Purpose: // Enables the passed in mask of event types to be called -void Osiris_EnableEvents(ubyte mask) { Osiris_event_mask |= mask; } +void Osiris_EnableEvents(uint8_t mask) { Osiris_event_mask |= mask; } // Osiris_DisableEvents // Purpose: // Disables the passed in mask of event types -void Osiris_DisableEvents(ubyte mask) { Osiris_event_mask &= ~mask; } +void Osiris_DisableEvents(uint8_t mask) { Osiris_event_mask &= ~mask; } // Osiris_DisableCreateEvents // Purpose: @@ -2534,7 +2534,7 @@ void Osiris_CancelTimerID(int id) { // Osiris_TimerExists // Purpose: // Returns true if the timer is valid -ubyte Osiris_TimerExists(int handle) { +uint8_t Osiris_TimerExists(int handle) { int id = GET_SLOT(handle); if (id < 0 || id >= MAX_OSIRIS_TIMERS) @@ -2636,7 +2636,7 @@ void Osiris_SaveSystemState(CFILE *file) { // get the length of the module name int module_name_length = strlen(OSIRIS_loaded_modules[i].module_name) + 1; cf_WriteByte(file, module_name_length); - cf_WriteBytes((ubyte *)OSIRIS_loaded_modules[i].module_name, module_name_length, file); + cf_WriteBytes((uint8_t *)OSIRIS_loaded_modules[i].module_name, module_name_length, file); // now here is the tricky part, save the current fileposition, write a dummy 0 int int saved_file_pos = cftell(file); @@ -2696,7 +2696,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { return false; } - ubyte version = (ubyte)cf_ReadByte(file); + uint8_t version = (uint8_t)cf_ReadByte(file); num_bytes_to_be_restored = cf_ReadInt(file); @@ -2765,7 +2765,7 @@ bool Osiris_RestoreSystemState(CFILE *file) { int module_handle; read_module_namelen = cf_ReadByte(file); - cf_ReadBytes((ubyte *)read_module_name, read_module_namelen, file); + cf_ReadBytes((uint8_t *)read_module_name, read_module_namelen, file); read_module_name[read_module_namelen] = '\0'; read_module_globalsize = cf_ReadInt(file); @@ -3019,7 +3019,7 @@ void Osiris_SaveMemoryChunks(CFILE *file) { break; } cf_WriteInt(file, curr->chunk_id.id); - cf_WriteBytes((ubyte *)curr->memory, curr->chunk_id.size, file); + cf_WriteBytes((uint8_t *)curr->memory, curr->chunk_id.size, file); curr = curr->next; } @@ -3072,7 +3072,7 @@ void Osiris_RestoreMemoryChunks(CFILE *file) { if (!memchunk->memory) { Error("Out of memory"); } - cf_ReadBytes((ubyte *)memchunk->memory, memchunk->chunk_id.size, file); + cf_ReadBytes((uint8_t *)memchunk->memory, memchunk->chunk_id.size, file); memchunk->next = NULL; // ok, the node is setup, add it to the linked list @@ -3328,7 +3328,7 @@ OMMSHANDLE OMMS_Find(uint32_t unique_identifier,char *script_identifier); // Returns information about the OMMS memory given it's handle returned from the OMMS_Find() or // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in; // Pass NULL in for those parameters you don't need information about. -char OMMS_GetInfo(OMMSHANDLE handle,uint32_t *mem_size,uint32_t *uid,ushort *reference_count,ubyte *has_free_been_called); +char OMMS_GetInfo(OMMSHANDLE handle,uint32_t *mem_size,uint32_t *uid,ushort *reference_count,uint8_t *has_free_been_called); ****************************************************************************** @@ -3412,7 +3412,7 @@ static OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_iden // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in; // Pass NULL in for those parameters you don't need information about. static char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count, - ubyte *has_free_been_called); + uint8_t *has_free_been_called); void Osiris_InitOMMS(void) { OMMS_Current_base_id = 0; @@ -3451,7 +3451,7 @@ void Osiris_SaveOMMS(CFILE *file) { length = (currhash->script_name) ? strlen(currhash->script_name) : 0; cf_WriteByte(file, length); if (length) - cf_WriteBytes((ubyte *)currhash->script_name, length, file); + cf_WriteBytes((uint8_t *)currhash->script_name, length, file); // now go through all the nodes and write their data tOMMSNode *node; @@ -3467,7 +3467,7 @@ void Osiris_SaveOMMS(CFILE *file) { cf_WriteInt(file, node->unique_id); cf_WriteInt(file, node->size_of_memory); if (node->size_of_memory) - cf_WriteBytes((ubyte *)node->memory_ptr, node->size_of_memory, file); + cf_WriteBytes((uint8_t *)node->memory_ptr, node->size_of_memory, file); node = node->next; } @@ -3518,7 +3518,7 @@ void Osiris_RestoreOMMS(CFILE *file) { if (!currhash->script_name) Error("Out of Memory"); else - cf_ReadBytes((ubyte *)currhash->script_name, length, file); + cf_ReadBytes((uint8_t *)currhash->script_name, length, file); } node = NULL; @@ -3549,7 +3549,7 @@ void Osiris_RestoreOMMS(CFILE *file) { if (!node->memory_ptr) Error("Out of memory"); - cf_ReadBytes((ubyte *)node->memory_ptr, node->size_of_memory, file); + cf_ReadBytes((uint8_t *)node->memory_ptr, node->size_of_memory, file); } } // end reading nodes } // end reading hash nodes @@ -3870,7 +3870,7 @@ OMMSHANDLE Osiris_OMMS_Find(uint32_t unique_identifier, char *script_identifier) // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in; // Pass NULL in for those parameters you don't need information about. char Osiris_OMMS_GetInfo(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count, - ubyte *has_free_been_called) { + uint8_t *has_free_been_called) { if (mem_size) *mem_size = 0; if (uid) diff --git a/Descent3/PilotPicsAPI.cpp b/Descent3/PilotPicsAPI.cpp index 1a4ea6f6..923089f6 100644 --- a/Descent3/PilotPicsAPI.cpp +++ b/Descent3/PilotPicsAPI.cpp @@ -226,14 +226,14 @@ ushort PPic_QueryPilot(char *pilot_name) { // now read through the pilots until we don't get a match anymore while (!done) { // first read in the pilot name - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(file); if (cfeof(file)) { done = true; continue; } - cf_ReadBytes((ubyte *)name_buffer, name_size, file); + cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; // next read in pilot_id @@ -241,7 +241,7 @@ ushort PPic_QueryPilot(char *pilot_name) { pilot_id = (ushort)cf_ReadShort(file); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; bmp_size = cf_ReadByte(file); cfseek(file, bmp_size, SEEK_CUR); @@ -282,12 +282,12 @@ bool PPic_FindFirst(char *pilot_name, ushort *pilot_id) { CFILE *file = PilotPic_database_index_handle; // first read in the pilot name - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(file); if (cfeof(file)) { return false; } - cf_ReadBytes((ubyte *)name_buffer, name_size, file); + cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; // next read in pilot_id @@ -295,7 +295,7 @@ bool PPic_FindFirst(char *pilot_name, ushort *pilot_id) { pid = (ushort)cf_ReadShort(file); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; bmp_size = cf_ReadByte(file); cfseek(file, bmp_size, SEEK_CUR); @@ -332,12 +332,12 @@ bool PPic_FindNext(ushort *pilot_id) { } // first read in the pilot name - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(file); if (cfeof(file)) { return false; } - cf_ReadBytes((ubyte *)name_buffer, name_size, file); + cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; // next read in pilot_id @@ -345,7 +345,7 @@ bool PPic_FindNext(ushort *pilot_id) { pid = (ushort)cf_ReadShort(file); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; bmp_size = cf_ReadByte(file); cfseek(file, bmp_size, SEEK_CUR); @@ -395,14 +395,14 @@ bool PPic_GetPilot(ushort pilot_id, char *pilot_name, int buffersize) { // read in the pilot name // ---------------------- - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(PilotPic_database_index_handle); if (cfeof(PilotPic_database_index_handle)) { cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET); return false; } int toread = std::min(name_size, buffersize - 1); - cf_ReadBytes((ubyte *)pilot_name, toread, PilotPic_database_index_handle); + cf_ReadBytes((uint8_t *)pilot_name, toread, PilotPic_database_index_handle); pilot_name[toread] = '\0'; cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET); @@ -437,14 +437,14 @@ int PPic_GetBitmapHandle(ushort pilot_id) { // read in the pilot name // ---------------------- - ubyte name_size; + uint8_t name_size; char name_buffer[PILOT_STRING_SIZE]; name_size = cf_ReadByte(PilotPic_database_index_handle); if (cfeof(PilotPic_database_index_handle)) { cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET); return -1; } - cf_ReadBytes((ubyte *)name_buffer, name_size, PilotPic_database_index_handle); + cf_ReadBytes((uint8_t *)name_buffer, name_size, PilotPic_database_index_handle); name_buffer[name_size] = '\0'; // next read in pilot_id @@ -452,10 +452,10 @@ int PPic_GetBitmapHandle(ushort pilot_id) { pid = (ushort)cf_ReadShort(PilotPic_database_index_handle); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; char bitmap_name[_MAX_PATH]; bmp_size = cf_ReadByte(PilotPic_database_index_handle); - cf_ReadBytes((ubyte *)bitmap_name, bmp_size, PilotPic_database_index_handle); + cf_ReadBytes((uint8_t *)bitmap_name, bmp_size, PilotPic_database_index_handle); bitmap_name[bmp_size] = '\0'; cfseek(PilotPic_database_index_handle, oldoffset, SEEK_SET); @@ -542,9 +542,9 @@ bool PPic_BuildDatabases(void) { file_pos = cftell(file); // first read in the pilot name - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(file); - cf_ReadBytes((ubyte *)name_buffer, name_size, file); + cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; if (name_size >= PILOT_STRING_SIZE) { mprintf((0, "PPIC: Too big: (%s)%d %d", name_buffer, count, name_size)); @@ -555,7 +555,7 @@ bool PPic_BuildDatabases(void) { pilot_id = (ushort)cf_ReadShort(file); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; bmp_size = cf_ReadByte(file); cfseek(file, bmp_size, SEEK_CUR); @@ -658,13 +658,13 @@ int PPic_JumpToPilot(char *pilot_name) { file_pos = cftell(file); // first read in the pilot name - ubyte name_size; + uint8_t name_size; name_size = cf_ReadByte(file); if (cfeof(file)) { done = true; continue; } - cf_ReadBytes((ubyte *)name_buffer, name_size, file); + cf_ReadBytes((uint8_t *)name_buffer, name_size, file); name_buffer[name_size] = '\0'; // next read in pilot_id @@ -672,7 +672,7 @@ int PPic_JumpToPilot(char *pilot_name) { pilot_id = (ushort)cf_ReadShort(file); // next read past the bitmap name - ubyte bmp_size; + uint8_t bmp_size; bmp_size = cf_ReadByte(file); cfseek(file, bmp_size, SEEK_CUR); diff --git a/Descent3/Player.cpp b/Descent3/Player.cpp index ae8df98e..a45238ef 100644 --- a/Descent3/Player.cpp +++ b/Descent3/Player.cpp @@ -2034,7 +2034,7 @@ typedef struct tDeathSeq { float accel_mod; vector force_dir; - ubyte saved_ctrl_type; + uint8_t saved_ctrl_type; uint32_t saved_phys_flags; float saved_drag; vector saved_rotthrust; @@ -3564,7 +3564,7 @@ void PlayerStopObserving(int slot) { } if (slot == Player_num) { - ubyte hud_mode; + uint8_t hud_mode; Current_pilot.get_hud_data(&hud_mode); AddHUDMessage(TXT_LEAVEOBS); SetHUDMode((tHUDMode)hud_mode); @@ -3889,7 +3889,7 @@ void PlayerScoreAdd(int playernum, int points) { //////////////////////////////////////////////////// // Thief interface functions //////////////////////////////////////////////////// -extern ubyte AutomapVisMap[MAX_ROOMS]; +extern uint8_t AutomapVisMap[MAX_ROOMS]; void MakeObjectVisible(object *obj); // steals an item from the given player diff --git a/Descent3/TelCom.cpp b/Descent3/TelCom.cpp index 37a42756..21cf67cd 100644 --- a/Descent3/TelCom.cpp +++ b/Descent3/TelCom.cpp @@ -796,8 +796,8 @@ bool TelComShow(bool ingame, bool ShipSelect) { // must do this to clear out keyboard events ddio_KeyFlush(); - ubyte oldmip = Render_preferred_state.mipping; - ubyte oldbil = Render_preferred_state.filtering; + uint8_t oldmip = Render_preferred_state.mipping; + uint8_t oldbil = Render_preferred_state.filtering; if (!TelCom_init) { mprintf((0, "TELCOM SYSTEM WARNING: TelComInit() error!\n")); @@ -1482,7 +1482,7 @@ void TelcomRenderClose(void) { } // Renders the current screen for 1 frame -void TelcomRenderScreen(bool poweron, bool powerup, ubyte power_effect) { +void TelcomRenderScreen(bool poweron, bool powerup, uint8_t power_effect) { if (TC_current_screen == -1) return; @@ -2157,7 +2157,7 @@ void TelcomCreateStaticOverlays(void) { if ((int)myrand(5) == 3) data[i + 4][j] = def_color; else { - ubyte grey = (ubyte)myrand(200) + 55; + uint8_t grey = (uint8_t)myrand(200) + 55; data[i + 4][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey); } } else @@ -2170,7 +2170,7 @@ void TelcomCreateStaticOverlays(void) { if ((int)myrand(5) == 3) data[i][j] = def_color; else { - ubyte grey = (ubyte)myrand(200) + 55; + uint8_t grey = (uint8_t)myrand(200) + 55; data[i][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey); } } else @@ -2188,7 +2188,7 @@ void TelcomCreateStaticOverlays(void) { if ((int)myrand(5) == 3) data[i][j] = def_color; else { - ubyte grey = (ubyte)myrand(200) + 55; + uint8_t grey = (uint8_t)myrand(200) + 55; data[i][j] = OPAQUE_FLAG | GR_RGB16(grey, grey, grey); } } else @@ -3797,7 +3797,7 @@ void TCSSSCallback(void) { EndFrame(); // Render the name of the selected ship - ubyte old_alpha = grtext_GetAlpha(); + uint8_t old_alpha = grtext_GetAlpha(); int old_font = grtext_GetFont(); ddgr_color old_color = grtext_GetColor(); grtext_SetAlpha(255); diff --git a/Descent3/TelCom.h b/Descent3/TelCom.h index b53b266d..77675dab 100644 --- a/Descent3/TelCom.h +++ b/Descent3/TelCom.h @@ -178,13 +178,13 @@ typedef struct { typedef struct tTelComInfo { box Monitor_coords[MAX_MONITOR]; - ubyte Screen_state[MAX_TELCOM_SCREENS]; + uint8_t Screen_state[MAX_TELCOM_SCREENS]; tTCEvent Telcom_event_queue[MAX_TELCOM_EVENTS]; // Event queue for TelCom System int TranslateSysKey[TCSYS_MAXKEYS]; int current_status; bool Telcom_systemkey_states[TCSYS_MAXKEYS]; float Telcom_mouse_downtime; - ubyte state; + uint8_t state; int TelComSysKeyEnable; } tTelComInfo; extern tTelComInfo Telcom_system; @@ -200,7 +200,7 @@ void TelcomRenderInit(void); // Closes down the Telcom rendering engine void TelcomRenderClose(void); // Renders the current screen for 1 frame -void TelcomRenderScreen(bool poweron = true, bool powerup = false, ubyte power_effect = 1); +void TelcomRenderScreen(bool poweron = true, bool powerup = false, uint8_t power_effect = 1); // Sets what screen should be drawn by the Telcom void TelcomRenderSetScreen(int screen); // Sets the callback of the Render. This will get called after Effects are drawn, before the screen overlays diff --git a/Descent3/TelComAutoMap.cpp b/Descent3/TelComAutoMap.cpp index 58f2ffd5..a21d3c1f 100644 --- a/Descent3/TelComAutoMap.cpp +++ b/Descent3/TelComAutoMap.cpp @@ -184,7 +184,7 @@ static matrix AM_view_orient; static tTelComInfo *AM_tcs; static int AM_ship_model_handle = -1; -ubyte AutomapVisMap[MAX_ROOMS]; +uint8_t AutomapVisMap[MAX_ROOMS]; static float AM_heading; static float AM_pitch; @@ -193,12 +193,12 @@ int AM_terrain = 0, AM_realign = 0, AM_center_on_player = 0, AM_current_marker; static int Num_AM_rooms; static ushort AM_room_list[MAX_ROOMS]; -static ubyte AM_rooms_seen[MAX_ROOMS]; +static uint8_t AM_rooms_seen[MAX_ROOMS]; static g3Point *AM_rotated_points = NULL; //[MAX_VERTS_PER_ROOM]; static void TCAMCallback(void); -static ubyte *Small_faces[MAX_ROOMS]; +static uint8_t *Small_faces[MAX_ROOMS]; // clears out the list of visible rooms that we've seen void AutomapClearVisMap() { memset(AutomapVisMap, 0, MAX_ROOMS); } @@ -207,7 +207,7 @@ void ClassifyAMFaces() { int i = 0; for (i = 0; i <= Highest_room_index; i++) { if (Rooms[i].used) { - Small_faces[i] = (ubyte *)mem_malloc(Rooms[i].num_faces); + Small_faces[i] = (uint8_t *)mem_malloc(Rooms[i].num_faces); ASSERT(Small_faces[i]); memset(Small_faces[i], 0, Rooms[i].num_faces); @@ -418,14 +418,14 @@ void MakePointsFromMinMax(vector *corners, vector *minp, vector *maxp); // Else returns false bool IsRoomVisible(room *rp, float *nearz) { g3Point pnt; - ubyte ccode; + uint8_t ccode; vector corners[8]; MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); *nearz = 90000000; - ubyte andbyte = 0xff; + uint8_t andbyte = 0xff; for (int t = 0; t < 8; t++) { g3_RotatePoint(&pnt, &corners[t]); diff --git a/Descent3/TelComAutoMap.h b/Descent3/TelComAutoMap.h index 1ce2ed32..736967a8 100644 --- a/Descent3/TelComAutoMap.h +++ b/Descent3/TelComAutoMap.h @@ -55,6 +55,6 @@ bool TelComAutoMap(tTelComInfo *tcs); void AutomapClearVisMap(); -extern ubyte AutomapVisMap[]; +extern uint8_t AutomapVisMap[]; #endif diff --git a/Descent3/TelComCargo.cpp b/Descent3/TelComCargo.cpp index 5d0a1a21..136dfea2 100644 --- a/Descent3/TelComCargo.cpp +++ b/Descent3/TelComCargo.cpp @@ -120,7 +120,7 @@ #define LID_INVENTORY 5 typedef struct { - ubyte type; + uint8_t type; const char *name; int id; } tLineInfo; diff --git a/Descent3/TelComEffects.h b/Descent3/TelComEffects.h index 59d086e2..abcabad3 100644 --- a/Descent3/TelComEffects.h +++ b/Descent3/TelComEffects.h @@ -227,8 +227,8 @@ typedef struct { typedef struct { bool flash_state; // Is the button glowing? - ubyte click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to) - ubyte button_type; + uint8_t click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to) + uint8_t button_type; int sibling; // Sibling effect (for down/up arrows), -1 if none int parent; // Parent effect (text for down/up arrows), -1 if it works with TelCom System int bm_handle; @@ -246,9 +246,9 @@ typedef struct { } tButtonInfo; typedef struct { - ubyte type; // Type of effect - ubyte monitor; // Which monitor it belongs to - ubyte screen; // What screen the effect belongs to + uint8_t type; // Type of effect + uint8_t monitor; // Which monitor it belongs to + uint8_t screen; // What screen the effect belongs to bool tab_stop; // This effect can have focus bool has_focus; // The effect currently has focus diff --git a/Descent3/TelComEfxStructs.h b/Descent3/TelComEfxStructs.h index 9baf519e..aeb911ae 100644 --- a/Descent3/TelComEfxStructs.h +++ b/Descent3/TelComEfxStructs.h @@ -286,8 +286,8 @@ typedef struct { int jump_page; void (*internal)(int); float flash_time; - ubyte button_type; // Up arrow, Down Arrow, TelCom System - ubyte click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to) + uint8_t button_type; // Up arrow, Down Arrow, TelCom System + uint8_t click_type; // CLICKTYPE_DOWN or CLICKTYPE_CLICK (what the button responds to) bool flasher; bool tab_stop; uint32_t mission_mask_set, mission_mask_unset; // mission flag mask diff --git a/Descent3/TelComGoals.cpp b/Descent3/TelComGoals.cpp index ebf99ce7..63af847f 100644 --- a/Descent3/TelComGoals.cpp +++ b/Descent3/TelComGoals.cpp @@ -493,8 +493,8 @@ void TCGoalsRenderCallback(void) { rend_SetAlphaValue(255.0); rend_SetFiltering(1); } else { - ubyte alpha_to_use; - alpha_to_use = (ubyte)active_alpha; + uint8_t alpha_to_use; + alpha_to_use = (uint8_t)active_alpha; grtext_SetAlpha(alpha_to_use); } } diff --git a/Descent3/TelcomEffectsRender.cpp b/Descent3/TelcomEffectsRender.cpp index d059e448..a6e0222f 100644 --- a/Descent3/TelcomEffectsRender.cpp +++ b/Descent3/TelcomEffectsRender.cpp @@ -111,7 +111,7 @@ void RenderTextStatic(tceffect *tce, float frametime, int xoff, int yoff, bool o color_to_use = DISABLED_TEXT_COLOR; } } - ubyte old_alpha = grtext_GetAlpha(); + uint8_t old_alpha = grtext_GetAlpha(); grtext_SetFont(Game_fonts[tce->textinfo.font_index]); grtext_SetColor(color_to_use); grtext_SetAlpha(tce->alpha); @@ -202,7 +202,7 @@ void RenderTextType(tceffect *tce, float frametime, int xoff, int yoff, bool ok_ strcpy(temp, tce->text_buffer); temp[ll] = '\0'; - ubyte old_alpha = grtext_GetAlpha(); + uint8_t old_alpha = grtext_GetAlpha(); grtext_SetFont(Game_fonts[tce->textinfo.font_index]); char buff[1024]; const char *nextline; @@ -368,7 +368,7 @@ void RenderTextFade(tceffect *tce, float frametime, int xoff, int yoff, bool ok_ color_to_use = DISABLED_TEXT_COLOR; } } - ubyte old_alpha = grtext_GetAlpha(); + uint8_t old_alpha = grtext_GetAlpha(); grtext_SetFont(Game_fonts[tce->textinfo.font_index]); grtext_SetColor(color_to_use); grtext_SetAlpha(alpha); @@ -645,7 +645,7 @@ void RenderBmpInvert(tceffect *tce, float frametime, int xoff, int yoff, bool ok if (tce->flags == TC_BMPF_OUT) k = 1 - k; inv = 255 - (255.0f * k); - ubyte r, g, b; + uint8_t r, g, b; int bh = bm_h(srcbmph, 0); int bw = bm_w(srcbmph, 0); int how_many = tce->bmpinfo.chunk_bmp.w * tce->bmpinfo.chunk_bmp.h; diff --git a/Descent3/TerrainSearch.cpp b/Descent3/TerrainSearch.cpp index 01a83b23..d86f0ca2 100644 --- a/Descent3/TerrainSearch.cpp +++ b/Descent3/TerrainSearch.cpp @@ -245,7 +245,7 @@ static lodoff LODOffs[MAX_LODOFFS]; static int Num_lodoffs = 0; // Render the terrain as flat? -ubyte Flat_terrain = 0; +uint8_t Flat_terrain = 0; // Variables for LOD engine static float ViewDistance1 = .68f, ViewDistance2 = 1.0f; @@ -257,7 +257,7 @@ static vector *TS_View_position; static vector TS_PreRows[TERRAIN_DEPTH]; static vector TS_FVectorAdd, TS_RVectorAdd; -static ubyte Terrain_y_flags[256]; +static uint8_t Terrain_y_flags[256]; static vector Terrain_y_cache[256]; static ushort LOD_sort_bucket[MAX_TERRAIN_LOD][MAX_CELLS_TO_RENDER]; @@ -433,7 +433,7 @@ int GetVisibleTerrain(vector *eye, matrix *view_orient) { return cellcount; } -__inline void CheckCellOccupancy(int x, int y, int *ccount, ubyte lod) { +__inline void CheckCellOccupancy(int x, int y, int *ccount, uint8_t lod) { int n, simplemul, i; if (*ccount >= MAX_CELLS_TO_RENDER) { @@ -511,10 +511,10 @@ int SearchQuadTree(int x1, int y1, int x2, int y2, int dir, int *ccount) { int stack_y2[200]; int stack_level[200]; float testdist = VisibleTerrainZ; - ubyte ymin_int[4], ymax_int[4]; + uint8_t ymin_int[4], ymax_int[4]; int close; - ubyte same_side; - ubyte check_portal = 0; + uint8_t same_side; + uint8_t check_portal = 0; g3Point *pnt; int use_occlusion = 0; int src_occlusion_index; @@ -633,7 +633,7 @@ int SearchQuadTree(int x1, int y1, int x2, int y2, int dir, int *ccount) { anded = 0xff; same_side = 0xff; - ubyte portal_and = 0xff; + uint8_t portal_and = 0xff; for (i = 0; i < 4; i++) { if (first) { diff --git a/Descent3/WeaponFire.cpp b/Descent3/WeaponFire.cpp index 2f6febf1..dc027ced 100644 --- a/Descent3/WeaponFire.cpp +++ b/Descent3/WeaponFire.cpp @@ -1215,7 +1215,7 @@ int CreateAndFireWeapon(vector *pos, vector *dir, object *parent, int weapon_num int objnum; object *obj; int parentnum = parent - Objects; - ubyte terrain = 0; + uint8_t terrain = 0; ASSERT(Weapons[weapon_num].used); @@ -2277,7 +2277,7 @@ void DoFusionEffect(object *objp, int weapon_type) { } // Do the spray effect -void DoSprayEffect(object *obj, otype_wb_info *static_wb, ubyte wb_index) { +void DoSprayEffect(object *obj, otype_wb_info *static_wb, uint8_t wb_index) { vector laser_pos, laser_dir; int cur_m_bit; @@ -2664,7 +2664,7 @@ void StopOnOffWeapon(object *obj) { } // Starts an on/off weapon firing -void StartOnOffWeapon(object *obj, ubyte wb_index) { +void StartOnOffWeapon(object *obj, uint8_t wb_index) { // mprintf ((0,"Starting on/off weapon!\n")); obj->weapon_fire_flags |= WFF_ON_OFF; @@ -2694,7 +2694,7 @@ void DoZoomStay() { } // Zooms in for this weapon -void DoZoomEffect(player_weapon *pw, ubyte clear) { +void DoZoomEffect(player_weapon *pw, uint8_t clear) { if (pw->firing_time < .5) { Players[Player_num].turn_scalar = 1.0; Render_FOV = D3_DEFAULT_FOV; diff --git a/Descent3/aistruct.h b/Descent3/aistruct.h index 8f7d8f44..8b344671 100644 --- a/Descent3/aistruct.h +++ b/Descent3/aistruct.h @@ -494,8 +494,8 @@ typedef struct ai_path_info { int goal_index; // Used by all paths - ubyte path_id[MAX_JOINED_PATHS]; - ubyte path_type[MAX_JOINED_PATHS]; + uint8_t path_id[MAX_JOINED_PATHS]; + uint8_t path_type[MAX_JOINED_PATHS]; // Used for static game paths ushort path_start_node[MAX_JOINED_PATHS]; @@ -551,8 +551,8 @@ typedef struct goal_enabler { typedef struct gi_fire { short cur_wb; // for ranged attack - ubyte cur_mask; // for ranged attack - ubyte melee_number; // this could be union'ed but it makes this struct word aligned + uint8_t cur_mask; // for ranged attack + uint8_t melee_number; // this could be union'ed but it makes this struct word aligned } gi_fire; typedef struct g_steer { @@ -624,7 +624,7 @@ typedef struct goal_info { typedef struct goal { uint32_t type; char subtype; - ubyte activation_level; + uint8_t activation_level; float creation_time; float min_influence; diff --git a/Descent3/aiterrain.cpp b/Descent3/aiterrain.cpp index 1480688e..07f9fa10 100644 --- a/Descent3/aiterrain.cpp +++ b/Descent3/aiterrain.cpp @@ -58,7 +58,7 @@ #define AI_MAX_SEGS_CHECKED 200 static int ai_num_segs_checked = 0; -static ubyte ai_terrain_check_list[((TERRAIN_WIDTH * TERRAIN_DEPTH) >> 3) + 1]; +static uint8_t ai_terrain_check_list[((TERRAIN_WIDTH * TERRAIN_DEPTH) >> 3) + 1]; static int ai_segs_checked[AI_MAX_SEGS_CHECKED]; #ifdef _DEBUG static int ai_num_checks_since_init = 0; diff --git a/Descent3/ambient.cpp b/Descent3/ambient.cpp index 718c901e..e0f86184 100644 --- a/Descent3/ambient.cpp +++ b/Descent3/ambient.cpp @@ -305,7 +305,7 @@ void WriteAmbientData() { } // Write file ID & version - cf_WriteBytes((ubyte *)AMBIENT_FILE_ID, strlen(AMBIENT_FILE_ID), ofile); + cf_WriteBytes((uint8_t *)AMBIENT_FILE_ID, strlen(AMBIENT_FILE_ID), ofile); cf_WriteInt(ofile, AMBIENT_FILE_VERSION); // Write the number of patterns diff --git a/Descent3/audiotaunts.cpp b/Descent3/audiotaunts.cpp index 24fb28d3..021ba087 100644 --- a/Descent3/audiotaunts.cpp +++ b/Descent3/audiotaunts.cpp @@ -224,7 +224,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { int samples, rate, chan; char temp_filename[_MAX_PATH]; char osftemp_filename[_MAX_PATH]; - ubyte *StaticFileBuffer = NULL; + uint8_t *StaticFileBuffer = NULL; *temp_filename = *osftemp_filename = '\0'; OSFArchive osf; CFILE *fpin = NULL; @@ -319,7 +319,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { wavdata.sample_16bit[count] = INTEL_SHORT(wavdata.sample_16bit[count]); } - cf_WriteBytes((ubyte *)wavdata.sample_16bit,amount_to_flush,file); + cf_WriteBytes((uint8_t *)wavdata.sample_16bit,amount_to_flush,file); }else{ mprintf((0,"TAUNT: Confusion to bits per sample (%d)\n",wavdata.bits_per_sample)); ret = false; @@ -339,7 +339,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { wavdata.sample_16bit[count] = INTEL_SHORT(wavdata.sample_16bit[count]); } - cf_WriteBytes((ubyte *)wavdata.sample_16bit, amount_to_flush, file); + cf_WriteBytes((uint8_t *)wavdata.sample_16bit, amount_to_flush, file); cfclose(file); file = NULL; @@ -369,7 +369,7 @@ bool taunt_ImportWave(char *wave_filename, char *outputfilename) { uint32_t filelen, nblocks, i; int format; - StaticFileBuffer = (ubyte *)mem_malloc(FILEBUFFER_LENGTH); + StaticFileBuffer = (uint8_t *)mem_malloc(FILEBUFFER_LENGTH); if (!StaticFileBuffer) { ret = false; mprintf((0, "Out of memory\n")); @@ -711,9 +711,9 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { wave->sample_length = aligned_size; wave->np_sample_length = cksize; - wave->sample_8bit = (ubyte *)mem_malloc(aligned_size); + wave->sample_8bit = (uint8_t *)mem_malloc(aligned_size); - cf_ReadBytes((ubyte *)wave->sample_8bit, cksize, cfptr); + cf_ReadBytes((uint8_t *)wave->sample_8bit, cksize, cfptr); if (aligned_size != cksize) memset(wave->sample_8bit + cksize, 128, num_needed); @@ -730,7 +730,7 @@ char taunt_LoadWaveFile(char *filename, tWaveFile *wave) { wave->sample_16bit = (short *)mem_malloc(cksize + num_needed); - cf_ReadBytes((ubyte *)wave->sample_16bit, cksize, cfptr); + cf_ReadBytes((uint8_t *)wave->sample_16bit, cksize, cfptr); for (count = 0; count < (int)cksize / 2; count++) { wave->sample_16bit[count] = INTEL_SHORT(wave->sample_16bit[count]); } diff --git a/Descent3/bsp.cpp b/Descent3/bsp.cpp index 92652aa0..f82f90c9 100644 --- a/Descent3/bsp.cpp +++ b/Descent3/bsp.cpp @@ -56,13 +56,13 @@ #define BSP_TREE_VERSION 10003 bsptree MineBSP; -ubyte BSP_initted = 0; +uint8_t BSP_initted = 0; static int ConvexSubspaces = 0, ConvexPolys = 0; static int Solids = 0, Empty = 0; int BSPChecksum = -1; // TODO: MTS: Only used here? -ubyte UseBSP = 0; +uint8_t UseBSP = 0; // Goes through all the valid points in the indoor engine and returns a unique // checksum @@ -213,7 +213,7 @@ void SaveBSPNode(CFILE *outfile, bspnode *node) { // Loads a bsp node from an open file and recurses with its children void LoadBSPNode(CFILE *infile, bspnode **node) { // Get the node type - ubyte type = cf_ReadByte(infile); + uint8_t type = cf_ReadByte(infile); // Allocate the node and set its type *node = NewBSPNode(); @@ -449,8 +449,8 @@ int SplitPolygon(bspplane *plane, bsppolygon *testpoly, bsppolygon **frontpoly, } char Twirly[] = {'|', '/', '-', '\\'}; -ubyte Plane_twirl = 0; -ubyte Node_twirl = 0; +uint8_t Plane_twirl = 0; +uint8_t Node_twirl = 0; // Selects the best plane to partition with, returning the pointer to polygon to split with bsppolygon *SelectPlane(list **polylist) { diff --git a/Descent3/bsp.h b/Descent3/bsp.h index e3d4277e..d5f18775 100644 --- a/Descent3/bsp.h +++ b/Descent3/bsp.h @@ -59,7 +59,7 @@ typedef struct { float a, b, c, d; - ubyte used; + uint8_t used; } bspplane; typedef struct { @@ -76,7 +76,7 @@ typedef struct { } bsppolygon; typedef struct bspnode { - ubyte type; + uint8_t type; bspplane plane; ushort node_facenum; ushort node_roomnum; @@ -126,7 +126,7 @@ int BSPGetMineChecksum(); extern bsptree MineBSP; extern int BSPChecksum; -extern ubyte BSP_initted; -extern ubyte UseBSP; +extern uint8_t BSP_initted; +extern uint8_t UseBSP; #endif diff --git a/Descent3/buddymenu.cpp b/Descent3/buddymenu.cpp index 64f3297d..38df0aa5 100644 --- a/Descent3/buddymenu.cpp +++ b/Descent3/buddymenu.cpp @@ -184,7 +184,7 @@ void BuddyDisplay(void) { static void MultiAskforGuidebotMenu() { int size_offset; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // Only process this if we are the client if (Netgame.local_role != LR_CLIENT) { Int3(); // We shouldn't be here... get Kevin @@ -196,7 +196,7 @@ static void MultiAskforGuidebotMenu() { nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count); } -static void MultiStuffGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) { +static void MultiStuffGuidebotMenuData(uint8_t *data, int *count, gb_menu *menu) { int i; // Get the menu data and stick it here // length of the title @@ -227,7 +227,7 @@ static void MultiStuffGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) { void MultiSendGuidebotMenuSelection(gb_com *command) { int size_offset; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // Only process this if we are the client if (Netgame.local_role != LR_CLIENT) { @@ -258,7 +258,7 @@ static void MultiSendGuidebotMenuText(gb_menu *menu, int slot) { int size_offset; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // Only process this if we are the server if (Netgame.local_role != LR_SERVER) { Int3(); // We shouldn't be here... get Kevin @@ -272,7 +272,7 @@ static void MultiSendGuidebotMenuText(gb_menu *menu, int slot) { nw_SendReliable(NetPlayers[slot].reliable_socket, data, count, false); } -static void MultiReadGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) { +static void MultiReadGuidebotMenuData(uint8_t *data, int *count, gb_menu *menu) { int i; // Get the menu data and stick it here @@ -298,7 +298,7 @@ static void MultiReadGuidebotMenuData(ubyte *data, int *count, gb_menu *menu) { } } -void MultiDoGuidebotMenuRequest(ubyte *data, int slot) { +void MultiDoGuidebotMenuRequest(uint8_t *data, int slot) { int count = 0; SKIP_HEADER(data, &count); @@ -351,7 +351,7 @@ void MultiDoGuidebotMenuRequest(ubyte *data, int slot) { } } -void MultiDoGuidebotMenuData(ubyte *data) { +void MultiDoGuidebotMenuData(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); if (Netgame.local_role != LR_CLIENT) { diff --git a/Descent3/config.h b/Descent3/config.h index 72dfd744..33a23beb 100644 --- a/Descent3/config.h +++ b/Descent3/config.h @@ -70,7 +70,7 @@ * * 15 8/27/98 6:23p Jeff * changed autoleveling in config so it is a slider...had to convert - * global from bool->ubyte. Added fast headlight and mirrored surfaces to + * global from bool->uint8_t. Added fast headlight and mirrored surfaces to * config menu * * 14 8/19/98 2:19p Jeff @@ -171,8 +171,8 @@ typedef struct tDetailSettings { bool Scorches_enabled; bool Weapon_coronas_enabled; bool Bumpmapping_enabled; - ubyte Specular_mapping_type; - ubyte Object_complexity; // 0 = low, 1 = medium, 2=high + uint8_t Specular_mapping_type; + uint8_t Object_complexity; // 0 = low, 1 = medium, 2=high } tDetailSettings; // Call this with one of the above defines to set the detail level to a predefined set (custom level is ignored) diff --git a/Descent3/credits.cpp b/Descent3/credits.cpp index 28faeb38..cb8ba81d 100644 --- a/Descent3/credits.cpp +++ b/Descent3/credits.cpp @@ -114,7 +114,7 @@ $$TABLE_GAMEFILE "credits.omf" typedef struct creditline { ddgr_color color; - ubyte type; + uint8_t type; char *text; creditline *next; ushort startx, starty, endx, endy; diff --git a/Descent3/ctlconfig.cpp b/Descent3/ctlconfig.cpp index ca8feb1f..6c398e7a 100644 --- a/Descent3/ctlconfig.cpp +++ b/Descent3/ctlconfig.cpp @@ -403,7 +403,7 @@ t_cfg_element Cfg_joy_elements[] = {{-1, CtlText_WeaponGroup, CCITEM_WPN_X2, CCI {ctfBANK_RIGHTBUTTON, CtlText_BankRight, 0, 0}}; #define N_JOY_CFG_FN (sizeof(Cfg_joy_elements) / sizeof(t_cfg_element)) #define N_KEY_CFG_FN (sizeof(Cfg_key_elements) / sizeof(t_cfg_element)) -static void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, ubyte controller, ubyte elem, int8_t slot); +static void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, uint8_t controller, uint8_t elem, int8_t slot); static void ctl_cfg_element_options_dialog(short fnid); // used for adjusting settings. static int weapon_select_dialog(int wpn, bool is_secondary); @@ -469,7 +469,7 @@ void key_cfg_screen::process(int res) { for (i = 0; i < N_KEY_CFG_FN; i++) { if (m_elem[i].GetID() != -1 && m_elem[i].GetID() == res) { // we chose a slot to configure. - ubyte elem, controller; + uint8_t elem, controller; int8_t slot; ct_type elem_type; if (m_elem[i].GetActiveSlot() == CFGELEM_SLOT_CLEAR) { @@ -577,7 +577,7 @@ void joy_cfg_screen::process(int res) { for (i = 0; i < N_JOY_CFG_FN; i++) { if (m_elem[i].GetID() != -1 && m_elem[i].GetID() == res) { // we chose a slot to configure. - ubyte elem, controller; + uint8_t elem, controller; int8_t slot; ct_type elem_type; if (m_elem[i].GetActiveSlot() == CFGELEM_SLOT_CLEAR) { @@ -898,9 +898,9 @@ void wpnsel_cfg_screen::unrealize() { } ////////////////////////////////////////////////////////////////////////////// // this will take out any repeats of element and slot in function id. -void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, ubyte ctrl, ubyte elem, int8_t slot) { +void ctl_cfg_set_and_verify_changes(short fnid, ct_type elem_type, uint8_t ctrl, uint8_t elem, int8_t slot) { ct_type ctype_fn[CTLBINDS_PER_FUNC]; - ubyte cfgflags_fn[CTLBINDS_PER_FUNC]; + uint8_t cfgflags_fn[CTLBINDS_PER_FUNC]; ct_config_data ccfgdata_fn; t_cfg_element *fn_list; tCfgDataParts cfgparts; @@ -972,7 +972,7 @@ void ctl_cfg_element_options_dialog(short fnid) { int *inv_binding[CTLBINDS_PER_FUNC]; bool *clear_binding[CTLBINDS_PER_FUNC]; ct_type ctype_fn[CTLBINDS_PER_FUNC]; - ubyte cfgflags_fn[CTLBINDS_PER_FUNC]; + uint8_t cfgflags_fn[CTLBINDS_PER_FUNC]; ct_config_data ccfgdata_fn; tCfgDataParts cfgparts; diff --git a/Descent3/debuggraph.cpp b/Descent3/debuggraph.cpp index 461ee310..a0465c59 100644 --- a/Descent3/debuggraph.cpp +++ b/Descent3/debuggraph.cpp @@ -78,7 +78,7 @@ tGraphColor GraphColors[MAX_GRAPH_NODES] = { {"Dk.Purple", GR_RGB(100, 4, 104)}}; typedef struct { - ubyte data_input; + uint8_t data_input; int flags; union { diff --git a/Descent3/demofile.cpp b/Descent3/demofile.cpp index c8addca1..0708e63a 100644 --- a/Descent3/demofile.cpp +++ b/Descent3/demofile.cpp @@ -518,7 +518,7 @@ void DemoWriteChangedObjects() { } } -void DemoWriteObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, +void DemoWriteObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, object *obj) { if (Demo_flags == DF_RECORDING) { @@ -654,7 +654,7 @@ void DemoWritePlayerDeath(object *player, bool melee, int fate) { void DemoReadPlayerDeath(void) { short playernum = cf_ReadShort(Demo_cfp); - ubyte melee = cf_ReadByte(Demo_cfp); + uint8_t melee = cf_ReadByte(Demo_cfp); int fate = cf_ReadInt(Demo_cfp); InitiatePlayerDeath(&Objects[playernum], melee ? true : false, fate); } @@ -928,7 +928,7 @@ void DemoReadObj() { void DemoReadHudMessage() { char msg[HUD_MESSAGE_LENGTH]; int color = cf_ReadInt(Demo_cfp); - ubyte blink = cf_ReadByte(Demo_cfp); + uint8_t blink = cf_ReadByte(Demo_cfp); cf_ReadString(msg, HUD_MESSAGE_LENGTH, Demo_cfp); if (color) { @@ -1099,8 +1099,8 @@ void DemoReadWeaponFire() { void DemoReadObjCreate() { // float gametime; - ubyte type; - ubyte use_orient; + uint8_t type; + uint8_t use_orient; matrix orient; vector pos; int roomnum; @@ -1153,10 +1153,10 @@ void DemoReadObjCreate() { // FrameDemoDelta = FrameCount // DemoFrameCount = 0; -ubyte DemoLastOpcode = 0; +uint8_t DemoLastOpcode = 0; void DemoFrame() { - ubyte opcode; + uint8_t opcode; if (Demo_flags != DF_PLAYBACK) return; if (!Demo_first_frame) { @@ -1301,7 +1301,7 @@ void DemoFrame() { } while (!exit_loop); } -void DemoWriteCinematics(ubyte *data, uint16_t len) { +void DemoWriteCinematics(uint8_t *data, uint16_t len) { cf_WriteByte(Demo_cfp, DT_CINEMATICS); // Write a bunch of data mprintf((0, "Writing Cinematic data (%d bytes) to demo file.\n", len)); @@ -1310,40 +1310,40 @@ void DemoWriteCinematics(ubyte *data, uint16_t len) { } void DemoReadCinematics() { - ubyte buffer[1500]; + uint8_t buffer[1500]; ushort len = cf_ReadShort(Demo_cfp); cf_ReadBytes(buffer, len, Demo_cfp); mprintf((0, "Reading Cinematic data from demo file.\n")); Cinematic_DoDemoFileData(buffer); } -void DemoWriteMSafe(ubyte *data, uint16_t len) { +void DemoWriteMSafe(uint8_t *data, uint16_t len) { cf_WriteByte(Demo_cfp, DT_MSAFE); cf_WriteShort(Demo_cfp, len); cf_WriteBytes(data, len, Demo_cfp); // mprintf((0,"Writing MSAFE data to demo file.\n")); } -void DemoWritePowerup(ubyte *data, uint16_t len) { +void DemoWritePowerup(uint8_t *data, uint16_t len) { cf_WriteByte(Demo_cfp, DT_POWERUP); cf_WriteShort(Demo_cfp, len); cf_WriteBytes(data, len, Demo_cfp); } -extern void MultiDoMSafeFunction(ubyte *data); +extern void MultiDoMSafeFunction(uint8_t *data); void DemoReadMSafe() { - ubyte buffer[1500]; + uint8_t buffer[1500]; ushort len = cf_ReadShort(Demo_cfp); cf_ReadBytes(buffer, len, Demo_cfp); // mprintf((0,"Reading MSAFE data from demo file.\n")); MultiDoMSafeFunction(buffer); } -extern void MultiDoMSafePowerup(ubyte *data); +extern void MultiDoMSafePowerup(uint8_t *data); void DemoReadPowerups() { - ubyte buffer[1500]; + uint8_t buffer[1500]; ushort len = cf_ReadShort(Demo_cfp); cf_ReadBytes(buffer, len, Demo_cfp); MultiDoMSafePowerup(buffer); @@ -1372,7 +1372,7 @@ void DemoReadCollidePlayerWeapon(void) { short wep_objnum = cf_ReadShort(Demo_cfp); gs_ReadVector(Demo_cfp, collision_p); gs_ReadVector(Demo_cfp, collision_n); - ubyte b = cf_ReadByte(Demo_cfp); + uint8_t b = cf_ReadByte(Demo_cfp); f_reverse_normal = b ? true : false; real_weapnum = Demo_obj_map[wep_objnum]; @@ -1403,7 +1403,7 @@ void DemoReadCollideGenericWeapon(void) { short wep_objnum = cf_ReadShort(Demo_cfp); gs_ReadVector(Demo_cfp, collision_p); gs_ReadVector(Demo_cfp, collision_n); - ubyte b = cf_ReadByte(Demo_cfp); + uint8_t b = cf_ReadByte(Demo_cfp); f_reverse_normal = b ? true : false; real_weapnum = Demo_obj_map[wep_objnum]; @@ -1715,7 +1715,7 @@ void DemoWritePersistantHUDMessage(ddgr_color color, int x, int y, float time, i cf_WriteInt(Demo_cfp, flags); cf_WriteInt(Demo_cfp, sound_index); cf_WriteShort(Demo_cfp, strlen(msg) + 1); - cf_WriteBytes((const ubyte *)msg, strlen(msg) + 1, Demo_cfp); + cf_WriteBytes((const uint8_t *)msg, strlen(msg) + 1, Demo_cfp); } void DemoReadPersistantHUDMessage() { @@ -1735,7 +1735,7 @@ void DemoReadPersistantHUDMessage() { sound_index = cf_ReadInt(Demo_cfp); int msglen = cf_ReadShort(Demo_cfp); fmt = (char *)mem_malloc(msglen); - cf_ReadBytes((ubyte *)fmt, msglen, Demo_cfp); + cf_ReadBytes((uint8_t *)fmt, msglen, Demo_cfp); AddPersistentHUDMessage(color, x, y, time, flags, sound_index, fmt); mem_free(fmt); } diff --git a/Descent3/difficulty.h b/Descent3/difficulty.h index 6c704ed8..294657f8 100644 --- a/Descent3/difficulty.h +++ b/Descent3/difficulty.h @@ -23,7 +23,7 @@ #include "pilot.h" #include "difficulty_external.h" -extern ubyte ingame_difficulty; +extern uint8_t ingame_difficulty; // DAJ static global instead of subroutine call for speed #define DIFF_LEVEL (((Game_mode & GM_MULTI)) ? Netgame.difficulty : ingame_difficulty) diff --git a/Descent3/door.h b/Descent3/door.h index 5aa3567d..7a936e67 100644 --- a/Descent3/door.h +++ b/Descent3/door.h @@ -123,9 +123,9 @@ typedef struct { char name[PAGENAME_LEN]; // name of the door - ubyte used; // if this door is in use - ubyte flags; // flags for this door - ubyte pad; // keep alignment (pagename is 35 chars long) + uint8_t used; // if this door is in use + uint8_t flags; // flags for this door + uint8_t pad; // keep alignment (pagename is 35 chars long) short hit_points; // for blastable doors float total_open_time; // time of animation to open door float total_close_time; // time of animation to close door diff --git a/Descent3/doorway.h b/Descent3/doorway.h index 757e9bef..00b35c7b 100644 --- a/Descent3/doorway.h +++ b/Descent3/doorway.h @@ -125,9 +125,9 @@ extern int Active_doorways[MAX_ACTIVE_DOORWAYS]; // A doorway (room) in the mine typedef struct doorway { int doornum; // door type of this doorway - ubyte state; // current state of doorway - ubyte flags; // flags associated with a doorway - ubyte keys_needed; // used by trigger system. these bits need to be set to activate door + uint8_t state; // current state of doorway + uint8_t flags; // flags associated with a doorway + uint8_t keys_needed; // used by trigger system. these bits need to be set to activate door int8_t activenum; // index into active doorways array, or -1 if not active float position; // current position of door float dest_pos; // destination position diff --git a/Descent3/fireball.cpp b/Descent3/fireball.cpp index 2c0c38fc..44029261 100644 --- a/Descent3/fireball.cpp +++ b/Descent3/fireball.cpp @@ -703,11 +703,11 @@ void InitFireballs() { if (col565 == 0x07e0) { data[i] = NEW_TRANSPARENT_COLOR; } else { - ubyte r = (ubyte)((col565 & 0xf800) >> 11); - ubyte g = (ubyte)((col565 & 0x07c0) >> 6); - ubyte b = (ubyte)(col565 & 0x001f); + uint8_t r = (uint8_t)((col565 & 0xf800) >> 11); + uint8_t g = (uint8_t)((col565 & 0x07c0) >> 6); + uint8_t b = (uint8_t)(col565 & 0x001f); float brightness = ((r * 0.30f) + (g * 0.59f) + (b * 0.11f)) * recip32; - ubyte elem = (ubyte)(255.0f * brightness); + uint8_t elem = (uint8_t)(255.0f * brightness); if (brightness > 1.0f) elem = 255; data[i] = GR_RGB16(elem, elem, elem) | OPAQUE_FLAG; @@ -2053,7 +2053,7 @@ int CreateSmolderingObject(vector *pos, int index, float lifetime, float max_siz } // Draws a colored alpha disk...useful for cool lighting effects void DrawColoredDisk(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size, - ubyte saturate, ubyte lod) { + uint8_t saturate, uint8_t lod) { rend_SetZBufferWriteMask(0); DrawColoredRing(pos, r, g, b, inner_alpha, outer_alpha, size, 0, saturate, lod); rend_SetZBufferWriteMask(1); @@ -2072,7 +2072,7 @@ void DrawColoredGlow(vector *pos, float r, float g, float b, float size) { // Draws a colored alpha ring...useful for cool lighting effects void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size, - float inner_ring_ratio, ubyte saturate, ubyte lod) { + float inner_ring_ratio, uint8_t saturate, uint8_t lod) { static vector circleVecs[3][32]; static int lodSegments[3] = {32, 16, 8}; static bool firstCall = true; @@ -2151,7 +2151,7 @@ void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha, // TODO: MTS: not used? // Draws a sphere with the appropriate texture. If texture=-1, then uses rgb as colors -void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, ubyte saturate) { +void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, uint8_t saturate) { static vector sphere_vecs[16][16]; static int first = 1; g3Point sphere_points[16][16], *pntlist[4], draw_points[4]; diff --git a/Descent3/fireball.h b/Descent3/fireball.h index 5d118baa..b93bf88e 100644 --- a/Descent3/fireball.h +++ b/Descent3/fireball.h @@ -180,8 +180,8 @@ typedef struct { char name[PAGENAME_LEN]; // The filename of this animation - ubyte type; // type of fireball, see above - ubyte tex_size; // What size texture to use for this animation + uint8_t type; // type of fireball, see above + uint8_t tex_size; // What size texture to use for this animation float total_life; // How long this animation should last (in seconds) float size; // How big this explosion is short bm_handle; // The handle to the vlip @@ -250,11 +250,11 @@ void DrawBlastRingObject(object *obj); // Draws a colored alpha disk...useful for cool lighting effects void DrawColoredDisk(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size, - ubyte saturate = 0, ubyte lod = 1); + uint8_t saturate = 0, uint8_t lod = 1); // Draws a colored alpha ring...useful for cool lighting effects void DrawColoredRing(vector *pos, float r, float g, float b, float inner_alpha, float outer_alpha, float size, - float inner_ring_ratio, ubyte saturate = 0, ubyte lod = 1); + float inner_ring_ratio, uint8_t saturate = 0, uint8_t lod = 1); // Creates a blast ring from an event void DoBlastRingEvent(int eventnum, void *data); @@ -279,7 +279,7 @@ int GetRandomSmallExplosion(); int GetRandomBillowingExplosion(); // Draws a sphere with the appropriate texture. If texture=-1, then uses rgb as colors -void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, ubyte saturate = 1); +void DrawSphere(vector *pos, float r, float g, float b, float alpha, float size, int texture, uint8_t saturate = 1); // Creates end points that simulate lightning void CreateLightningRodPositions(vector *src, vector *dest, vector *world_vecs, int num_segments, float rand_mag, diff --git a/Descent3/game.h b/Descent3/game.h index dff92444..446244cf 100644 --- a/Descent3/game.h +++ b/Descent3/game.h @@ -309,7 +309,7 @@ typedef struct gamemode { // Structure for a terrain sound "band" typedef struct { int sound_index; // the sound to play - ubyte low_alt, high_alt; // top & bottom of range of sound + uint8_t low_alt, high_alt; // top & bottom of range of sound float low_volume, high_volume; // volume at top & bottom of range } terrain_sound_band; diff --git a/Descent3/gamecinematics.cpp b/Descent3/gamecinematics.cpp index 05fe8242..25c5d8ce 100644 --- a/Descent3/gamecinematics.cpp +++ b/Descent3/gamecinematics.cpp @@ -273,7 +273,7 @@ struct { #define CDI_CANNED 1 typedef struct { - ubyte cinematic_type; // canned/not canned + uint8_t cinematic_type; // canned/not canned int camera_objhandle; // object handle for camera to use char *text_string; // not canned text string @@ -1300,7 +1300,7 @@ void Cinematic_DrawText(void) { case GCF_TEXT_WIPEIN: { // first 1/3 is alpha in // last 2/3 is solid - ubyte alpha = 0; + uint8_t alpha = 0; if (perc > 0.33f) { // middle 1/3 @@ -1308,7 +1308,7 @@ void Cinematic_DrawText(void) { } else if (perc <= 0.33f) { // first 1/3 float new_p = perc / 0.33f; - alpha = (ubyte)(new_p * 255.0f); + alpha = (uint8_t)(new_p * 255.0f); } grtext_SetAlpha(alpha); @@ -1362,7 +1362,7 @@ void Cinematic_DrawText(void) { // first 1/3 is alpha in // middle 1/3 is solid // last 1/3 is alpha out - ubyte alpha; + uint8_t alpha; if (perc > 0.33f && perc <= 0.66f) { // middle 1/3 @@ -1370,7 +1370,7 @@ void Cinematic_DrawText(void) { } else if (perc <= 0.33f) { // first 1/3 float new_p = perc / 0.33f; - alpha = (ubyte)(new_p * 255.0f); + alpha = (uint8_t)(new_p * 255.0f); } else { // last 1/3 float new_p = (perc - 0.66f) / 0.33f; @@ -1378,7 +1378,7 @@ void Cinematic_DrawText(void) { new_p = 0.0f; if (new_p > 1.0f) new_p = 1.0f; - alpha = (ubyte)(255.0f - (new_p * 255.0f)); + alpha = (uint8_t)(255.0f - (new_p * 255.0f)); } grtext_SetAlpha(alpha); @@ -2208,20 +2208,20 @@ void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle) { //================================================== // Demo file support //================================================== -static void mf_WriteInt(ubyte *buffer, int *pointer, int data); -static void mf_WriteShort(ubyte *buffer, int *pointer, short data); -static void mf_WriteByte(ubyte *buffer, int *pointer, ubyte data); -static void mf_WriteFloat(ubyte *buffer, int *pointer, float data); -static void mf_WriteBytes(ubyte *buffer, int *pointer, ubyte *data, int len); -static void mf_WriteString(ubyte *buffer, int *pointer, const char *string); -static int mf_ReadInt(ubyte *buffer, int *pointer); -static short mf_ReadShort(ubyte *buffer, int *pointer); -static ubyte mf_ReadByte(ubyte *buffer, int *pointer); -static float mf_ReadFloat(ubyte *buffer, int *pointer); -static void mf_ReadBytes(ubyte *buffer, int *pointer, ubyte *data, int len); -static void mf_ReadString(ubyte *buffer, int *pointer, char *string); +static void mf_WriteInt(uint8_t *buffer, int *pointer, int data); +static void mf_WriteShort(uint8_t *buffer, int *pointer, short data); +static void mf_WriteByte(uint8_t *buffer, int *pointer, uint8_t data); +static void mf_WriteFloat(uint8_t *buffer, int *pointer, float data); +static void mf_WriteBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len); +static void mf_WriteString(uint8_t *buffer, int *pointer, const char *string); +static int mf_ReadInt(uint8_t *buffer, int *pointer); +static short mf_ReadShort(uint8_t *buffer, int *pointer); +static uint8_t mf_ReadByte(uint8_t *buffer, int *pointer); +static float mf_ReadFloat(uint8_t *buffer, int *pointer); +static void mf_ReadBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len); +static void mf_ReadString(uint8_t *buffer, int *pointer, char *string); -void Cinematic_DoDemoFileData(ubyte *buffer) { +void Cinematic_DoDemoFileData(uint8_t *buffer) { int count = 0; char text_string[512]; tCannedCinematicInfo canned_data; @@ -2316,7 +2316,7 @@ void Cinematic_DoDemoFileData(ubyte *buffer) { } void Cinematic_WriteDemoFileData(tCinematicDemoInfo *info) { - ubyte buffer[1500]; + uint8_t buffer[1500]; int count = 0; // what kind of cinematic are we saving @@ -2410,32 +2410,32 @@ void Cinematic_WriteDemoFileData(tCinematicDemoInfo *info) { DemoWriteCinematics(buffer, count); } -void mf_WriteInt(ubyte *buffer, int *pointer, int data) { +void mf_WriteInt(uint8_t *buffer, int *pointer, int data) { memcpy(&buffer[(*pointer)], &data, sizeof(int)); (*pointer) += sizeof(int); } -void mf_WriteShort(ubyte *buffer, int *pointer, short data) { +void mf_WriteShort(uint8_t *buffer, int *pointer, short data) { memcpy(&buffer[(*pointer)], &data, sizeof(short)); (*pointer) += sizeof(short); } -void mf_WriteByte(ubyte *buffer, int *pointer, ubyte data) { - memcpy(&buffer[(*pointer)], &data, sizeof(ubyte)); - (*pointer) += sizeof(ubyte); +void mf_WriteByte(uint8_t *buffer, int *pointer, uint8_t data) { + memcpy(&buffer[(*pointer)], &data, sizeof(uint8_t)); + (*pointer) += sizeof(uint8_t); } -void mf_WriteFloat(ubyte *buffer, int *pointer, float data) { +void mf_WriteFloat(uint8_t *buffer, int *pointer, float data) { memcpy(&buffer[(*pointer)], &data, sizeof(float)); (*pointer) += sizeof(float); } -void mf_WriteBytes(ubyte *buffer, int *pointer, ubyte *data, int len) { +void mf_WriteBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len) { memcpy(&buffer[(*pointer)], data, len); (*pointer) += len; } -void mf_WriteString(ubyte *buffer, int *pointer, const char *string) { +void mf_WriteString(uint8_t *buffer, int *pointer, const char *string) { while (*string) { mf_WriteByte(buffer, pointer, (*string)); string++; @@ -2443,41 +2443,41 @@ void mf_WriteString(ubyte *buffer, int *pointer, const char *string) { mf_WriteByte(buffer, pointer, (*string)); } -int mf_ReadInt(ubyte *buffer, int *pointer) { +int mf_ReadInt(uint8_t *buffer, int *pointer) { int value; memcpy(&value, &buffer[(*pointer)], sizeof(value)); (*pointer) += sizeof(value); return value; } -short mf_ReadShort(ubyte *buffer, int *pointer) { +short mf_ReadShort(uint8_t *buffer, int *pointer) { short value; memcpy(&value, &buffer[(*pointer)], sizeof(value)); (*pointer) += sizeof(value); return value; } -ubyte mf_ReadByte(ubyte *buffer, int *pointer) { - ubyte value; +uint8_t mf_ReadByte(uint8_t *buffer, int *pointer) { + uint8_t value; memcpy(&value, &buffer[(*pointer)], sizeof(value)); (*pointer) += sizeof(value); return value; } -float mf_ReadFloat(ubyte *buffer, int *pointer) { +float mf_ReadFloat(uint8_t *buffer, int *pointer) { float value; memcpy(&value, &buffer[(*pointer)], sizeof(value)); (*pointer) += sizeof(value); return value; } -void mf_ReadBytes(ubyte *buffer, int *pointer, ubyte *data, int len) { +void mf_ReadBytes(uint8_t *buffer, int *pointer, uint8_t *data, int len) { memcpy(data, &buffer[(*pointer)], len); (*pointer) += len; } -void mf_ReadString(ubyte *buffer, int *pointer, char *string) { - ubyte data; +void mf_ReadString(uint8_t *buffer, int *pointer, char *string) { + uint8_t data; data = mf_ReadByte(buffer, pointer); while (data) { *string = data; diff --git a/Descent3/gamecinematics.h b/Descent3/gamecinematics.h index 9a0d4216..b4a6d484 100644 --- a/Descent3/gamecinematics.h +++ b/Descent3/gamecinematics.h @@ -101,6 +101,6 @@ tHUDMode Cinematic_GetOldHudMode(void); // Only the demo system passing in a camera_handle, so it should never be explicitly passed by you void Cinematic_StartCanned(tCannedCinematicInfo *info, int camera_handle = -1); -void Cinematic_DoDemoFileData(ubyte *data); +void Cinematic_DoDemoFileData(uint8_t *data); #endif diff --git a/Descent3/gameevent.h b/Descent3/gameevent.h index 48cd7307..fde9fa33 100644 --- a/Descent3/gameevent.h +++ b/Descent3/gameevent.h @@ -43,7 +43,7 @@ typedef struct game_event { int type; int id; int objhandle_detonator; // watch this object, if it dies/gets killed than cancel this game event - ubyte used; + uint8_t used; float start_time, end_time; int frame_born; diff --git a/Descent3/gamefile.h b/Descent3/gamefile.h index 2a235e27..878c763f 100644 --- a/Descent3/gamefile.h +++ b/Descent3/gamefile.h @@ -27,7 +27,7 @@ typedef struct { char name[PAGENAME_LEN]; char dir_name[PAGENAME_LEN]; - ubyte used; + uint8_t used; } gamefile; extern int Num_gamefiles; diff --git a/Descent3/gamepath.h b/Descent3/gamepath.h index 7375f9d4..65a2c4fa 100644 --- a/Descent3/gamepath.h +++ b/Descent3/gamepath.h @@ -75,7 +75,7 @@ public: node *pathnodes; int num_nodes; // how many nodes in this path? char name[PAGENAME_LEN]; // the name of this path - ubyte flags; // special properties of this path + uint8_t flags; // special properties of this path bool used; // if this path is in use }; diff --git a/Descent3/gamesave.cpp b/Descent3/gamesave.cpp index b90e039e..26eb6c37 100644 --- a/Descent3/gamesave.cpp +++ b/Descent3/gamesave.cpp @@ -737,7 +737,7 @@ bool SaveGameState(const char *pathname, const char *description) { START_VERIFY_SAVEFILE(fp); ASSERT(strlen(description) < sizeof(buf)); strcpy(buf, description); - cf_WriteBytes((ubyte *)buf, sizeof(buf), fp); + cf_WriteBytes((uint8_t *)buf, sizeof(buf), fp); cf_WriteShort(fp, GAMESAVE_VERSION); SGSSnapshot(fp); // Save snapshot? MUST KEEP THIS HERE. @@ -771,7 +771,7 @@ bool SaveGameState(const char *pathname, const char *description) { // cf_WriteInt(fp,Times_game_restored); // Save weather cf_WriteInt(fp, sizeof(Weather)); - cf_WriteBytes((ubyte *)&Weather, sizeof(Weather), fp); + cf_WriteBytes((uint8_t *)&Weather, sizeof(Weather), fp); // Save active doorways cf_WriteInt(fp, MAX_ACTIVE_DOORWAYS); @@ -878,7 +878,7 @@ void SGSXlateTables(CFILE *fp) { END_VERIFY_SAVEFILE(fp, "Xlate save"); } -extern ubyte AutomapVisMap[MAX_ROOMS]; +extern uint8_t AutomapVisMap[MAX_ROOMS]; // initializes rooms void SGSRooms(CFILE *fp) { int i, f, p; @@ -968,7 +968,7 @@ void SGSPlayers(CFILE *fp) { player *plr = &Players[0]; gs_WriteShort(fp, sizeof(player)); - cf_WriteBytes((ubyte *)plr, sizeof(player), fp); + cf_WriteBytes((uint8_t *)plr, sizeof(player), fp); if (plr->guided_obj) gs_WriteInt(fp, plr->guided_obj->handle); @@ -990,7 +990,7 @@ void SGSVisEffects(CFILE *fp) { for (i = 0; i <= Highest_vis_effect_index; i++) { if (VisEffects[i].type != VIS_NONE) - cf_WriteBytes((ubyte *)&VisEffects[i], sizeof(vis_effect), fp); + cf_WriteBytes((uint8_t *)&VisEffects[i], sizeof(vis_effect), fp); } } @@ -1014,7 +1014,7 @@ void SGSObjects(CFILE *fp) { cf_WriteShort(fp, (short)MAX_PLAYERS * 2); for (i = 0; i < MAX_PLAYERS * 2; i++) { cf_WriteShort(fp, strlen(MarkerMessages[i]) + 1); - cf_WriteBytes((ubyte *)MarkerMessages[i], strlen(MarkerMessages[i]) + 1, fp); + cf_WriteBytes((uint8_t *)MarkerMessages[i], strlen(MarkerMessages[i]) + 1, fp); } // this method should maintain the object list as it currently stands in the level @@ -1070,7 +1070,7 @@ void SGSObjects(CFILE *fp) { // Store whether or not we have a pointer to lighting_info gs_WriteByte(fp, op->lighting_info ? 1 : 0); if (op->lighting_info) { - cf_WriteBytes((ubyte *)op->lighting_info, sizeof(*op->lighting_info), fp); + cf_WriteBytes((uint8_t *)op->lighting_info, sizeof(*op->lighting_info), fp); } // these objects FOR NOW won't be saved @@ -1090,7 +1090,7 @@ void SGSObjects(CFILE *fp) { ii = (op->name) ? strlen(op->name) : 0; gs_WriteByte(fp, ii); if (ii > 0) - cf_WriteBytes((ubyte *)op->name, ii, fp); + cf_WriteBytes((uint8_t *)op->name, ii, fp); // data universal to all objects that need to be saved. gs_WriteShort(fp, (short)op->id); @@ -1153,12 +1153,12 @@ void SGSObjects(CFILE *fp) { ii = (op->custom_default_script_name) ? strlen(op->custom_default_script_name) : 0; gs_WriteByte(fp, ii); if (ii > 0) - cf_WriteBytes((ubyte *)op->custom_default_script_name, ii, fp); + cf_WriteBytes((uint8_t *)op->custom_default_script_name, ii, fp); ii = (op->custom_default_module_name) ? strlen(op->custom_default_module_name) : 0; gs_WriteByte(fp, ii); if (ii > 0) - cf_WriteBytes((ubyte *)op->custom_default_module_name, ii, fp); + cf_WriteBytes((uint8_t *)op->custom_default_module_name, ii, fp); INSURE_SAVEFILE; @@ -1169,13 +1169,13 @@ void SGSObjects(CFILE *fp) { // write out all structures here. // movement info. gs_WriteShort(fp, sizeof(op->mtype)); - cf_WriteBytes((ubyte *)&op->mtype, sizeof(op->mtype), fp); + cf_WriteBytes((uint8_t *)&op->mtype, sizeof(op->mtype), fp); INSURE_SAVEFILE; // Control info, determined by CONTROL_TYPE gs_WriteShort(fp, sizeof(op->ctype)); - cf_WriteBytes((ubyte *)&op->ctype, sizeof(op->ctype), fp); + cf_WriteBytes((uint8_t *)&op->ctype, sizeof(op->ctype), fp); INSURE_SAVEFILE; @@ -1185,14 +1185,14 @@ void SGSObjects(CFILE *fp) { INSURE_SAVEFILE; // save out rendering information gs_WriteShort(fp, sizeof(op->rtype)); - cf_WriteBytes((ubyte *)&op->rtype, sizeof(op->rtype), fp); + cf_WriteBytes((uint8_t *)&op->rtype, sizeof(op->rtype), fp); cf_WriteFloat(fp, op->size); if (op->render_type == RT_POLYOBJ) { // Do Animation stuff custom_anim multi_anim_info; ObjGetAnimUpdate(i, &multi_anim_info); - cf_WriteBytes((ubyte *)&multi_anim_info, sizeof(multi_anim_info), fp); + cf_WriteBytes((uint8_t *)&multi_anim_info, sizeof(multi_anim_info), fp); } INSURE_SAVEFILE; @@ -1224,7 +1224,7 @@ void SGSObjAI(CFILE *fp, const ai_frame *ai) { return; gs_WriteShort(fp, sizeof(ai_frame)); - cf_WriteBytes((ubyte *)ai, sizeof(ai_frame), fp); + cf_WriteBytes((uint8_t *)ai, sizeof(ai_frame), fp); } // saves script @@ -1270,7 +1270,7 @@ void SGSObjEffects(CFILE *fp, const object *op) { gs_WriteByte(fp, (ei ? 1 : 0)); if (ei) { gs_WriteShort(fp, sizeof(effect_info_s)); - cf_WriteBytes((ubyte *)ei, sizeof(effect_info_s), fp); + cf_WriteBytes((uint8_t *)ei, sizeof(effect_info_s), fp); } } @@ -1282,7 +1282,7 @@ void SGSObjWB(CFILE *fp, object *op, int num_wbs) { gs_WriteByte(fp, (int8_t)num_wbs); for (i = 0; i < num_wbs; i++) { dynamic_wb_info *dwb = &op->dynamic_wb[i]; - cf_WriteBytes((ubyte *)dwb, sizeof(dynamic_wb_info), fp); + cf_WriteBytes((uint8_t *)dwb, sizeof(dynamic_wb_info), fp); } } else { gs_WriteByte(fp, 0); @@ -1300,7 +1300,7 @@ void SGSSpew(CFILE *fp) { for (i = 0; i < MAX_SPEW_EFFECTS; i++) { gs_WriteByte(fp, SpewEffects[i].inuse ? true : false); if (SpewEffects[i].inuse) - cf_WriteBytes((ubyte *)&SpewEffects[i], sizeof(spewinfo), fp); + cf_WriteBytes((uint8_t *)&SpewEffects[i], sizeof(spewinfo), fp); } } diff --git a/Descent3/gamesave.h b/Descent3/gamesave.h index 4afd07f5..0dc9dfeb 100644 --- a/Descent3/gamesave.h +++ b/Descent3/gamesave.h @@ -283,7 +283,7 @@ int LGSObjEffects(CFILE *fp, object *op); int LGSObjWB(CFILE *fp, object *op); // loads script -//@@vector *LGSScript(CFILE *fp, script_info *script, ubyte *is_scripted, int *memsize); +//@@vector *LGSScript(CFILE *fp, script_info *script, uint8_t *is_scripted, int *memsize); // loads special object info int LGSObjSpecial(CFILE *fp, object *op); diff --git a/Descent3/gamesequence.cpp b/Descent3/gamesequence.cpp index 42fbe623..e617da1a 100644 --- a/Descent3/gamesequence.cpp +++ b/Descent3/gamesequence.cpp @@ -1135,9 +1135,9 @@ void PageInGeneric(int); void PageInShip(int); // Data allocation arrays, for keeping track of what textures/sounds are level specific -ubyte Models_to_free[MAX_POLY_MODELS]; -ubyte Textures_to_free[MAX_TEXTURES]; -ubyte Sounds_to_free[MAX_TEXTURES]; +uint8_t Models_to_free[MAX_POLY_MODELS]; +uint8_t Textures_to_free[MAX_TEXTURES]; +uint8_t Sounds_to_free[MAX_TEXTURES]; #ifdef EDITOR extern vector editor_player_pos; diff --git a/Descent3/gametexture.h b/Descent3/gametexture.h index 9f95ebc8..d5958463 100644 --- a/Descent3/gametexture.h +++ b/Descent3/gametexture.h @@ -248,14 +248,14 @@ #define PROC_MEMORY_TYPE_WATER 2 typedef struct { - ubyte type; + uint8_t type; - ubyte frequency; - ubyte speed; - ubyte color; - ubyte size; + uint8_t frequency; + uint8_t speed; + uint8_t color; + uint8_t size; - ubyte x1, y1, x2, y2; + uint8_t x1, y1, x2, y2; } static_proc_element; @@ -269,16 +269,16 @@ typedef struct { static_proc_element *static_proc_elements; ushort num_static_elements; - ubyte memory_type; + uint8_t memory_type; - ubyte heat; - ubyte thickness; - ubyte light; + uint8_t heat; + uint8_t thickness; + uint8_t light; float last_evaluation_time; float evaluation_time; float osc_time; - ubyte osc_value; + uint8_t osc_value; int last_procedural_frame; // last frame a procedural was calculated for this texture } proc_struct; @@ -303,8 +303,8 @@ typedef struct { float sound_volume; // The volume for this texture's sound short bumpmap; // The bumpmap for this texture, or -1 if there is none - ubyte corona_type; // what type of corona this thing uses - ubyte used; // is this texture free to be allocated? + uint8_t corona_type; // what type of corona this thing uses + uint8_t used; // is this texture free to be allocated? } texture; diff --git a/Descent3/gauges.cpp b/Descent3/gauges.cpp index 8ce749db..a31d29d4 100644 --- a/Descent3/gauges.cpp +++ b/Descent3/gauges.cpp @@ -292,16 +292,16 @@ static void RenderAfterburnMonitor(tGauge *gauge, bool modified); static void DrawGaugeMonitor(g3Point *pts, int bm, float brightness, float *alphas); // renders a square texture onto the screen. -static void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, ubyte alpha, bool saturate); +static void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, uint8_t alpha, bool saturate); // renders a square texture onto the screen. -static void DrawGaugeQuad(g3Point *pts, int bm, ubyte alpha = 255, bool saturate = false); +static void DrawGaugeQuad(g3Point *pts, int bm, uint8_t alpha = 255, bool saturate = false); // renders a flat poly onto the screen with given color -static void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, ubyte alpha); +static void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, uint8_t alpha); // renders a flat poly onto the screen with 4 colors (for each vertex) -static void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, ubyte alpha); +static void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, uint8_t alpha); // correctly orders monitor vertices based off of UVs static int GetFirstVert(bsp_info *sm); @@ -726,7 +726,7 @@ void RenderShipMonitor(tGauge *gauge, bool modified) { if (!gauge->functional) return; - ubyte alpha = 255; + uint8_t alpha = 255; if (Objects[Players[Player_num].objnum].effect_info->type_flags & EF_CLOAKED) { float time_frame = Objects[Players[Player_num].objnum].effect_info->cloak_time; if (time_frame < HUD_CLOAKEND_TIME) { @@ -745,7 +745,7 @@ void RenderShipMonitor(tGauge *gauge, bool modified) { g3_GetUnscaledMatrix(&view_matrix); float inv_time_frame = (Gametime - (int)Gametime); - float inv_alpha = (ubyte)(255 * (1.0f - (inv_time_frame / 2.0f))); + float inv_alpha = (uint8_t)(255 * (1.0f - (inv_time_frame / 2.0f))); g3Point invpts[4]; int i; @@ -843,12 +843,12 @@ void DrawGaugeMonitor(g3Point *pts, int bm, float brightness, float *alphas) { } // renders a square texture onto the screen. -void DrawGaugeQuad(g3Point *pts, int bm, ubyte alpha, bool saturate) { +void DrawGaugeQuad(g3Point *pts, int bm, uint8_t alpha, bool saturate) { DrawGaugeQuad(pts, bm, 0, 0, 1, 1, alpha, saturate); } // renders a square texture onto the screen. -void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, ubyte alpha, bool saturate) { +void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, uint8_t alpha, bool saturate) { g3Point *pntlist[4]; g3Point pnts[4]; @@ -887,14 +887,14 @@ void DrawGaugeQuad(g3Point *pts, int bm, float u0, float v0, float u1, float v1, } // renders a flat poly onto the screen with given color -void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, ubyte alpha) { +void DrawGaugeQuadFlat(g3Point *pts, float r, float g, float b, uint8_t alpha) { float ar[4] = {r, r, r, r}, ag[4] = {g, g, g, g}, ab[4] = {b, b, b, b}; DrawGaugeQuadFlat(pts, ar, ag, ab, alpha); } // renders a flat poly onto the screen with 4 colors (for each vertex) -void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, ubyte alpha) { +void DrawGaugeQuadFlat(g3Point *pts, float *r, float *g, float *b, uint8_t alpha) { g3Point *pntlist[4]; g3Point pnts[4]; diff --git a/Descent3/hotspotmap.cpp b/Descent3/hotspotmap.cpp index f7de7859..dc635a48 100644 --- a/Descent3/hotspotmap.cpp +++ b/Descent3/hotspotmap.cpp @@ -509,8 +509,8 @@ void CreateWindowMap(const char *map, int width, int height, windowmap_t *wndmap // TODO: MTS: only used in this file // Loads a tga or ogf file into a bitmap...returns handle to bm or -1 on error, and fills in the alphamap int menutga_alloc_file(const char *name, char *hsmap[1], int *w, int *h) { - ubyte image_id_len, color_map_type, image_type, pixsize, descriptor; - ubyte upside_down = 0; + uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor; + uint8_t upside_down = 0; ushort width, height; uint32_t pixel; int i, t, n; diff --git a/Descent3/hud.cpp b/Descent3/hud.cpp index 0df6e306..579b9020 100644 --- a/Descent3/hud.cpp +++ b/Descent3/hud.cpp @@ -589,8 +589,8 @@ void InitShipHUD(int ship) { HUD_resources.invpulse_bmp = -1; // sets current hud mode static global - // DAJ Current_pilot.get_hud_data((ubyte *)&Hud_mode); - ubyte hud_tmp; + // DAJ Current_pilot.get_hud_data((uint8_t *)&Hud_mode); + uint8_t hud_tmp; Current_pilot.get_hud_data(&hud_tmp); Hud_mode = (tHUDMode)hud_tmp; } @@ -759,8 +759,8 @@ redo_hud_switch: // save out current hud mode // JEFF: (only if going from HUD_FULLSCREEN->HUD_COCKPIT or vice-versa) if ((Hud_mode == HUD_FULLSCREEN && mode == HUD_COCKPIT) || (Hud_mode == HUD_COCKPIT && mode == HUD_FULLSCREEN)) { - ubyte bmode = mode; // DAJ MAC using enums always int - Current_pilot.set_hud_data((ubyte *)&bmode); + uint8_t bmode = mode; // DAJ MAC using enums always int + Current_pilot.set_hud_data((uint8_t *)&bmode); mprintf((0, "Saving new hud mode to pilot\n")); PltWriteFile(&Current_pilot); } @@ -980,7 +980,7 @@ bool LGSHudState(CFILE *fp) { while ((stat_mask = (ushort)cf_ReadShort(fp)) != 0) { tHUDItem huditem; - ubyte item_type = (ubyte)cf_ReadByte(fp); + uint8_t item_type = (uint8_t)cf_ReadByte(fp); memset(&huditem, 0, sizeof(huditem)); huditem.type = item_type; @@ -995,7 +995,7 @@ bool LGSHudState(CFILE *fp) { huditem.y = cf_ReadShort(fp); huditem.color = (ddgr_color)cf_ReadInt(fp); huditem.flags = (ushort)cf_ReadShort(fp); - huditem.alpha = (ubyte)cf_ReadByte(fp); + huditem.alpha = (uint8_t)cf_ReadByte(fp); huditem.buffer_size = (int)cf_ReadShort(fp); huditem.render_fn = NULL; // use pointer to function void (*fn)(struct tHUDItem *) @@ -1013,7 +1013,7 @@ bool LGSHudState(CFILE *fp) { huditem.y = cf_ReadShort(fp); huditem.color = (ddgr_color)cf_ReadInt(fp); huditem.flags = (ushort)cf_ReadShort(fp); - huditem.alpha = (ubyte)cf_ReadByte(fp); + huditem.alpha = (uint8_t)cf_ReadByte(fp); huditem.data.timer_handle = cf_ReadInt(fp); huditem.render_fn = RenderHUDTimer; // use pointer to function void (*fn)(struct tHUDItem *) @@ -1340,7 +1340,7 @@ void RenderAuxHUDFrame() { char *GetControllerBindingText(int fidcont) { static char *cont_bind_txt; ct_type ctype[CTLBINDS_PER_FUNC]; - ubyte cfgflags[CTLBINDS_PER_FUNC]; + uint8_t cfgflags[CTLBINDS_PER_FUNC]; ct_config_data cfgdata; tCfgDataParts cfgparts; if (-1 == fidcont) @@ -1352,8 +1352,8 @@ char *GetControllerBindingText(int fidcont) { Controller->get_controller_function(Cfg_joy_elements[fidcont].fn_id, ctype, &cfgdata, cfgflags); parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata); - ubyte one_binding = cfgparts.bind_0; - ubyte one_ctrlbind = cfgparts.ctrl_0; + uint8_t one_binding = cfgparts.bind_0; + uint8_t one_ctrlbind = cfgparts.ctrl_0; cont_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding); return cont_bind_txt; @@ -1362,7 +1362,7 @@ char *GetControllerBindingText(int fidcont) { char *GetKeyBindingText(int fidkey) { static char *key_bind_txt; ct_type ctype[CTLBINDS_PER_FUNC]; - ubyte cfgflags[CTLBINDS_PER_FUNC]; + uint8_t cfgflags[CTLBINDS_PER_FUNC]; ct_config_data cfgdata; tCfgDataParts cfgparts; if (-1 == fidkey) @@ -1374,8 +1374,8 @@ char *GetKeyBindingText(int fidkey) { Controller->get_controller_function(Cfg_key_elements[fidkey].fn_id, ctype, &cfgdata, cfgflags); parse_config_data(&cfgparts, ctype[0], ctype[1], cfgdata); - ubyte one_binding = cfgparts.bind_0; - ubyte one_ctrlbind = cfgparts.ctrl_0; + uint8_t one_binding = cfgparts.bind_0; + uint8_t one_ctrlbind = cfgparts.ctrl_0; key_bind_txt = (char *)cfg_binding_text(ctype[0], one_ctrlbind, one_binding); return key_bind_txt; @@ -2152,9 +2152,9 @@ void LoadHudConfig(const char *filename, bool (*fn)(const char*, const char *, v tHUDItem hud_item; char operand[INFFILE_LINELEN]; // operand bool txpos = false, typos = false; - ubyte r=GR_COLOR_RED(HUD_COLOR); - ubyte g=GR_COLOR_GREEN(HUD_COLOR); - ubyte b=GR_COLOR_BLUE(HUD_COLOR); + uint8_t r=GR_COLOR_RED(HUD_COLOR); + uint8_t g=GR_COLOR_GREEN(HUD_COLOR); + uint8_t b=GR_COLOR_BLUE(HUD_COLOR); // start over. ResetHud(); @@ -2178,9 +2178,9 @@ void LoadHudConfig(const char *filename, bool (*fn)(const char*, const char *, v switch (cmd) { case HUDCMD_TYPE: hud_item.type = atoi(operand); break; - case HUDCMD_RED: r=(ubyte)atoi(operand); break; - case HUDCMD_GREEN: g=(ubyte)atoi(operand); break; - case HUDCMD_BLUE: b=(ubyte)atoi(operand); break; + case HUDCMD_RED: r=(uint8_t)atoi(operand); break; + case HUDCMD_GREEN: g=(uint8_t)atoi(operand); break; + case HUDCMD_BLUE: b=(uint8_t)atoi(operand); break; case HUDCMD_X: hud_item.x = atoi(operand); break; case HUDCMD_Y: hud_item.y = atoi(operand); break; case HUDCMD_TX: hud_item.tx = atoi(operand); txpos = true; break; diff --git a/Descent3/hud.h b/Descent3/hud.h index fdb6e480..2d2613e0 100644 --- a/Descent3/hud.h +++ b/Descent3/hud.h @@ -474,13 +474,13 @@ typedef struct tHUDItem { short tx, ty; // text version x and y. float grscalex, grscaley; // used to scale graphics. - ubyte id; // id number. - ubyte type; // custom of predefined hud item type. + uint8_t id; // id number. + uint8_t type; // custom of predefined hud item type. ushort stat; // stat mask (what class of hud items does this one belong to) ushort flags; // more flags. - ubyte alpha; // alpha of hud item - ubyte saturation_count; // how saturated is this hud item (how bright). + uint8_t alpha; // alpha of hud item + uint8_t saturation_count; // how saturated is this hud item (how bright). ddgr_color color; // color of hud item. ddgr_color tcolor; // text color of item. @@ -594,17 +594,17 @@ int RenderHUDGetTextLineWidth(const char *string); int RenderHUDGetTextHeight(const char *string); // renders a bitmap onto the hud -void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, ubyte alpha, +void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, uint8_t alpha, int sat_count = 0); // renders text, scaled, alphaed, saturated, -void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); +void RenderHUDText(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); // flags for RenderHudText. #define HUDTEXT_CENTERED 1 // renders text, scaled, alphaed, saturated, -void RenderHUDTextFlags(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); +void RenderHUDTextFlags(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); // reset hud messages. void ResetHUDMessages(); @@ -651,7 +651,7 @@ struct tMsgList { tMsgList(); void set_limit(int limit) { m_limit = limit; }; - bool add(const char *msg, ubyte lvl = 0, ubyte hr = 0, ubyte min = 0, ubyte sec = 0); + bool add(const char *msg, uint8_t lvl = 0, uint8_t hr = 0, uint8_t min = 0, uint8_t sec = 0); const char *get(int i); void reset(); }; diff --git a/Descent3/huddisplay.cpp b/Descent3/huddisplay.cpp index 288aa5dc..1d0e49d9 100644 --- a/Descent3/huddisplay.cpp +++ b/Descent3/huddisplay.cpp @@ -285,7 +285,7 @@ static inline int get_weapon_icon(int player, int type) { return HUD_resources.wpn_bmp; } -static void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *str); +static void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *str); ////////////////////////////////////////////////////////////////////////////// // Hud item display routines. @@ -701,7 +701,7 @@ void RenderHUDSecondary(tHUDItem *item) { void RenderHUDShipStatus(tHUDItem *item) { float clk_time_frame, inv_time_frame; - ubyte clk_alpha = 0, inv_alpha; + uint8_t clk_alpha = 0, inv_alpha; // render text status if (Objects[Players[Player_num].objnum].effect_info->type_flags & EF_CLOAKED) { @@ -858,7 +858,7 @@ int RenderHUDGetTextHeight(const char *string) { return (int)((str_height_curfont * aspect_y)); } -void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, ubyte alpha, +void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, uint8_t alpha, int sat_count) { int i; @@ -886,7 +886,7 @@ void RenderHUDQuad(int x, int y, int w, int h, float u0, float v0, float u1, flo } // renders text, scaled, alphaed, saturated, -void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...) { +void RenderHUDText(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...) { std::va_list arglist; char buf[128]; @@ -898,7 +898,7 @@ void RenderHUDText(ddgr_color col, ubyte alpha, int sat_count, int x, int y, con } // renders text, scaled, alphaed, saturated, -void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *str) { +void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *str) { int i; grtext_SetAlpha(alpha); @@ -922,7 +922,7 @@ void RenderHUDTextFlagsNoFormat(int flags, ddgr_color col, ubyte alpha, int sat_ } // renders text, scaled, alphaed, saturated, -void RenderHUDTextFlags(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...) { +void RenderHUDTextFlags(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...) { std::va_list arglist; char buf[128]; int i; @@ -974,7 +974,7 @@ void RenderHUDScore(tHUDItem *item) { int text_height = grfont_GetHeight(HUD_FONT); snprintf(buf, sizeof(buf), "%d ", Score_added); w = RenderHUDGetTextLineWidth(buf); // * win_w/Game_window_w; - ubyte alpha = std::min(HUD_ALPHA, HUD_ALPHA * 4 * Score_added_timer / SCORE_ADDED_TIME); + uint8_t alpha = std::min(HUD_ALPHA, HUD_ALPHA * 4 * Score_added_timer / SCORE_ADDED_TIME); RenderHUDText(item->color, alpha, 0, item->x - w - win_w, item->y + text_height, buf); Score_added_timer -= Frametime; } diff --git a/Descent3/hudmessage.cpp b/Descent3/hudmessage.cpp index c1fc38ec..233e8079 100644 --- a/Descent3/hudmessage.cpp +++ b/Descent3/hudmessage.cpp @@ -377,7 +377,7 @@ static tDirtyRect HUD_msg_dirty_rect; static float Hud_timer = 0.0f; -static ubyte Hud_persistent_msg_id = HUD_INVALID_ID; +static uint8_t Hud_persistent_msg_id = HUD_INVALID_ID; static float Hud_persistent_msg_timer = 0.0f; static int Hud_persistent_msg_flags = 0; static int Hud_persistent_msg_current_len; @@ -1486,7 +1486,7 @@ void ResetGameMessages() { void AddGameMessage(const char *msg) { int secs = (int)Gametime; - Game_msg_list.add(msg, (ubyte)Current_mission.cur_level, (secs / 3600), (secs / 60), secs % 60); + Game_msg_list.add(msg, (uint8_t)Current_mission.cur_level, (secs / 3600), (secs / 60), secs % 60); } void SGSGameMessages(CFILE *fp) { @@ -1547,7 +1547,7 @@ tMsgList::tMsgList() { m_msg = NULL; } -bool tMsgList::add(const char *msg, ubyte lvl, ubyte hr, ubyte min, ubyte sec) { +bool tMsgList::add(const char *msg, uint8_t lvl, uint8_t hr, uint8_t min, uint8_t sec) { char buf[2048]; if (!m_limit) diff --git a/Descent3/init.cpp b/Descent3/init.cpp index c5418865..fb518934 100644 --- a/Descent3/init.cpp +++ b/Descent3/init.cpp @@ -682,7 +682,7 @@ * * 113 8/27/98 6:23p Jeff * changed autoleveling in config so it is a slider...had to convert - * global from bool->ubyte. Added fast headlight and mirrored surfaces to + * global from bool->uint8_t. Added fast headlight and mirrored surfaces to * config menu * * 112 8/19/98 2:19p Jeff @@ -1031,7 +1031,7 @@ static chunked_bitmap Title_bitmap; static bool Init_systems_init = false; static bool Graphics_init = false; static bool Title_bitmap_init = false; -ubyte Use_motion_blur = 0; +uint8_t Use_motion_blur = 0; // The "root" directory of the D3 file tree char Base_directory[_MAX_PATH]; @@ -1195,12 +1195,12 @@ void SaveGameSettings() { // Write out force feedback Database->write("EnableJoystickFF", D3Use_force_feedback); Database->write("ForceFeedbackAutoCenter", D3Force_auto_center); - ubyte force_gain; + uint8_t force_gain; if (D3Force_gain < 0.0f) D3Force_gain = 0.0f; if (D3Force_gain > 1.0f) D3Force_gain = 1.0f; - force_gain = (ubyte)((100.0f * D3Force_gain) + 0.5f); + force_gain = (uint8_t)((100.0f * D3Force_gain) + 0.5f); Database->write("ForceFeedbackGain", force_gain); #ifndef RELEASE // never save this value out in release. @@ -1321,7 +1321,7 @@ void LoadGameSettings() { // force feedback stuff Database->read("EnableJoystickFF", &D3Use_force_feedback); Database->read("ForceFeedbackAutoCenter", &D3Force_auto_center); - ubyte force_gain; + uint8_t force_gain; Database->read("ForceFeedbackGain", &force_gain, sizeof(force_gain)); if (force_gain > 100) force_gain = 100; diff --git a/Descent3/levelgoal.cpp b/Descent3/levelgoal.cpp index a4b4401f..61d08f09 100644 --- a/Descent3/levelgoal.cpp +++ b/Descent3/levelgoal.cpp @@ -566,7 +566,7 @@ void lgoal::SendStateToPlayer(int index, int pnum) { // now update the buddy handle list of the clients int count = 0; int size_offset; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; size_offset = START_DATA(MP_WORLD_STATES, data, &count); diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index acf92351..a1ba5212 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -68,7 +68,7 @@ static ushort *Dynamic_lightmap_memory = NULL; static float Light_component_scalar[32]; float Ubyte_to_float[256]; -static ubyte Lmi_spoken_for[MAX_LIGHTMAP_INFOS / 8]; +static uint8_t Lmi_spoken_for[MAX_LIGHTMAP_INFOS / 8]; static dynamic_lightmap *Dynamic_lightmaps; static dynamic_face Dynamic_face_list[MAX_DYNAMIC_FACES]; @@ -149,7 +149,7 @@ void InitDynamicLighting() { memset(&Dynamic_lightmaps[i], 0, sizeof(dynamic_lightmap)); } - // Setup ubyte to float + // Setup uint8_t to float for (i = 0; i < 256; i++) Ubyte_to_float[i] = (float)i / 255.0; @@ -174,7 +174,7 @@ void InitDynamicLighting() { // Given a float, returns the index into the Ubyte_float_table that this number // corresponds to -ubyte Float_to_ubyte(float fnum) { +uint8_t Float_to_ubyte(float fnum) { int i; if (fnum < 0 || fnum > 1.0) { @@ -557,7 +557,7 @@ struct light_instance_context { } Light_instance_stack[MAX_SUBOBJECTS]; int Light_instance_depth = 0; -ubyte Use_light_direction = 0; +uint8_t Use_light_direction = 0; vector Light_position; vector Light_direction; @@ -1605,7 +1605,7 @@ void ApplyLightingToTerrain(vector *pos, int cellnum, float light_dist, float re // TODO: MTS: Unused? // Sets pulse parameters for an entire room -void SetRoomPulse(room *rp, ubyte pulse_time, ubyte pulse_offset) { +void SetRoomPulse(room *rp, uint8_t pulse_time, uint8_t pulse_offset) { ASSERT(rp->used); rp->pulse_time = pulse_time; diff --git a/Descent3/lighting.h b/Descent3/lighting.h index 55426a81..27b92fa5 100644 --- a/Descent3/lighting.h +++ b/Descent3/lighting.h @@ -41,7 +41,7 @@ extern float Specular_tables[3][MAX_SPECULAR_INCREMENTS]; typedef struct { ushort *mem_ptr; - ubyte used; + uint8_t used; } dynamic_lightmap; typedef struct { @@ -50,7 +50,7 @@ typedef struct { typedef struct { ushort cellnum; - ubyte r, g, b; + uint8_t r, g, b; } dynamic_cell; // Sets up our dynamic lighting maps @@ -82,7 +82,7 @@ int SearchLightQuadTree(face *fp, vector *rvec, vector *uvec, dynamic_face *dyna // Given a float, returns the index into the Ubyte_float_table that this number // corresponds to -ubyte Float_to_ubyte(float fnum); +uint8_t Float_to_ubyte(float fnum); extern float Ubyte_to_float[]; @@ -98,7 +98,7 @@ void CountFaceLights(); void DoFaceLighting(); // Sets pulse parameters for an entire room -void SetRoomPulse(room *rp, ubyte pulse_time, ubyte pulse_offset); +void SetRoomPulse(room *rp, uint8_t pulse_time, uint8_t pulse_offset); // Returns the total number of bytes needed for volume lighting in this room int GetVolumeSizeOfRoom(room *rp, int *w = NULL, int *h = NULL, int *d = NULL); diff --git a/Descent3/lightmap_info.h b/Descent3/lightmap_info.h index b47a8581..bb61e55c 100644 --- a/Descent3/lightmap_info.h +++ b/Descent3/lightmap_info.h @@ -55,16 +55,16 @@ #define LMI_EXTERNAL_ROOM_OBJECT 6 typedef struct { - ubyte xspacing, yspacing; + uint8_t xspacing, yspacing; ushort lm_handle; vector upper_left, normal; - ubyte width, height, x1, y1; - ubyte used; + uint8_t width, height, x1, y1; + uint8_t used; ushort dynamic; short spec_map; - ubyte type; // see LMI_types above + uint8_t type; // see LMI_types above } lightmap_info; extern lightmap_info *LightmapInfo; diff --git a/Descent3/loadstate.cpp b/Descent3/loadstate.cpp index f614311e..47f2718a 100644 --- a/Descent3/loadstate.cpp +++ b/Descent3/loadstate.cpp @@ -281,7 +281,7 @@ int LoadGameState(const char *pathname) { gs_Xlates = new gs_tables; // read in header and do version check. - cf_ReadBytes((ubyte *)desc, sizeof(desc), fp); + cf_ReadBytes((uint8_t *)desc, sizeof(desc), fp); version = (ushort)cf_ReadShort(fp); if (version < GAMESAVE_OLDVER) { Int3(); @@ -336,7 +336,7 @@ int LoadGameState(const char *pathname) { goto loadsg_error; } } - cf_ReadBytes((ubyte *)&Weather, sizeof(Weather), fp); + cf_ReadBytes((uint8_t *)&Weather, sizeof(Weather), fp); // Restore active doorways { @@ -425,7 +425,7 @@ bool GetGameStateInfo(const char *pathname, char *description, int *bm_handle) { if (!fp) return false; - if (!cf_ReadBytes((ubyte *)desc, GAMESAVE_DESCLEN + 1, fp)) { + if (!cf_ReadBytes((uint8_t *)desc, GAMESAVE_DESCLEN + 1, fp)) { strcpy(description, TXT_ILLEGALSAVEGAME); goto savesg_error; } @@ -536,7 +536,7 @@ int LGSMission(const char *msnname, int level) { return LGS_OK; } -extern ubyte AutomapVisMap[MAX_ROOMS]; +extern uint8_t AutomapVisMap[MAX_ROOMS]; // initializes rooms int LGSRooms(CFILE *fp) { @@ -557,7 +557,7 @@ int LGSRooms(CFILE *fp) { } for (i = 0; i <= highest_index; i++) { - ubyte used; + uint8_t used; gs_ReadByte(fp, used); if (used) { // reset lists @@ -662,15 +662,15 @@ int LGSTriggers(CFILE *fp) { typedef struct { int obj_handle, dest_objhandle; - ubyte subnum, subnum2; + uint8_t subnum, subnum2; ushort modelnum; ushort vertnum, end_vertnum; } old_vis_attach_info; typedef struct { - ubyte type; - ubyte id; + uint8_t type; + uint8_t id; vector pos; @@ -685,7 +685,7 @@ typedef struct { int roomnum; ushort flags; int phys_flags; - ubyte movement_type; + uint8_t movement_type; short custom_handle; ushort lighting_color; @@ -742,7 +742,7 @@ int LGSVisEffects(CFILE *fp) { int roomnum, v; vis_effect vis; - cf_ReadBytes((ubyte *)&vis, sizeof(vis_effect), fp); + cf_ReadBytes((uint8_t *)&vis, sizeof(vis_effect), fp); roomnum = vis.roomnum; // Check for old struct, and if found, fix it @@ -752,10 +752,10 @@ int LGSVisEffects(CFILE *fp) { old_vis_effect old_vis; // Copy new into old - memcpy((ubyte *)&old_vis, (ubyte *)&vis, sizeof(vis_effect)); + memcpy((uint8_t *)&old_vis, (uint8_t *)&vis, sizeof(vis_effect)); // Read extra data from old - cf_ReadBytes(((ubyte *)&old_vis) + sizeof(vis_effect), sizeof(old_vis_effect) - sizeof(vis_effect), fp); + cf_ReadBytes(((uint8_t *)&old_vis) + sizeof(vis_effect), sizeof(old_vis_effect) - sizeof(vis_effect), fp); // Copy from old to new struct CopyVisStruct(&vis, &old_vis); @@ -790,7 +790,7 @@ int LGSPlayers(CFILE *fp) { return LGS_OUTDATEDVER; } else { int guided_handle; - cf_ReadBytes((ubyte *)plr, sizeof(player), fp); + cf_ReadBytes((uint8_t *)plr, sizeof(player), fp); if (plr->guided_obj) { gs_ReadInt(fp, guided_handle); plr->guided_obj = &Objects[guided_handle & HANDLE_OBJNUM_MASK]; @@ -850,7 +850,7 @@ int LGSObjects(CFILE *fp, int version) { int num_marker_msgs = cf_ReadShort(fp); for (i = 0; i < num_marker_msgs; i++) { int msg_len = cf_ReadShort(fp); - cf_ReadBytes((ubyte *)MarkerMessages[i], msg_len, fp); + cf_ReadBytes((uint8_t *)MarkerMessages[i], msg_len, fp); } highest_index = (int)cf_ReadShort(fp); @@ -952,7 +952,7 @@ int LGSObjects(CFILE *fp, int version) { object_info *obji; door *door; int index, nattach, new_model, handle; - ubyte type, dummy_type; + uint8_t type, dummy_type; short sindex, size; // if((i==98)||(i==100)) @@ -973,7 +973,7 @@ int LGSObjects(CFILE *fp, int version) { Osiris_EnableEvents(OEM_OBJECTS | OEM_TRIGGERS | OEM_LEVELS); continue; } - ubyte l_rend_type; + uint8_t l_rend_type; gs_ReadByte(fp, l_rend_type); // See if the object has changed from it's original lightmap type @@ -989,13 +989,13 @@ int LGSObjects(CFILE *fp, int version) { op->lighting_render_type = l_rend_type; // Store whether or not we have a pointer to lighting_info - ubyte has_lightinfo; + uint8_t has_lightinfo; gs_ReadByte(fp, has_lightinfo); if (has_lightinfo) { if (!op->lighting_info) { op->lighting_info = (light_info *)mem_malloc(sizeof(*op->lighting_info)); } - cf_ReadBytes((ubyte *)op->lighting_info, sizeof(*op->lighting_info), fp); + cf_ReadBytes((uint8_t *)op->lighting_info, sizeof(*op->lighting_info), fp); } // validate handle. @@ -1024,7 +1024,7 @@ int LGSObjects(CFILE *fp, int version) { if (!op->name) Error("Out of memory"); - cf_ReadBytes((ubyte *)op->name, j, fp); + cf_ReadBytes((uint8_t *)op->name, j, fp); op->name[j] = '\0'; } else { op->name = NULL; @@ -1152,7 +1152,7 @@ int LGSObjects(CFILE *fp, int version) { if (!op->custom_default_script_name) Error("Out of memory"); - cf_ReadBytes((ubyte *)op->custom_default_script_name, j, fp); + cf_ReadBytes((uint8_t *)op->custom_default_script_name, j, fp); op->custom_default_script_name[j] = '\0'; } else { op->custom_default_script_name = NULL; @@ -1164,7 +1164,7 @@ int LGSObjects(CFILE *fp, int version) { if (!op->custom_default_module_name) Error("Out of memory"); - cf_ReadBytes((ubyte *)op->custom_default_module_name, j, fp); + cf_ReadBytes((uint8_t *)op->custom_default_module_name, j, fp); op->custom_default_module_name[j] = '\0'; } else { op->custom_default_module_name = NULL; @@ -1184,7 +1184,7 @@ int LGSObjects(CFILE *fp, int version) { retval = LGS_OUTDATEDVER; goto done; } - cf_ReadBytes((ubyte *)&op->mtype, size, fp); + cf_ReadBytes((uint8_t *)&op->mtype, size, fp); VERIFY_SAVEFILE; // Control info, determined by CONTROL_TYPE @@ -1194,7 +1194,7 @@ int LGSObjects(CFILE *fp, int version) { retval = LGS_OUTDATEDVER; goto done; } - cf_ReadBytes((ubyte *)&op->ctype, size, fp); + cf_ReadBytes((uint8_t *)&op->ctype, size, fp); VERIFY_SAVEFILE; // remap bitmap handle if this is a fireball! @@ -1217,7 +1217,7 @@ int LGSObjects(CFILE *fp, int version) { retval = LGS_OUTDATEDVER; goto done; } - cf_ReadBytes((ubyte *)&op->rtype, size, fp); + cf_ReadBytes((uint8_t *)&op->rtype, size, fp); op->size = cf_ReadFloat(fp); @@ -1317,7 +1317,7 @@ int LGSObjects(CFILE *fp, int version) { } // Do Animation stuff custom_anim multi_anim_info; - cf_ReadBytes((ubyte *)&multi_anim_info, sizeof(multi_anim_info), fp); + cf_ReadBytes((uint8_t *)&multi_anim_info, sizeof(multi_anim_info), fp); ObjSetAnimUpdate(i, &multi_anim_info); break; } @@ -1457,7 +1457,7 @@ int LGSObjAI(CFILE *fp, ai_frame **pai) { *pai = (ai_frame *)mem_malloc(size); ai = *pai; - cf_ReadBytes((ubyte *)ai, size, fp); + cf_ReadBytes((uint8_t *)ai, size, fp); return LGS_OK; } @@ -1478,14 +1478,14 @@ int LGSObjEffects(CFILE *fp, object *op) { op->effect_info = (effect_info_s *)mem_malloc(size); effect_info_s *ei = op->effect_info; - cf_ReadBytes((ubyte *)ei, size, fp); + cf_ReadBytes((uint8_t *)ei, size, fp); } return LGS_OK; } //@@// loads script -//@@vector *LGSScript(CFILE *fp, script_info *script, ubyte *is_scripted, int *memsize) +//@@vector *LGSScript(CFILE *fp, script_info *script, uint8_t *is_scripted, int *memsize) //@@{ //@@ int i; //@@ char name[64]; @@ -1549,7 +1549,7 @@ int LGSObjWB(CFILE *fp, object *op) { for (i = 0; i < num_wbs; i++) { dynamic_wb_info *dwb = &dwba[i]; - cf_ReadBytes((ubyte *)dwb, sizeof(dynamic_wb_info), fp); + cf_ReadBytes((uint8_t *)dwb, sizeof(dynamic_wb_info), fp); } op->dynamic_wb = dwba; @@ -1571,10 +1571,10 @@ int LGSSpew(CFILE *fp) { gs_ReadShort(fp, spew_count); for (i = 0; i < MAX_SPEW_EFFECTS; i++) { - ubyte used; + uint8_t used; gs_ReadByte(fp, used); if (used) - cf_ReadBytes((ubyte *)&SpewEffects[i], sizeof(spewinfo), fp); + cf_ReadBytes((uint8_t *)&SpewEffects[i], sizeof(spewinfo), fp); } return LGS_OK; diff --git a/Descent3/localization.cpp b/Descent3/localization.cpp index b8422b39..6ec9b8cb 100644 --- a/Descent3/localization.cpp +++ b/Descent3/localization.cpp @@ -631,7 +631,7 @@ char *_parse_escape_chars(char *buffer) { // see if we have a number if ((buffer[b_index] >= '0') && (buffer[b_index] <= '9')) { // we have a number, so parse the value - ubyte value = 0; + uint8_t value = 0; while ((buffer[b_index] >= '0') && (buffer[b_index] <= '9')) { value = (value * 10) + buffer[b_index] - '0'; b_index++; diff --git a/Descent3/matcen.h b/Descent3/matcen.h index 6f1fca08..ae3f54c1 100644 --- a/Descent3/matcen.h +++ b/Descent3/matcen.h @@ -62,7 +62,7 @@ private: char m_type; char m_creation_effect; short m_creation_texture; - ubyte m_cur_saturation_count; + uint8_t m_cur_saturation_count; int m_num_spawn_pnts; diff --git a/Descent3/menu.h b/Descent3/menu.h index 69d3d6f9..f8bd0767 100644 --- a/Descent3/menu.h +++ b/Descent3/menu.h @@ -95,7 +95,7 @@ typedef struct { int num_items; menu_item items[MAX_MENU_ITEMS]; - ubyte used; + uint8_t used; } menu; // returns whether we decided to quit the game or not diff --git a/Descent3/mission_download.cpp b/Descent3/mission_download.cpp index f8b59682..337665fa 100644 --- a/Descent3/mission_download.cpp +++ b/Descent3/mission_download.cpp @@ -155,7 +155,7 @@ msn_urls *msn_GetURL(network_address *net_addr) { int count = 0; int size; int tries = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; float start_time; network_address from_addr; @@ -516,12 +516,12 @@ int msn_DownloadWithStatus(char *url, char *filename) { */ } -void msn_DoAskForURL(ubyte *indata, network_address *net_addr) { +void msn_DoAskForURL(uint8_t *indata, network_address *net_addr) { static msn_urls *url; int count = 0; int size; int i; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int num_urls = 0; if (Netgame.local_role == LR_SERVER) { @@ -571,7 +571,7 @@ void msn_DoAskForURL(ubyte *indata, network_address *net_addr) { } } -void msn_DoCurrMsnURLs(ubyte *data, network_address *net_addr) { +void msn_DoCurrMsnURLs(uint8_t *data, network_address *net_addr) { int count = 0; int num_urls = 0; int i; diff --git a/Descent3/mission_download.h b/Descent3/mission_download.h index 1582438a..f8f5a7c3 100644 --- a/Descent3/mission_download.h +++ b/Descent3/mission_download.h @@ -58,8 +58,8 @@ typedef struct { } msn_urls; // Function prototypes -void msn_DoAskForURL(ubyte *indata, network_address *net_addr); -void msn_DoCurrMsnURLs(ubyte *data, network_address *net_addr); +void msn_DoAskForURL(uint8_t *indata, network_address *net_addr); +void msn_DoCurrMsnURLs(uint8_t *data, network_address *net_addr); int msn_CheckGetMission(network_address *net_addr, char *filename); int msn_ShowDownloadChoices(msn_urls *urls); int msn_DownloadWithStatus(char *url, char *filename); diff --git a/Descent3/mmItem.cpp b/Descent3/mmItem.cpp index b3bda550..e5a692ef 100644 --- a/Descent3/mmItem.cpp +++ b/Descent3/mmItem.cpp @@ -246,7 +246,7 @@ void mmItem::OnDraw() { ui_SetCharAlpha(255); ui_DrawString(m_colors[0], 0, 0, m_text); ui_DrawSetTextType(UI_TEXTTYPE_SATURATE); - ui_SetCharAlpha((ubyte)m_alpha); + ui_SetCharAlpha((uint8_t)m_alpha); for (i = 0; i < m_satcount; i++) ui_DrawString(m_colors[0], 0, 0, m_text); } diff --git a/Descent3/multi.cpp b/Descent3/multi.cpp index a411ff32..9642d771 100644 --- a/Descent3/multi.cpp +++ b/Descent3/multi.cpp @@ -85,7 +85,7 @@ * * 514 9/09/99 12:24p Kevin * Fixed a bug that was causing problems in the Mac version - * (Game_is_master_tracker_game was defined as a ubyte in the game, but an + * (Game_is_master_tracker_game was defined as a uint8_t in the game, but an * int in the dll) * * 513 9/02/99 3:34p Jason @@ -1745,22 +1745,22 @@ bool Multi_bail_ui_menu = false; uint32_t Multi_generic_match_table[MAX_OBJECT_IDS]; uint32_t Multi_weapon_match_table[MAX_WEAPONS]; -ubyte Multi_receive_buffer[MAX_RECEIVE_SIZE]; +uint8_t Multi_receive_buffer[MAX_RECEIVE_SIZE]; -ubyte Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; +uint8_t Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; int Multi_send_size[MAX_NET_PLAYERS]; player_fire_packet Player_fire_packet[MAX_NET_PLAYERS]; float Multi_last_sent_time[MAX_NET_PLAYERS][MAX_NET_PLAYERS]; -ubyte Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; +uint8_t Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; int Multi_reliable_send_size[MAX_NET_PLAYERS]; float Multi_reliable_last_send_time[MAX_NET_PLAYERS]; -ubyte Multi_reliable_sent_position[MAX_NET_PLAYERS]; -ubyte Multi_reliable_urgent[MAX_NET_PLAYERS]; +uint8_t Multi_reliable_sent_position[MAX_NET_PLAYERS]; +uint8_t Multi_reliable_urgent[MAX_NET_PLAYERS]; // For keeping track of buildings that have changed -ubyte Multi_building_states[MAX_OBJECTS]; +uint8_t Multi_building_states[MAX_OBJECTS]; ushort Multi_num_buildings_changed = 0; // For keeping track of powerup respawn points @@ -1825,8 +1825,8 @@ char Multi_message_of_the_day[HUD_MESSAGE_LENGTH * 2] = {0}; // Local function prototypes void SendDataChunk(int playernum); void DenyFile(int playernum, int filenum, int file_who); -void MultiDoFileCancelled(ubyte *data); -void MultiDoCustomPlayerData(ubyte *data); +void MultiDoFileCancelled(uint8_t *data); +void MultiDoCustomPlayerData(uint8_t *data); char *GetFileNameFromPlayerAndID(short playernum, short id); // Multiplayer position flags @@ -1869,19 +1869,19 @@ void BailOnMultiplayer(const char *message) { } // Adds the trunctuated position data to an outgoing packet -void MultiAddPositionData(vector *pos, ubyte *data, int *count) { +void MultiAddPositionData(vector *pos, uint8_t *data, int *count) { MultiAddUshort((pos->x * 16.0), data, count); MultiAddUshort((pos->z * 16.0), data, count); MultiAddFloat(pos->y, data, count); } -void MultiExtractPositionData(vector *vec, ubyte *data, int *count) { +void MultiExtractPositionData(vector *vec, uint8_t *data, int *count) { vec->x = ((float)MultiGetUshort(data, count)) / 16.0; vec->z = ((float)MultiGetUshort(data, count)) / 16.0; vec->y = MultiGetFloat(data, count); } void MultiSendBadChecksum(int slot) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size; int count = 0; size = START_DATA(MP_REJECTED_CHECKSUM, data, &count); @@ -1891,10 +1891,10 @@ void MultiSendBadChecksum(int slot) { // Puts player "slot" position info into the passed in buffer // Returns the number of bytes used -int MultiStuffPosition(int slot, ubyte *data) { +int MultiStuffPosition(int slot, uint8_t *data) { int size; int count = 0; - ubyte flags = 0; + uint8_t flags = 0; object *obj = &Objects[Players[slot].objnum]; @@ -1997,7 +1997,7 @@ void DoNextPlayerFile(int playernum) { // Puts player "slot" position info into the passed in buffer // Returns the number of bytes used -int MultiStuffRobotPosition(uint16_t objectnum, ubyte *data) { +int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data) { int size; int count = 0; //@@multi_orientation mat; @@ -2048,7 +2048,7 @@ int MultiStuffRobotPosition(uint16_t objectnum, ubyte *data) { int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum) { int size; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // mprintf((0,"Sending Robot %d fired.\n",objectnum)); // Check to make sure we're the server if (Netgame.local_role != LR_SERVER) { @@ -2094,7 +2094,7 @@ int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint1 return count; } -void MultiDoRobotFire(ubyte *data) { +void MultiDoRobotFire(uint8_t *data) { int count = 0; uint16_t obj_num; vector weapon_pos; @@ -2152,7 +2152,7 @@ void MultiAnnounceEffect(object *obj, float size, float time) { // the data to process_big_data void MultiProcessIncoming() { int size, i; - ubyte *data; + uint8_t *data; network_address from_addr; data = &(Multi_receive_buffer[0]); @@ -2191,7 +2191,7 @@ void MultiProcessIncoming() { } // Starts a packet of data -int START_DATA(int type, ubyte *data, int *count, ubyte reliable) { +int START_DATA(int type, uint8_t *data, int *count, uint8_t reliable) { int size_offset; MultiAddByte(type, data, count); @@ -2221,10 +2221,10 @@ int START_DATA(int type, ubyte *data, int *count, ubyte reliable) { } // End a pakcet of data -void END_DATA(int count, ubyte *data, int offset) { MultiAddShort(count, data, &offset); } +void END_DATA(int count, uint8_t *data, int offset) { MultiAddShort(count, data, &offset); } // Skips the header stuff at the beginning of a packet -void SKIP_HEADER(ubyte *data, int *count) { +void SKIP_HEADER(uint8_t *data, int *count) { MultiGetByte(data, count); MultiGetShort(data, count); } @@ -2284,8 +2284,8 @@ int MultiMatchPlayerToAddress(network_address *from_addr) { // Gets info about a player // Server only extern int Buddy_handle[MAX_PLAYERS]; -bool AINotify(object *obj, ubyte notify_type, void *info); -void MultiDoMyInfo(ubyte *data) { +bool AINotify(object *obj, uint8_t notify_type, void *info); +void MultiDoMyInfo(uint8_t *data) { int count = 0; char ship_name[PAGENAME_LEN]; int length; @@ -2293,7 +2293,7 @@ void MultiDoMyInfo(ubyte *data) { // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { mprintf((1, "ERROR! We got a MY_INFO packet from a disconnected player!\n")); Int3(); // Get Jason @@ -2301,7 +2301,7 @@ void MultiDoMyInfo(ubyte *data) { } // Copy the name out - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); if (len > CALLSIGN_LEN) length = CALLSIGN_LEN; else @@ -2409,13 +2409,13 @@ void MultiDoMyInfo(ubyte *data) { // Tell a client about the players connected // Server only -void MultiDoRequestPlayers(ubyte *data) { +void MultiDoRequestPlayers(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { mprintf((1, "ERROR! We got a MY_INFO packet from a disconnected player!\n")); Int3(); // Get Jason @@ -2427,13 +2427,13 @@ void MultiDoRequestPlayers(ubyte *data) { // Tell a client about the buildings // Server only -void MultiDoRequestBuildings(ubyte *data) { +void MultiDoRequestBuildings(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { mprintf((1, "ERROR! We got a request buildings packet from a disconnected player!\n")); Int3(); // Get Jason @@ -2445,13 +2445,13 @@ void MultiDoRequestBuildings(ubyte *data) { // Tell a client about the objects // Server only -void MultiDoRequestObjects(ubyte *data) { +void MultiDoRequestObjects(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { mprintf((1, "ERROR! We got a request object packet from a disconnected player!\n")); Int3(); // Get Jason @@ -2463,14 +2463,14 @@ void MultiDoRequestObjects(ubyte *data) { // Tell a client about the objects // Server only -void MultiDoRequestWorldStates(ubyte *data) { +void MultiDoRequestWorldStates(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); - ubyte rxdigest[16]; + uint8_t rxdigest[16]; for (int i = 0; i < 16; i++) { rxdigest[i] = MultiGetByte(data, &count); } @@ -2510,7 +2510,7 @@ void MultiDoRequestWorldStates(ubyte *data) { // The server is telling me about a player in the game // Client only -void MultiDoPlayer(ubyte *data) { +void MultiDoPlayer(uint8_t *data) { int count = 0; char ship_name[PAGENAME_LEN]; @@ -2520,7 +2520,7 @@ void MultiDoPlayer(ubyte *data) { SKIP_HEADER(data, &count); // Get slotnumber - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); // Reset some local stuff for this player if (slot != Player_num) { @@ -2532,7 +2532,7 @@ void MultiDoPlayer(ubyte *data) { } // Get name - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(Players[slot].callsign, &data[count], len); count += len; @@ -2571,7 +2571,7 @@ void MultiDoPlayer(ubyte *data) { } // Get team - ubyte temp_team = MultiGetByte(data, &count); + uint8_t temp_team = MultiGetByte(data, &count); Players[slot].team = (temp_team == 255) ? -1 : temp_team; // Get team start @@ -2581,7 +2581,7 @@ void MultiDoPlayer(ubyte *data) { } // Get observer mode - ubyte observing = MultiGetByte(data, &count); + uint8_t observing = MultiGetByte(data, &count); // Put in address memcpy(&NetPlayers[slot].addr, data + count, sizeof(network_address)); @@ -2646,7 +2646,7 @@ void MultiDoPlayer(ubyte *data) { // Tells all our clients about a new player entering the game void MultiSendNewPlayer(int slot) {} -void MultiDoPlayerEnteredGame(ubyte *data) { +void MultiDoPlayerEnteredGame(uint8_t *data) { int count = 0; char ship_name[PAGENAME_LEN]; int length; @@ -2657,14 +2657,14 @@ void MultiDoPlayerEnteredGame(ubyte *data) { SKIP_HEADER(data, &count); // Get slot number for this player - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (slot > MAX_PLAYERS) return; ScoreAPIPlayerJoin(slot); // get name - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); if (len > CALLSIGN_LEN) length = CALLSIGN_LEN; @@ -2744,7 +2744,7 @@ void MultiDoPlayerEnteredGame(ubyte *data) { void MultiSendPlayerEnteredGame(int which) { MULTI_ASSERT(Netgame.local_role == LR_SERVER, NULL); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -2805,13 +2805,13 @@ void MultiSendPlayerEnteredGame(int which) { // Client is saying that he's entering the game // Server only -void MultiDoEnteringGame(ubyte *data) { +void MultiDoEnteringGame(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (!(NetPlayers[slot].flags & NPF_CONNECTED)) { Int3(); // Get Jason @@ -2850,7 +2850,7 @@ void MultiDoEnteringGame(ubyte *data) { // Tell the server I'm entering the game void MultiSendEnteringGame() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending entering game\n")); @@ -2866,7 +2866,7 @@ void MultiSendEnteringGame() { // Server only void MultiSendDamagePlayer(int slot, int weapon_id, int type, float amount) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; MULTI_ASSERT(Netgame.local_role == LR_SERVER, NULL); @@ -2882,7 +2882,7 @@ void MultiSendDamagePlayer(int slot, int weapon_id, int type, float amount) { } // The server says to damage a player, so do it! -void MultiDoDamagePlayer(ubyte *data) { +void MultiDoDamagePlayer(uint8_t *data) { if (Netgame.local_role != LR_CLIENT) { Int3(); @@ -2892,9 +2892,9 @@ void MultiDoDamagePlayer(ubyte *data) { int count = 0; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); - ubyte weapon_id = MultiGetByte(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); + uint8_t weapon_id = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); float amount = MultiGetFloat(data, &count); ApplyDamageToPlayer(&Objects[Players[slot].objnum], NULL, type, amount, 1, weapon_id); @@ -2946,13 +2946,13 @@ void MultiMakePlayerReal(int slot) { } // Server is telling us that its done sending players -void MultiDoDonePlayers(ubyte *data) { +void MultiDoDonePlayers(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte num = MultiGetByte(data, &count); + uint8_t num = MultiGetByte(data, &count); if (MultiCountPlayers() != num) { mprintf((1, "ERROR! We don't have the correct number of players!")); Int3(); // Get Jason @@ -2963,7 +2963,7 @@ void MultiDoDonePlayers(ubyte *data) { } // Server is telling us that its done sending buildings -void MultiDoDoneBuildings(ubyte *data) { +void MultiDoDoneBuildings(uint8_t *data) { MULTI_ASSERT(Netgame.local_role == LR_CLIENT, NULL); int count = 0; @@ -2974,7 +2974,7 @@ void MultiDoDoneBuildings(ubyte *data) { } // Server is telling us that its done sending objects -void MultiDoDoneObjects(ubyte *data) { +void MultiDoDoneObjects(uint8_t *data) { MULTI_ASSERT(Netgame.local_role == LR_CLIENT, NULL); int count = 0; @@ -3014,7 +3014,7 @@ void MultiDoDoneObjects(ubyte *data) { } // Server is telling us that its done sending objects -void MultiDoDoneWorldStates(ubyte *data) { +void MultiDoDoneWorldStates(uint8_t *data) { MULTI_ASSERT(Netgame.local_role == LR_CLIENT, NULL); int count = 0; @@ -3059,14 +3059,14 @@ void MultiExtractMatrix(matrix *dest, multi_orientation *src) { dest->fvec.z = (float)src->multi_matrix[8] / 32767.0; } -void MultiDoPlayerPos(ubyte *data) { +void MultiDoPlayerPos(uint8_t *data) { int use_smoothing = (Netgame.flags & NF_USE_SMOOTHING); int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); // Make sure its not out of order float packet_time = MultiGetFloat(data, &count); @@ -3123,14 +3123,14 @@ void MultiDoPlayerPos(ubyte *data) { // obj->mtype.phys_info.velocity=vel; // Get weapon states - ubyte windex = MultiGetByte(data, &count); + uint8_t windex = MultiGetByte(data, &count); Players[slot].weapon[PW_PRIMARY].index = windex & 0x0F; Players[slot].weapon[PW_SECONDARY].index = (windex >> 4) + 10; // Get energy Players[slot].energy = MultiGetUbyte(data, &count); // Get flags - ubyte flags = MultiGetByte(data, &count); + uint8_t flags = MultiGetByte(data, &count); // Do special stuff for non-visible objects bool visible = true; @@ -3239,7 +3239,7 @@ void MultiDoPlayerPos(ubyte *data) { } } -void MultiDoRobotPos(ubyte *data) { +void MultiDoRobotPos(uint8_t *data) { int count = 0; //@@multi_orientation multi_mat; // Skip header stuff @@ -3270,7 +3270,7 @@ void MultiDoRobotPos(ubyte *data) { // Get room and terrain flag short_roomnum = MultiGetUshort(data, &count); - ubyte terrain = MultiGetByte(data, &count); + uint8_t terrain = MultiGetByte(data, &count); roomnum = short_roomnum; if (terrain) @@ -3292,7 +3292,7 @@ void MultiDoRobotPos(ubyte *data) { } // Stuffs a players firing information into a packet -int MultiStuffPlayerFire(int slot, ubyte *data) { +int MultiStuffPlayerFire(int slot, uint8_t *data) { int size_offset; int count = 0; @@ -3329,14 +3329,14 @@ void MultiSubtractAmmoToFire(int slot, int wb_index) { #define MPFF_QUADED 128 // Sends a fire packet from a player -void MultiSendFirePlayerWB(int playernum, ubyte wb_index, ubyte fire_mask, ubyte reliable, float scalar) { +void MultiSendFirePlayerWB(int playernum, uint8_t wb_index, uint8_t fire_mask, uint8_t reliable, float scalar) { // Send quaded info if needed - ubyte index_to_send = wb_index; + uint8_t index_to_send = wb_index; if (Objects[Players[playernum].objnum].dynamic_wb[wb_index].flags & DWBF_QUAD) index_to_send |= MPFF_QUADED; - ubyte damage_scalar = (scalar * 64.0); + uint8_t damage_scalar = (scalar * 64.0); Player_fire_packet[playernum].fire_mask = fire_mask; Player_fire_packet[playernum].damage_scalar = damage_scalar; @@ -3358,7 +3358,7 @@ void MultiSendFirePlayerWB(int playernum, ubyte wb_index, ubyte fire_mask, ubyte } // Does player firing -void MultiDoFirePlayerWB(ubyte *data) { +void MultiDoFirePlayerWB(uint8_t *data) { int count = 0, ok_to_fire = 1; // Skip header stuff @@ -3426,7 +3426,7 @@ void MultiDoFirePlayerWB(ubyte *data) { // Tell everyone I'm quitting void MultiSendLeaveGame() { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -3478,7 +3478,7 @@ void MultiLeaveGame() { } // Releases a missile that belongs to a player -void MultiDoReleaseTimeoutMissile(ubyte *data) { +void MultiDoReleaseTimeoutMissile(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -3495,7 +3495,7 @@ void MultiDoReleaseTimeoutMissile(ubyte *data) { // Tell everyone I'm timingout my timeout weapon void MultiSendReleaseTimeoutMissile() { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -3516,7 +3516,7 @@ void MultiSendReleaseTimeoutMissile() { // Tells all the clients who are trying to join to piss off until the next level void MultiSendConnectBail() { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; bool wait_to_send = false; @@ -3569,7 +3569,7 @@ void MultiEndLevel() { } // server is telling us the level has ended -void MultiDoLevelEnded(ubyte *data) { +void MultiDoLevelEnded(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -3600,7 +3600,7 @@ void MultiDoLevelEnded(ubyte *data) { void MultiSendLevelEnded(int success, int next_level) { MULTI_ASSERT(Netgame.local_role == LR_SERVER, NULL); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -3639,7 +3639,7 @@ void MultiSendLevelEnded(int success, int next_level) { extern void MultiClearPlayerMarkers(int slot); // Do leave game stuff -void MultiDoLeaveGame(ubyte *data) { +void MultiDoLeaveGame(uint8_t *data) { int count = 0; mprintf((0, "In MultiDoLeaveGame!\n")); @@ -3647,7 +3647,7 @@ void MultiDoLeaveGame(ubyte *data) { // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (NetPlayers[slot].flags & NPF_CONNECTED) { if (NetPlayers[slot].sequence == NETSEQ_PLAYING) { @@ -3696,7 +3696,7 @@ void MultiDoLeaveGame(ubyte *data) { ScoreAPIPlayerLeft(slot); } -void MultiDoServerQuit(ubyte *data) { +void MultiDoServerQuit(uint8_t *data) { ShowProgressScreen(TXT_MLTSERVERQUIT); // Abort all file transfers // ddio_DeleteFile(NetPlayers[filewho].file_xfer_cfile->name); @@ -3720,13 +3720,13 @@ void MultiDoServerQuit(ubyte *data) { Sleep(2000); } -void MultiDoDisconnect(ubyte *data) { +void MultiDoDisconnect(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (NetPlayers[slot].flags & NPF_CONNECTED) { if (NetPlayers[slot].file_xfer_flags != NETFILE_NONE) { @@ -3754,7 +3754,7 @@ void MultiDoDisconnect(ubyte *data) { ScoreAPIPlayerLeft(slot); } -void MultiDoServerRejectedChecksum(ubyte *data) { +void MultiDoServerRejectedChecksum(uint8_t *data) { int count = 0; MULTI_ASSERT(Netgame.local_role == LR_CLIENT, NULL); @@ -3766,7 +3766,7 @@ void MultiDoServerRejectedChecksum(ubyte *data) { } // Lets us know if the server says its ok to join -void MultiDoJoinResponse(ubyte *data) { +void MultiDoJoinResponse(uint8_t *data) { int count = 0; MULTI_ASSERT(Netgame.local_role == LR_CLIENT, NULL); @@ -3794,8 +3794,8 @@ int MultiFindFreeSlot() { // Someone is asking to join our game // Tell them if its ok -void MultiDoAskToJoin(ubyte *data, network_address *from_addr) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoAskToJoin(uint8_t *data, network_address *from_addr) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int incount = 0; int size; @@ -3831,8 +3831,8 @@ void MultiDoAskToJoin(ubyte *data, network_address *from_addr) { } // Someone is asking about our game -void MultiDoGetGameInfo(ubyte *data, network_address *from_addr) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoGetGameInfo(uint8_t *data, network_address *from_addr) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; network_address my_addr; @@ -3918,8 +3918,8 @@ void MultiDoGetGameInfo(ubyte *data, network_address *from_addr) { } // Someone is asking about our PXO game -void MultiDoGetPXOGameInfo(ubyte *data, network_address *from_addr) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoGetPXOGameInfo(uint8_t *data, network_address *from_addr) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; float ping_time; @@ -4006,7 +4006,7 @@ void MultiDoGetPXOGameInfo(ubyte *data, network_address *from_addr) { bool Multi_Gamelist_changed = false; // A server is telling us about a game we've requested -void MultiDoGameInfo(ubyte *data, network_address *from_addr) { +void MultiDoGameInfo(uint8_t *data, network_address *from_addr) { int count = 0; char name[NETGAME_NAME_LEN]; @@ -4123,7 +4123,7 @@ void MultiSendBlowupBuilding(int hit_objnum, int killer_objnum, float damage) { int count = 0; int size_offset = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; ushort short_damage = damage; @@ -4143,7 +4143,7 @@ void MultiSendBlowupBuilding(int hit_objnum, int killer_objnum, float damage) { } // Blowup a building because the server told us so -void MultiDoBlowupBuilding(ubyte *data) { +void MultiDoBlowupBuilding(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -4168,11 +4168,11 @@ void MultiDoBlowupBuilding(ubyte *data) { } // Server is telling us about buildings to get rid of -void MultiDoBuilding(ubyte *data) { +void MultiDoBuilding(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); - ubyte num = MultiGetByte(data, &count); + uint8_t num = MultiGetByte(data, &count); for (int i = 0; i < num; i++) { ushort objnum = MultiGetUshort(data, &count); if (Objects[objnum].type != OBJ_BUILDING) { @@ -4198,9 +4198,9 @@ void MultiDoBuilding(ubyte *data) { doorway *GetDoorwayFromObject(int door_obj_handle); // Server is telling us the world state -void MultiDoWorldStates(ubyte *data) { +void MultiDoWorldStates(uint8_t *data) { int count = 0; - ubyte world_type; + uint8_t world_type; SKIP_HEADER(data, &count); @@ -4227,7 +4227,7 @@ void MultiDoWorldStates(ubyte *data) { Rooms[roomnum].fog_r = ((float)MultiGetUbyte(data, &count)) / 255.0; Rooms[roomnum].fog_g = ((float)MultiGetUbyte(data, &count)) / 255.0; Rooms[roomnum].fog_b = ((float)MultiGetUbyte(data, &count)) / 255.0; - ubyte state = MultiGetUbyte(data, &count); + uint8_t state = MultiGetUbyte(data, &count); if (state) Rooms[roomnum].flags |= RF_FOG; else @@ -4238,7 +4238,7 @@ void MultiDoWorldStates(ubyte *data) { case WS_ROOM_LIGHTING: { // Room lighting - ubyte state; + uint8_t state; short roomnum = MultiGetShort(data, &count); Rooms[roomnum].pulse_time = MultiGetUbyte(data, &count); Rooms[roomnum].pulse_offset = MultiGetUbyte(data, &count); @@ -4259,7 +4259,7 @@ void MultiDoWorldStates(ubyte *data) { case WS_ROOM_REFUEL: { // Room fueling short roomnum = MultiGetShort(data, &count); - ubyte state = MultiGetUbyte(data, &count); + uint8_t state = MultiGetUbyte(data, &count); if (state) Rooms[roomnum].flags |= RF_FUELCEN; else @@ -4284,14 +4284,14 @@ void MultiDoWorldStates(ubyte *data) { case WS_ROOM_PORTAL_RENDER: { short roomnum = MultiGetShort(data, &count); short portalnum = MultiGetShort(data, &count); - ubyte flags = MultiGetByte(data, &count); + uint8_t flags = MultiGetByte(data, &count); Rooms[roomnum].portals[portalnum].flags = flags; break; } case WS_ROOM_PORTAL_BLOCK: { short roomnum = MultiGetShort(data, &count); short portalnum = MultiGetShort(data, &count); - ubyte flags = MultiGetByte(data, &count); + uint8_t flags = MultiGetByte(data, &count); Rooms[roomnum].portals[portalnum].flags = flags; break; } @@ -4371,7 +4371,7 @@ void MultiDoWorldStates(ubyte *data) { dp = GetDoorwayFromObject(Objects[objnum].handle); int state = MultiGetByte(data, &count); - ubyte locked = MultiGetByte(data, &count); + uint8_t locked = MultiGetByte(data, &count); if (locked) dp->flags |= DF_LOCKED; else @@ -4423,7 +4423,7 @@ void MultiDoWorldStates(ubyte *data) { int goal_index = MultiGetUshort(data, &count); int priority = MultiGetInt(data, &count); - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(name, &data[count], len); count += len; @@ -4552,7 +4552,7 @@ void MultiDoWorldStates(ubyte *data) { } } -void MultiDoJoinDemoObjects(ubyte *data) { +void MultiDoJoinDemoObjects(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -4579,11 +4579,11 @@ void MultiDoJoinDemoObjects(ubyte *data) { } // Server is telling us about objects in the game -void MultiDoJoinObjects(ubyte *data) { +void MultiDoJoinObjects(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); - ubyte num_objects = MultiGetByte(data, &count); + uint8_t num_objects = MultiGetByte(data, &count); mprintf((0, "Got join object packet. Num objects=%d\n", num_objects)); @@ -4592,7 +4592,7 @@ void MultiDoJoinObjects(ubyte *data) { // Extract info about this object ushort server_objnum = MultiGetUshort(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); //@@mprintf ((0,"Got join objnum %d from server. Type=%d\n",server_objnum,type)); @@ -4603,8 +4603,8 @@ void MultiDoJoinObjects(ubyte *data) { uint32_t checksum; matrix orient; - ubyte name_len = 0; - ubyte num_persist_vars = 0; + uint8_t name_len = 0; + uint8_t num_persist_vars = 0; vm_MakeIdentity(&orient); @@ -4643,8 +4643,8 @@ void MultiDoJoinObjects(ubyte *data) { vector pos; ushort short_roomnum; - ubyte terrain = 0; - ubyte lifeleft = 255; + uint8_t terrain = 0; + uint8_t lifeleft = 255; int roomnum; if (type != OBJ_DOOR) { @@ -4661,7 +4661,7 @@ void MultiDoJoinObjects(ubyte *data) { if (type == OBJ_MARKER) { // Get message if marker - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(MarkerMessages[id], &data[count], len); count += len; } @@ -4715,7 +4715,7 @@ void MultiDoJoinObjects(ubyte *data) { } // Starts a death sequence of a player -void MultiDoPlayerDead(ubyte *data) { +void MultiDoPlayerDead(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -4733,9 +4733,9 @@ void MultiDoPlayerDead(ubyte *data) { } // The server sends to everyone that the player is dead -void MultiSendPlayerDead(int slot, ubyte fate) { +void MultiSendPlayerDead(int slot, uint8_t fate) { MULTI_ASSERT(Netgame.local_role == LR_SERVER, "Client in SendPlayerDead!"); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -4766,12 +4766,12 @@ void MultiSendPlayerDead(int slot, ubyte fate) { } // A player is coming back from the dead...restore his ship! -void MultiDoRenewPlayer(ubyte *data) { +void MultiDoRenewPlayer(uint8_t *data) { int count = 0; bool add_guidebot = false; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); int start_slot = MultiGetShort(data, &count); if (MultiGetByte(data, &count)) { @@ -4803,7 +4803,7 @@ void MultiDoRenewPlayer(ubyte *data) { void MultiSendRenewPlayer(int slot) { MULTI_ASSERT(Netgame.local_role == LR_SERVER, "Client in SendRenewPlayer!"); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -4839,20 +4839,20 @@ void MultiSendRenewPlayer(int slot) { } // This player says he's done dying -void MultiDoEndPlayerDeath(ubyte *data) { +void MultiDoEndPlayerDeath(uint8_t *data) { MULTI_ASSERT(Netgame.local_role == LR_SERVER, "Client in DoEndPlayerDeath!"); int count = 0; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); if (Players[slot].flags & PLAYER_FLAGS_DEAD || Players[slot].flags & PLAYER_FLAGS_DYING) MultiSendRenewPlayer(slot); } void GetServerGameTime() { MULTI_ASSERT(Netgame.local_role != LR_SERVER, "Server in GetServerGameTime!"); - ubyte outdata[MAX_GAME_DATA_SIZE]; + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int size; mprintf((0, "Requesting gametime from server\n")); @@ -4862,8 +4862,8 @@ void GetServerGameTime() { END_DATA(count, outdata, size); nw_Send(&Netgame.server_address, outdata, count, 0); } -void MultiDoGameTimeReq(ubyte *data, network_address *from_addr) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoGameTimeReq(uint8_t *data, network_address *from_addr) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; int incount = 0; int size; @@ -4882,7 +4882,7 @@ void MultiDoGameTimeReq(ubyte *data, network_address *from_addr) { nw_Send(from_addr, outdata, count, 0); } -void MultiDoSetGameTime(ubyte *data) { +void MultiDoSetGameTime(uint8_t *data) { float req_time; float server_latency; float server_game_time; @@ -4907,7 +4907,7 @@ void MultiDoSetGameTime(ubyte *data) { // Tell the server that I'm done dying void MultiSendEndPlayerDeath() { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; mprintf((0, "Sending end player death packet!\n")); @@ -4924,7 +4924,7 @@ void MultiSendEndPlayerDeath() { } // Prints out a message we got from the server -void MultiDoMessageFromServer(ubyte *data) { +void MultiDoMessageFromServer(uint8_t *data) { static int sound_id = -2; int count = 0; char message[255]; @@ -4932,7 +4932,7 @@ void MultiDoMessageFromServer(ubyte *data) { SKIP_HEADER(data, &count); ddgr_color color = MultiGetInt(data, &count); - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(message, &data[count], len); count += len; @@ -4952,7 +4952,7 @@ void MultiDoMessageFromServer(ubyte *data) { // Sends a message from the server to the client void MultiSendMessageFromServer(int color, char *message, int to) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); @@ -4960,7 +4960,7 @@ void MultiSendMessageFromServer(int color, char *message, int to) { size_offset = START_DATA(MP_MESSAGE_FROM_SERVER, data, &count, 1); MultiAddInt(color, data, &count); - ubyte len = strlen(message) + 1; + uint8_t len = strlen(message) + 1; MultiAddByte(len, data, &count); @@ -5016,16 +5016,16 @@ void MultiSendMessageFromServer(int color, char *message, int to) { } // Prints out a message we got from the server -void MultiDoMessageToServer(ubyte *data) { +void MultiDoMessageToServer(uint8_t *data) { int count = 0; char message[255]; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); int towho = (int8_t)MultiGetByte(data, &count); - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(message, &data[count], len); count += len; @@ -5036,14 +5036,14 @@ void MultiDoMessageToServer(ubyte *data) { // Sends a message from the server to the client void MultiSendMessageToServer(int color, char *message, int to_who) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_MESSAGE_TO_SERVER, data, &count); MultiAddByte(Player_num, data, &count); MultiAddByte(to_who, data, &count); - ubyte len = strlen(message) + 1; + uint8_t len = strlen(message) + 1; MultiAddByte(len, data, &count); @@ -5057,7 +5057,7 @@ void MultiSendMessageToServer(int color, char *message, int to_who) { } // Executes a dll that the server says to -void MultiDoExecuteDLL(ubyte *data) { +void MultiDoExecuteDLL(uint8_t *data) { int count = 0; float fParam = 0; ptrdiff_t iParam = 0; @@ -5156,7 +5156,7 @@ void MultiDoExecuteDLL(ubyte *data) { } // Server is telling us to create an object -void MultiDoObject(ubyte *data) { +void MultiDoObject(uint8_t *data) { int count = 0; int parent_handle; bool self_parent = false; @@ -5164,7 +5164,7 @@ void MultiDoObject(ubyte *data) { SKIP_HEADER(data, &count); // Extract info about this object - ubyte announce = MultiGetByte(data, &count); + uint8_t announce = MultiGetByte(data, &count); int server_objnum = MultiGetUshort(data, &count); int parent_objnum = MultiGetUshort(data, &count); @@ -5187,14 +5187,14 @@ void MultiDoObject(ubyte *data) { parent_handle = Objects[local_parent].handle; } - ubyte type = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); uint32_t checksum = MultiGetUint(data, &count); - ubyte dummy_type = OBJ_NONE; + uint8_t dummy_type = OBJ_NONE; if (type == OBJ_DUMMY) // we need to get the original type dummy_type = MultiGetByte(data, &count); /*char name[255]; - ubyte len=MultiGetByte (data,&count); + uint8_t len=MultiGetByte (data,&count); memcpy (name,&data[count],len);*/ int id; @@ -5248,12 +5248,12 @@ void MultiDoObject(ubyte *data) { } // Get movement type - ubyte mtype = MultiGetByte(data, &count); + uint8_t mtype = MultiGetByte(data, &count); // Get room/cell stuff ushort short_roomnum = MultiGetUshort(data, &count); - ubyte terrain = MultiGetByte(data, &count); - ubyte lifeleft = MultiGetUbyte(data, &count); + uint8_t terrain = MultiGetByte(data, &count); + uint8_t lifeleft = MultiGetUbyte(data, &count); int roomnum = short_roomnum; if (terrain) @@ -5292,7 +5292,7 @@ void MultiDoObject(ubyte *data) { if (obj->type == OBJ_MARKER) { // Get message if marker - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(MarkerMessages[obj->id], &data[count], len); count += len; } @@ -5340,11 +5340,11 @@ void MultiDoObject(ubyte *data) { } // Sends an object from the server to the client -void MultiSendObject(object *obj, ubyte announce, ubyte demo_record) { +void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; if (obj->type != OBJ_WEAPON) @@ -5418,7 +5418,7 @@ void MultiSendObject(object *obj, ubyte announce, ubyte demo_record) { if (obj->type == OBJ_MARKER) { // Add marker message to the end of this - ubyte len = strlen(MarkerMessages[obj->id]) + 1; + uint8_t len = strlen(MarkerMessages[obj->id]) + 1; MultiAddByte(len, data, &count); memcpy(data + count, MarkerMessages[obj->id], len); count += len; @@ -5439,14 +5439,14 @@ void MultiSendObject(object *obj, ubyte announce, ubyte demo_record) { MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, true); } -void MultiDoGuidedInfo(ubyte *data) { +void MultiDoGuidedInfo(uint8_t *data) { int count = 0; // Skip header stuff SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); - ubyte release = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); + uint8_t release = MultiGetByte(data, &count); if (Players[slot].guided_obj == NULL) return; @@ -5469,7 +5469,7 @@ void MultiDoGuidedInfo(ubyte *data) { // Get room and terrain flag short_roomnum = MultiGetUshort(data, &count); - ubyte terrain = MultiGetByte(data, &count); + uint8_t terrain = MultiGetByte(data, &count); roomnum = short_roomnum; if (terrain) @@ -5490,7 +5490,7 @@ void MultiDoGuidedInfo(ubyte *data) { } // Stuff info for a guided missile -int MultiStuffGuidedInfo(int slot, ubyte *data) { +int MultiStuffGuidedInfo(int slot, uint8_t *data) { int count = 0; int size_offset; object *obj = Players[slot].guided_obj; @@ -5537,7 +5537,7 @@ int MultiStuffGuidedInfo(int slot, ubyte *data) { } // Guided missile release -void MultiDoMissileRelease(int slot, ubyte *data) { +void MultiDoMissileRelease(int slot, uint8_t *data) { // if we are the server, we'll have to forward this packet to the clients int count = 0; uint8_t pnum_release; @@ -5594,7 +5594,7 @@ void MultiSendMissileRelease(int slot, bool is_guided) { // everything looks ok, fire off this packet int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; uint8_t byte_to_send; @@ -5627,9 +5627,9 @@ void MultiSendMissileRelease(int slot, bool is_guided) { } // Calls the scripts packet extractor code -void MultiDoSpecialPacket(ubyte *data) { +void MultiDoSpecialPacket(uint8_t *data) { int count = 0; - ubyte indata[MAX_GAME_DATA_SIZE]; + uint8_t indata[MAX_GAME_DATA_SIZE]; SKIP_HEADER(data, &count); int size = MultiGetInt(data, &count); @@ -5642,11 +5642,11 @@ void MultiDoSpecialPacket(ubyte *data) { } // Sends the special script packet to a player -void MultiSendSpecialPacket(int slot, ubyte *outdata, int size) { +void MultiSendSpecialPacket(int slot, uint8_t *outdata, int size) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_SPECIAL_PACKET, data, &count, 1); @@ -5663,11 +5663,11 @@ void MultiSendSpecialPacket(int slot, ubyte *outdata, int size) { } // Sends the special script packet to the server -void MultiClientSendSpecialPacket(ubyte *outdata, int size) { +void MultiClientSendSpecialPacket(uint8_t *outdata, int size) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_SPECIAL_PACKET, data, &count); @@ -5684,20 +5684,20 @@ void MultiClientSendSpecialPacket(ubyte *outdata, int size) { } // Server is telling us to remove an object -void MultiDoRemoveObject(ubyte *data) { +void MultiDoRemoveObject(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); ushort server_objnum = MultiGetUshort(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); - ubyte sound = MultiGetByte(data, &count); + uint8_t sound = MultiGetByte(data, &count); // Get name to help track down bug /*#ifndef RELEASE char name[255]; - ubyte len=MultiGetByte (data,&count); + uint8_t len=MultiGetByte (data,&count); memcpy (name,&data[count],len); count+=len; #endif*/ @@ -5751,11 +5751,11 @@ void MultiDoRemoveObject(ubyte *data) { } // Tells all clients to remove a specified object -void MultiSendRemoveObject(object *obj, ubyte playsound) { +void MultiSendRemoveObject(object *obj, uint8_t playsound) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REMOVE_OBJECT, data, &count, 1); @@ -5770,7 +5770,7 @@ void MultiSendRemoveObject(object *obj, ubyte playsound) { MultiAddByte(playsound, data, &count); /*#ifndef RELEASE - ubyte len = strlen(Object_info[obj->id].name)+1; + uint8_t len = strlen(Object_info[obj->id].name)+1; MultiAddByte (len,data,&count); memcpy (data+count,Object_info[obj->id].name,len); count+=len; @@ -5781,7 +5781,7 @@ void MultiSendRemoveObject(object *obj, ubyte playsound) { } // Repositions a powerup to be where it should be -void MultiDoPowerupReposition(ubyte *data) { +void MultiDoPowerupReposition(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -5801,7 +5801,7 @@ void MultiDoPowerupReposition(ubyte *data) { pos = MultiGetVector(data, &count); ushort short_roomnum = MultiGetUshort(data, &count); - ubyte terrain = MultiGetByte(data, &count); + uint8_t terrain = MultiGetByte(data, &count); int roomnum = short_roomnum; if (terrain) @@ -5813,7 +5813,7 @@ void MultiDoPowerupReposition(ubyte *data) { } // Client is telling us about weapons and energy he has -void MultiDoWeaponsLoad(ubyte *data) { +void MultiDoWeaponsLoad(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -5848,7 +5848,7 @@ void MultiDoWeaponsLoad(ubyte *data) { // Plus about the viewers we're looking at void MultiSendWeaponsLoad() { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset = START_DATA(MP_WEAPONS_LOAD, data, &count); @@ -5885,9 +5885,9 @@ void MultiSendWeaponsLoad() { } // Tells the other players that a slot is starting/stopping its on/off weapon -void MultiSendOnOff(object *obj, ubyte on, ubyte wb_index, ubyte fire_mask) { +void MultiSendOnOff(object *obj, uint8_t on, uint8_t wb_index, uint8_t fire_mask) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; int slot = obj->id; @@ -5905,15 +5905,15 @@ void MultiSendOnOff(object *obj, ubyte on, ubyte wb_index, ubyte fire_mask) { } // Server is telling us to start/stop and on/off weapon -void MultiDoOnOff(ubyte *data) { +void MultiDoOnOff(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); - ubyte on = MultiGetByte(data, &count); - ubyte wb_index = MultiGetByte(data, &count); - ubyte fire_mask = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); + uint8_t on = MultiGetByte(data, &count); + uint8_t wb_index = MultiGetByte(data, &count); + uint8_t fire_mask = MultiGetByte(data, &count); if (on) { Objects[Players[slot].objnum].weapon_fire_flags |= WFF_ON_OFF; @@ -5937,7 +5937,7 @@ void MultiDoOnOff(ubyte *data) { void MultiSendAdditionalDamage(int slot, int type, float amount) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_ADDITIONAL_DAMAGE, data, &count, 1); @@ -5954,7 +5954,7 @@ void MultiSendAdditionalDamage(int slot, int type, float amount) { } // Server is telling us to apply damage to a player -void MultiDoAdditionalDamage(ubyte *data) { +void MultiDoAdditionalDamage(uint8_t *data) { int count = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_CLIENT); @@ -5963,8 +5963,8 @@ void MultiDoAdditionalDamage(ubyte *data) { SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); float amount = MultiGetFloat(data, &count); if (amount < 0) // add to shields @@ -5984,7 +5984,7 @@ void MultiSendRequestShields(int type, float amount) { return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REQUEST_SHIELDS, data, &count); @@ -5999,7 +5999,7 @@ void MultiSendRequestShields(int type, float amount) { } // Someone wants us to give them shields -void MultiDoRequestShields(ubyte *data) { +void MultiDoRequestShields(uint8_t *data) { if (Netgame.local_role != LR_SERVER) return; @@ -6007,8 +6007,8 @@ void MultiDoRequestShields(ubyte *data) { SKIP_HEADER(data, &count); - ubyte pnum = MultiGetByte(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t pnum = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); float amount = MultiGetFloat(data, &count); if (type == SHIELD_REQUEST_ENERGY_TO_SHIELD) { @@ -6034,7 +6034,7 @@ void MultiSendRequestDamage(int type, float amount) { return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REQUEST_DAMAGE, data, &count); @@ -6049,7 +6049,7 @@ void MultiSendRequestDamage(int type, float amount) { } // Someone wants us to damage them -void MultiDoRequestDamage(ubyte *data) { +void MultiDoRequestDamage(uint8_t *data) { if (Netgame.local_role != LR_SERVER) return; @@ -6057,15 +6057,15 @@ void MultiDoRequestDamage(ubyte *data) { SKIP_HEADER(data, &count); - ubyte pnum = MultiGetByte(data, &count); - ubyte type = MultiGetByte(data, &count); + uint8_t pnum = MultiGetByte(data, &count); + uint8_t type = MultiGetByte(data, &count); float amount = MultiGetFloat(data, &count); ApplyDamageToPlayer(&Objects[Players[pnum].objnum], &Objects[Players[pnum].objnum], type, amount); } // Server is telling us to create a countermeasure -void MultiDoRequestCountermeasure(ubyte *data) { +void MultiDoRequestCountermeasure(uint8_t *data) { int count = 0; mprintf((0, "Got request for countermeasure!\n")); @@ -6102,7 +6102,7 @@ void MultiDoRequestCountermeasure(ubyte *data) { // We're asking the server to create a countermeasure for us void MultiSendRequestCountermeasure(short objnum, int weapon_index) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REQUEST_COUNTERMEASURE, data, &count); @@ -6123,15 +6123,15 @@ void MultiSendRequestCountermeasure(short objnum, int weapon_index) { } // Server is telling us about a player who is changing his observer mode -void MultiDoObserverChange(ubyte *data) { +void MultiDoObserverChange(uint8_t *data) { int count = 0; int objnum = -1; SKIP_HEADER(data, &count); int slot = MultiGetByte(data, &count); - ubyte mode = MultiGetByte(data, &count); - ubyte on = MultiGetByte(data, &count); + uint8_t mode = MultiGetByte(data, &count); + uint8_t on = MultiGetByte(data, &count); int restart_slot = MultiGetShort(data, &count); if (mode == OBSERVER_MODE_PIGGYBACK) { if (Netgame.local_role == LR_SERVER) @@ -6155,7 +6155,7 @@ void MultiDoObserverChange(ubyte *data) { } // Someone is asking us for permission to enter observer mode -void MultiDoRequestToObserve(ubyte *data) { +void MultiDoRequestToObserve(uint8_t *data) { int count = 0; int objnum; @@ -6165,9 +6165,9 @@ void MultiDoRequestToObserve(ubyte *data) { SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); - ubyte mode = MultiGetByte(data, &count); - ubyte on = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); + uint8_t mode = MultiGetByte(data, &count); + uint8_t on = MultiGetByte(data, &count); if (mode == OBSERVER_MODE_PIGGYBACK) objnum = MultiGetInt(data, &count); @@ -6175,7 +6175,7 @@ void MultiDoRequestToObserve(ubyte *data) { if ((Objects[Players[slot].objnum].type == OBJ_PLAYER && on) || (Objects[Players[slot].objnum].type == OBJ_OBSERVER && !on)) { int newcount = 0; - ubyte newdata[MAX_GAME_DATA_SIZE]; + uint8_t newdata[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_OBSERVER_CHANGE, newdata, &newcount); @@ -6204,7 +6204,7 @@ void MultiDoRequestToObserve(ubyte *data) { // We're asking to enter observer mode void MultiSendRequestToObserve(int mode, int on, int objnum) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; // Check to see if the player has enough shields to enter @@ -6236,7 +6236,7 @@ void MultiSendRequestToObserve(int mode, int on, int objnum) { } // Server is telling us about players that we can see -void MultiDoVisiblePlayers(ubyte *data) { +void MultiDoVisiblePlayers(uint8_t *data) { int count = 0; int i; @@ -6281,7 +6281,7 @@ void MultiDoVisiblePlayers(ubyte *data) { // Sends all the visible players to another player void MultiSendVisiblePlayers(int to_slot) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_VISIBLE_PLAYERS, data, &count); @@ -6296,7 +6296,7 @@ void MultiSendVisiblePlayers(int to_slot) { nw_Send(&NetPlayers[to_slot].addr, data, count, 0); } -void MultiDoRequestPeerDamage(ubyte *data, network_address *from_addr) { +void MultiDoRequestPeerDamage(uint8_t *data, network_address *from_addr) { int count = 0; if (Netgame.local_role != LR_SERVER) @@ -6306,8 +6306,8 @@ void MultiDoRequestPeerDamage(ubyte *data, network_address *from_addr) { int pnum = MultiGetByte(data, &count); ushort killer_objnum = MultiGetUshort(data, &count); - ubyte weapon_id = MultiGetUbyte(data, &count); - ubyte damage_type = MultiGetUbyte(data, &count); + uint8_t weapon_id = MultiGetUbyte(data, &count); + uint8_t damage_type = MultiGetUbyte(data, &count); float amount = MultiGetFloat(data, &count); if (killer_objnum == 65535 || Objects[killer_objnum].type == OBJ_NONE) @@ -6320,7 +6320,7 @@ void MultiDoRequestPeerDamage(ubyte *data, network_address *from_addr) { // Tell the server to damage us void MultiSendRequestPeerDamage(object *killer, int weapon_id, int damage_type, float amount) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; if (Netgame.local_role == LR_SERVER) @@ -6554,7 +6554,7 @@ void MultiSendFullReliablePacket(int slot, int flags) { uint32_t MultiGetUniqueIDFromString(char *plainstring) { int i, t, len; uint32_t ret; - ubyte cryptstring[PAGENAME_LEN]; + uint8_t cryptstring[PAGENAME_LEN]; uint32_t vals[4]; len = strlen(plainstring); @@ -6568,7 +6568,7 @@ uint32_t MultiGetUniqueIDFromString(char *plainstring) { for (i = 0; i < 4; i++) { cryptstring[i] = 0; - ubyte backbyte; + uint8_t backbyte; if (i == 0) backbyte = 0x9a; @@ -6576,8 +6576,8 @@ uint32_t MultiGetUniqueIDFromString(char *plainstring) { backbyte = plainstring[i - 1]; for (t = 0; t < len; t++) { - ubyte a = plainstring[t]; - ubyte b = plainstring[i % (t + 1)]; + uint8_t a = plainstring[t]; + uint8_t b = plainstring[i % (t + 1)]; a *= a; b *= b * b; @@ -6738,7 +6738,7 @@ void MultiPaintGoalRooms(int *texcolors) { void MultiSendKillObject(object *hit_obj, object *killer, float damage, int death_flags, float delay, short seed) { int size; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; ushort hit_objnum, killer_objnum; // mprintf((0,"MultiSendExplodeObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer))); @@ -6767,7 +6767,7 @@ void MultiSendKillObject(object *hit_obj, object *killer, float damage, int deat MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, false); } -void MultiDoRobotExplode(ubyte *data) { +void MultiDoRobotExplode(uint8_t *data) { int count = 0; float damage, delay; ushort hit_objnum, killer_objnum, seed; @@ -6816,7 +6816,7 @@ void MultiDoRobotExplode(ubyte *data) { void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int weaponid) { int size; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; ushort hit_objnum, killer_objnum; // mprintf((0,"MultiSendDamageObject Hit obj:%d Killer Obj: %d\n",OBJNUM(hit_obj),OBJNUM(killer))); @@ -6837,7 +6837,7 @@ void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int we MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_PLAYING, false); } -void MultiDoRobotDamage(ubyte *data) { +void MultiDoRobotDamage(uint8_t *data) { int count = 0; float damage; int weaponid; @@ -6893,7 +6893,7 @@ void MultiAddObjAnimUpdate(int objnum) { } } -int MultiStuffObjAnimUpdate(uint16_t objnum, ubyte *data) { +int MultiStuffObjAnimUpdate(uint16_t objnum, uint8_t *data) { custom_anim multi_anim_info; int count = 0; int size = 0; @@ -6923,7 +6923,7 @@ int MultiStuffObjAnimUpdate(uint16_t objnum, ubyte *data) { return 0; } -void MultiDoObjAnimUpdate(ubyte *data) { +void MultiDoObjAnimUpdate(uint8_t *data) { custom_anim multi_anim_info; int objnum; int count = 0; @@ -6952,7 +6952,7 @@ void MultiDoObjAnimUpdate(ubyte *data) { } } -void MultiDoPlay3dSound(ubyte *data) { +void MultiDoPlay3dSound(uint8_t *data) { int objnum; short soundidx; int count = 0; @@ -6963,7 +6963,7 @@ void MultiDoPlay3dSound(ubyte *data) { objnum = Server_object_list[serverobjnum]; soundidx = MultiGetShort(data, &count); - ubyte priority = MultiGetByte(data, &count); + uint8_t priority = MultiGetByte(data, &count); if (objnum == 65535 || !(Objects[objnum].flags & OF_SERVER_OBJECT)) { mprintf((0, "Bad server objnum(%d) in MultiDoPlay3dSound().\n", serverobjnum)); @@ -6975,7 +6975,7 @@ void MultiDoPlay3dSound(ubyte *data) { } void MultiPlay3dSound(short soundidx, ushort objnum, int priority) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); @@ -7006,7 +7006,7 @@ void MultiPlay3dSound(short soundidx, ushort objnum, int priority) { void MultiSendRobotFireSound(short soundidx, ushort objnum) { int size; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // mprintf((0,"&"));//KBTEST MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); // mprintf((0,"Sending Robot %d fire sound.\n",objnum)); @@ -7037,7 +7037,7 @@ void MultiSendRobotFireSound(short soundidx, ushort objnum) { } } -void MultiDoRobotFireSound(ubyte *data) { +void MultiDoRobotFireSound(uint8_t *data) { int objnum; short soundidx; int count = 0; @@ -7084,7 +7084,7 @@ void MultiAddObjTurretUpdate(int objnum) { } } -int MultiStuffTurretUpdate(uint16_t objnum, ubyte *data) { +int MultiStuffTurretUpdate(uint16_t objnum, uint8_t *data) { int count = 0; int size = 0; multi_turret multi_turret_info; @@ -7119,7 +7119,7 @@ int MultiStuffTurretUpdate(uint16_t objnum, ubyte *data) { return count; } -void MultiDoTurretUpdate(ubyte *data) { +void MultiDoTurretUpdate(uint8_t *data) { multi_turret multi_turret_info; int objnum; @@ -7161,7 +7161,7 @@ void MultiSendClientInventoryUseItem(int type, int id) { } int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; // Client sends this only MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); @@ -7197,7 +7197,7 @@ void MultiSendClientInventoryUseItem(int type, int id) { } } -void MultiDoClientInventoryUseItem(int slot, ubyte *data) { +void MultiDoClientInventoryUseItem(int slot, uint8_t *data) { int count = 0; int type; int id; @@ -7269,7 +7269,7 @@ void MultiDoClientInventoryUseItem(int slot, ubyte *data) { } // Handle a remove item from inventory -void MultiDoClientInventoryRemoveItem(int slot, ubyte *data) { +void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data) { int count = 0; int type; int id; @@ -7325,7 +7325,7 @@ void MultiSendInventoryRemoveItem(int slot, int type, int id) { } int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; if (id == -1) { @@ -7362,7 +7362,7 @@ void MultiSetAudioTauntTime(float time, int to_who) { time = taunt_DelayTime(); // make sure it is valid int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; size = START_DATA(MP_SERVER_AUDIOTAUNT_TIME, data, &count, 1); @@ -7379,7 +7379,7 @@ void MultiSetAudioTauntTime(float time, int to_who) { } } -void MultiDoAudioTauntTime(ubyte *data) { +void MultiDoAudioTauntTime(uint8_t *data) { int count = 0; MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); @@ -7416,7 +7416,7 @@ void MultiAddObjWBAnimUpdate(int objnum) { } } -int MultiStuffObjWBAnimUpdate(uint16_t objnum, ubyte *data) { +int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data) { // multi_anim multi_anim_info; int count = 0; int size = 0; @@ -7448,7 +7448,7 @@ int MultiStuffObjWBAnimUpdate(uint16_t objnum, ubyte *data) { return 0; } -void MultiDoObjWBAnimUpdate(ubyte *data) { +void MultiDoObjWBAnimUpdate(uint8_t *data) { // multi_anim multi_anim_info; // int objnum; int count = 0; @@ -7474,7 +7474,7 @@ void MultiDoObjWBAnimUpdate(ubyte *data) { void MultiSendBytesSent(int slot) { int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; // Server sends this only MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); @@ -7492,7 +7492,7 @@ void MultiSendBytesSent(int slot) { #define MIN(a, b) ((a < b) ? a : b) -void MultiDoBytesSent(ubyte *data) { +void MultiDoBytesSent(uint8_t *data) { int count = 0; uint32_t server_sent; float drop_ratio; @@ -7546,7 +7546,7 @@ void MultiDoBytesSent(ubyte *data) { void MultiSendPPSSet(int pps) { int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; // Client sends this only MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); @@ -7557,7 +7557,7 @@ void MultiSendPPSSet(int pps) { nw_SendReliable(NetPlayers[Player_num].reliable_socket, data, count, false); } -void MultiDoPPSSet(ubyte *data, int slot) { +void MultiDoPPSSet(uint8_t *data, int slot) { int count = 0; SKIP_HEADER(data, &count); NetPlayers[slot].pps = MultiGetByte(data, &count); @@ -7566,7 +7566,7 @@ void MultiDoPPSSet(ubyte *data, int slot) { void MultiSendGreetings(uint32_t id) { int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; // Client sends this only MULTI_ASSERT_NOMESSAGE(Netgame.local_role != LR_SERVER); @@ -7577,7 +7577,7 @@ void MultiSendGreetings(uint32_t id) { nw_Send(&Netgame.server_address, data, count, 0); } -void MultiDoGreetings(ubyte *data, network_address *addr) { +void MultiDoGreetings(uint8_t *data, network_address *addr) { int count = 0; SKIP_HEADER(data, &count); uint32_t id = MultiGetUint(data, &count); @@ -7600,7 +7600,7 @@ void MultiDoGreetings(ubyte *data, network_address *addr) { // who = player number of who you are asking for the file void MultiAskForFile(ushort file_id, ushort file_who, ushort who) { int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; //@@mprintf((0,"Asking player %d for a file (%d) from player %d\n",who,file_id,file_who)); if (NetPlayers[who].file_xfer_flags != NETFILE_NONE) { @@ -7665,7 +7665,7 @@ void MultiAskForFile(ushort file_id, ushort file_who, ushort who) { } } -void MultiDoFileReq(ubyte *data) { +void MultiDoFileReq(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); ushort filenum = MultiGetUshort(data, &count); @@ -7708,7 +7708,7 @@ void MultiDoFileReq(ubyte *data) { void DenyFile(int playernum, int filenum, int file_who) { int size = 0; - ubyte outdata[MAX_GAME_DATA_SIZE]; + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; size = START_DATA(MP_FILE_DENIED, outdata, &count); MultiAddUshort(filenum, outdata, &count); @@ -7725,7 +7725,7 @@ void DenyFile(int playernum, int filenum, int file_who) { void MultiCancelFile(int playernum, int filenum, int file_who) { int size = 0; - ubyte outdata[MAX_GAME_DATA_SIZE]; + uint8_t outdata[MAX_GAME_DATA_SIZE]; int count = 0; // Send message to our peer and abort the xfer if (NetPlayers[playernum].file_xfer_cfile) { @@ -7746,7 +7746,7 @@ void MultiCancelFile(int playernum, int filenum, int file_who) { nw_SendReliable(NetPlayers[Player_num].reliable_socket, outdata, count); } } -void MultiDoFileDenied(ubyte *data) { +void MultiDoFileDenied(uint8_t *data) { // We asked for a file, but the request was denied for some reason int count = 0; SKIP_HEADER(data, &count); @@ -7758,7 +7758,7 @@ void MultiDoFileDenied(ubyte *data) { DoNextPlayerFile(filewho); } -void MultiDoFileData(ubyte *data) { +void MultiDoFileData(uint8_t *data) { // File data. We asked for it, now the server is sending it to us. uint32_t total_len; // Length of the entire file uint32_t curr_len; // Length of file sent so far @@ -7767,7 +7767,7 @@ void MultiDoFileData(ubyte *data) { ushort data_len; // between 1-450 bytes // ushort file_who; int count = 0; - ubyte outdata[MAX_GAME_DATA_SIZE]; + uint8_t outdata[MAX_GAME_DATA_SIZE]; int outcount = 0; int size; @@ -7836,9 +7836,9 @@ void MultiDoFileData(ubyte *data) { } } -void MultiDoFileAck(ubyte *data) { +void MultiDoFileAck(uint8_t *data) { // If we are transferring a file, and someone ACK's us, simply send them the next bit of data they are waiting for - ubyte playernum; // Who is acking us + uint8_t playernum; // Who is acking us uint32_t len_recvd; // Total number of bytes received so far int count = 0; @@ -7859,8 +7859,8 @@ void MultiDoFileAck(ubyte *data) { void SendDataChunk(int playernum) { int outcount = 0; - static ubyte outdata[MAX_PACKET_SIZE]; - static ubyte readbuf[MAX_PACKET_SIZE]; + static uint8_t outdata[MAX_PACKET_SIZE]; + static uint8_t readbuf[MAX_PACKET_SIZE]; int size; int dataread; int done = 0; @@ -7914,7 +7914,7 @@ void SendDataChunk(int playernum) { NetPlayers[playernum].file_xfer_pos += dataread; } -void MultiDoFileCancelled(ubyte *data) { +void MultiDoFileCancelled(uint8_t *data) { uint16_t playernum; // Who is telling us the file is cancelled uint16_t filewho; // Who's file is being cancelled int count = 0; @@ -7937,7 +7937,7 @@ void MultiDoFileCancelled(ubyte *data) { // ddio_splitpath void MultiSendClientCustomData(int slot, int whoto) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; char csum_filename[(_MAX_PATH * 2) + 64]; char path[_MAX_PATH]; char ext[_MAX_PATH]; @@ -8030,7 +8030,7 @@ void MultiSendClientCustomData(int slot, int whoto) { } } -void MultiDoCustomPlayerData(ubyte *data) { +void MultiDoCustomPlayerData(uint8_t *data) { uint16_t playernum; // Who has data we are interested in int count = 0; @@ -8135,7 +8135,7 @@ void MultiSendGhostObject(object *obj, bool ghost) { int count = 0; ushort objnum; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_GHOST_OBJECT, data, &count, 1); @@ -8151,7 +8151,7 @@ void MultiSendGhostObject(object *obj, bool ghost) { MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, false); } -void MultiDoGhostObject(ubyte *data) { +void MultiDoGhostObject(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8181,7 +8181,7 @@ void MultiDoGhostObject(ubyte *data) { // Sends a ping request to a player void MultiSendPing(int slot) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; if (slot == Player_num) @@ -8195,14 +8195,14 @@ void MultiSendPing(int slot) { nw_Send(&NetPlayers[slot].addr, data, count, 0); } -void MultiDoPing(ubyte *data, network_address *addr) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoPing(uint8_t *data, network_address *addr) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int outcount = 0; int count = 0; int size_offset; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); float pingtime = MultiGetFloat(data, &count); // Now send a response @@ -8214,14 +8214,14 @@ void MultiDoPing(ubyte *data, network_address *addr) { nw_Send(addr, outdata, outcount, 0); } -void MultiDoPong(ubyte *data) { - ubyte outdata[MAX_GAME_DATA_SIZE]; +void MultiDoPong(uint8_t *data) { + uint8_t outdata[MAX_GAME_DATA_SIZE]; int outcount = 0; int count = 0; int size_offset; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); float pingtime = MultiGetFloat(data, &count); NetPlayers[slot].ping_time = timer_GetTime() - pingtime; @@ -8235,15 +8235,15 @@ void MultiDoPong(ubyte *data) { } } -void MultiDoLagInfo(ubyte *data) { +void MultiDoLagInfo(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); - ubyte slot = MultiGetByte(data, &count); + uint8_t slot = MultiGetByte(data, &count); NetPlayers[slot].ping_time = MultiGetFloat(data, &count); } // the server is telling us to play an audio taunt -void MultiDoPlayTaunt(ubyte *data) { +void MultiDoPlayTaunt(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); int pnum = MultiGetByte(data, &count); @@ -8258,7 +8258,7 @@ void MultiSendPlayTaunt(int pnum, int index) { return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_SERVER_PLAY_TAUNT, data, &count); MultiAddByte(pnum, data, &count); @@ -8269,7 +8269,7 @@ void MultiSendPlayTaunt(int pnum, int index) { } // process a request by a client to play an audio taunt -void MultiDoRequestPlayTaunt(ubyte *data) { +void MultiDoRequestPlayTaunt(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8322,7 +8322,7 @@ void MultiSendRequestPlayTaunt(int index) { Time_last_taunt_request = t; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset = START_DATA(MP_CLIENT_PLAY_TAUNT, data, &count); MultiAddByte(Player_num, data, &count); @@ -8338,7 +8338,7 @@ void MultiSendRequestPlayTaunt(int index) { } // the server is telling us that about a player's message-type state (is [not] typing a message) -void MultiDoTypeIcon(ubyte *data) { +void MultiDoTypeIcon(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); int pnum = MultiGetByte(data, &count); @@ -8361,7 +8361,7 @@ void MultiDoTypeIcon(ubyte *data) { // tell the clients that a player is [not] typing a message void MultiSendTypeIcon(int pnum, bool typing_message) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_SEND_TYPE_ICON, data, &count); MultiAddByte(pnum, data, &count); @@ -8372,7 +8372,7 @@ void MultiSendTypeIcon(int pnum, bool typing_message) { } // process a request by a client that he is [not] typing a message -void MultiDoRequestTypeIcon(ubyte *data) { +void MultiDoRequestTypeIcon(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8390,7 +8390,7 @@ void MultiSendRequestTypeIcon(bool typing_message) { return; // already typing no need to request int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset = START_DATA(MP_REQUEST_TYPE_ICON, data, &count); MultiAddByte(Player_num, data, &count); @@ -8407,7 +8407,7 @@ void MultiSendRequestTypeIcon(bool typing_message) { void MultiSendAiWeaponFlags(object *obj, int flags, int wb_index) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_AIWEAP_FLAGS, data, &count); MultiAddUshort(OBJNUM(obj), data, &count); @@ -8417,7 +8417,7 @@ void MultiSendAiWeaponFlags(object *obj, int flags, int wb_index) { MultiSendToAllExcept(Player_num, data, count, NETSEQ_OBJECTS); } -void MultiDoAiWeaponFlags(ubyte *data) { +void MultiDoAiWeaponFlags(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8444,7 +8444,7 @@ void MultiDoAiWeaponFlags(ubyte *data) { void MultiSendAttach(object *parent, char parent_ap, object *child, char child_ap, bool f_aligned) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_ATTACH_OBJ, data, &count); MultiAddUshort(OBJNUM(parent), data, &count); @@ -8456,7 +8456,7 @@ void MultiSendAttach(object *parent, char parent_ap, object *child, char child_a MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_WORLD, false); } -void MultiDoAttach(ubyte *data) { +void MultiDoAttach(uint8_t *data) { object *parent; char parent_ap; @@ -8494,7 +8494,7 @@ void MultiDoAttach(ubyte *data) { void MultiSendAttachRad(object *parent, char parent_ap, object *child, float rad) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_ATTACH_RAD_OBJ, data, &count); MultiAddUshort(OBJNUM(parent), data, &count); @@ -8505,7 +8505,7 @@ void MultiSendAttachRad(object *parent, char parent_ap, object *child, float rad MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_WORLD, false); } -void MultiDoAttachRad(ubyte *data) { +void MultiDoAttachRad(uint8_t *data) { object *parent; char parent_ap; @@ -8541,7 +8541,7 @@ void MultiDoAttachRad(ubyte *data) { void MultiSendUnattach(object *child) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; ASSERT(Objects[OBJNUM(child)].flags & OF_CLIENT_KNOWS); @@ -8552,7 +8552,7 @@ void MultiSendUnattach(object *child) { MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, false); } -void MultiDoUnattach(ubyte *data) { +void MultiDoUnattach(uint8_t *data) { object *child; int count = 0; @@ -8575,7 +8575,7 @@ void MultiSendThiefSteal(int player, int item) { MULTI_ASSERT_NOMESSAGE(player >= 0 && player < MAX_PLAYERS); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_THIEF_STEAL, data, &count); MultiAddInt(item, data, &count); @@ -8585,7 +8585,7 @@ void MultiSendThiefSteal(int player, int item) { MultiSendReliablyToAllExcept(Player_num, data, count, NETSEQ_OBJECTS, false); } -void MultiDoThiefSteal(ubyte *data) { +void MultiDoThiefSteal(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); int item = MultiGetInt(data, &count); @@ -8599,7 +8599,7 @@ void MultiSetLogoState(bool state) { mprintf((0, "Setting multi_logo_state to %d\n", state)); } -void MultiDoPermissionToFire(ubyte *data) { +void MultiDoPermissionToFire(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8625,7 +8625,7 @@ void MultiDoPermissionToFire(ubyte *data) { // Get room and terrain flag ushort short_roomnum = MultiGetUshort(data, &count); - ubyte outside = MultiGetByte(data, &count); + uint8_t outside = MultiGetByte(data, &count); int roomnum; if (outside) @@ -8678,7 +8678,7 @@ void MultiSendPermissionToFire(int pnum) { object *obj = &Objects[Players[pnum].objnum]; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_PERMISSION_TO_FIRE, data, &count); MultiAddByte(pnum, data, &count); @@ -8724,7 +8724,7 @@ void MultiSendPermissionToFire(int pnum) { } // A client is asking for permission to fire -void MultiDoRequestToFire(ubyte *data) { +void MultiDoRequestToFire(uint8_t *data) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; @@ -8749,15 +8749,15 @@ void MultiDoRequestToFire(ubyte *data) { // We're asking the servers permission to fire void MultiSendRequestToFire(int wb_index, int fire_mask, float scalar) { // Send quaded info if needed - ubyte index_to_send = wb_index; + uint8_t index_to_send = wb_index; if (Objects[Players[Player_num].objnum].dynamic_wb[wb_index].flags & DWBF_QUAD) index_to_send |= MPFF_QUADED; - ubyte damage_scalar = (scalar * 64.0); + uint8_t damage_scalar = (scalar * 64.0); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REQUEST_TO_FIRE, data, &count); @@ -8786,7 +8786,7 @@ void MultiSendRequestToFire(int wb_index, int fire_mask, float scalar) { } // Server is processing a request for a marker -void MultiDoRequestMarker(ubyte *data) { +void MultiDoRequestMarker(uint8_t *data) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; @@ -8794,7 +8794,7 @@ void MultiDoRequestMarker(ubyte *data) { SKIP_HEADER(data, &count); int pnum = MultiGetByte(data, &count); - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(message, &data[count], len); count += len; @@ -8836,13 +8836,13 @@ void MultiDoRequestMarker(ubyte *data) { // Client is asking for a marker void MultiSendRequestForMarker(char *message) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_REQUEST_MARKER, data, &count); MultiAddByte(Player_num, data, &count); - ubyte len = strlen(message) + 1; + uint8_t len = strlen(message) + 1; MultiAddByte(len, data, &count); memcpy(data + count, message, len); count += len; @@ -8856,7 +8856,7 @@ void MultiSendRequestForMarker(char *message) { } // The server is telling me to adjust my position -void MultiDoAdjustPosition(ubyte *data) { +void MultiDoAdjustPosition(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -8948,7 +8948,7 @@ void MultiSendAdjustPosition(int slot, float timestamp) { int size_offset; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; object *obj = &Objects[Players[slot].objnum]; @@ -8972,7 +8972,7 @@ void MultiSendAdjustPosition(int slot, float timestamp) { float Last_update_time[MAX_PLAYERS]; // Client is asking permission to move -void MultiDoRequestToMove(ubyte *data) { +void MultiDoRequestToMove(uint8_t *data) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; @@ -9055,7 +9055,7 @@ void MultiDoRequestToMove(ubyte *data) { } // Sets up a packet so that we can request to move from server -int MultiStuffRequestToMove(ubyte *data) { +int MultiStuffRequestToMove(uint8_t *data) { int size_offset; int count = 0; @@ -9095,7 +9095,7 @@ int MultiStuffRequestToMove(ubyte *data) { } // Server is giving us a list of objects that aren't visible -void MultiDoGenericNonVis(ubyte *data) { +void MultiDoGenericNonVis(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -9121,7 +9121,7 @@ void MultiSendBreakGlass(room *rp, int facenum) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_BREAK_GLASS, data, &count); @@ -9134,7 +9134,7 @@ void MultiSendBreakGlass(room *rp, int facenum) { } // Server is telling us to break some glass -void MultiDoBreakGlass(ubyte *data) { +void MultiDoBreakGlass(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -9145,7 +9145,7 @@ void MultiDoBreakGlass(ubyte *data) { } // Server says a player has changed rank! -void MultiDoChangeRank(ubyte *data) { +void MultiDoChangeRank(uint8_t *data) { int count = 0; char str[255]; SKIP_HEADER(data, &count); @@ -9172,7 +9172,7 @@ void MultiDoChangeRank(ubyte *data) { } // Server is telling me to strip bare! -void MultiDoStripPlayer(int slot, ubyte *data) { +void MultiDoStripPlayer(int slot, uint8_t *data) { if (slot != 0) { // server didnt send this to us?! Int3(); @@ -9241,7 +9241,7 @@ void MultiSendStripPlayer(int slot) { } int count = 0, save_count; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_STRIP_PLAYER, data, &count); save_count = count; @@ -9267,7 +9267,7 @@ void MultiSendStripPlayer(int slot) { } // Server is telling me about a player rank -void MultiDoInitialRank(ubyte *data) { +void MultiDoInitialRank(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -9284,7 +9284,7 @@ void MultiSendInitialRank(int pnum) { MULTI_ASSERT_NOMESSAGE(Netgame.local_role == LR_SERVER); int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size_offset; size_offset = START_DATA(MP_INITIAL_RANK, data, &count); MultiAddByte(pnum, data, &count); @@ -9342,7 +9342,7 @@ void MultiClearGuidebot(int slot) { // now update the buddy handle list of the clients int count = 0; int size_offset; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; mprintf((0, "Sending Buddy_handle update to clients for Buddy#%d\n", slot)); @@ -9360,7 +9360,7 @@ void MultiClearGuidebot(int slot) { } void RequestPlayerList(network_address *addr) { - ubyte outdata[10]; + uint8_t outdata[10]; int count = 0; int size; @@ -9371,7 +9371,7 @@ void RequestPlayerList(network_address *addr) { // a client is requesting a list of players... so give it to em! void DoReqPlayerList(network_address *addr) { - ubyte outdata[((CALLSIGN_LEN + 1) * MAX_NET_PLAYERS) + 1]; + uint8_t outdata[((CALLSIGN_LEN + 1) * MAX_NET_PLAYERS) + 1]; int count = 0; int size; @@ -9403,7 +9403,7 @@ void DoReqPlayerList(network_address *addr) { char *Multi_recieved_player_list = NULL; bool Multi_got_player_list = false; -void DoPlayerListData(ubyte *data, int len) { +void DoPlayerListData(uint8_t *data, int len) { int count = 0; if (Multi_recieved_player_list == NULL) { mprintf((0, "Received a player list packet when we weren't expecting one. Ignoring.\n")); @@ -9417,7 +9417,7 @@ void DoPlayerListData(ubyte *data, int len) { // Tell a player what ship they are supposed to switch to // if the one they chose isn't allowed. void MultiBashPlayerShip(int slot, char *ship) { - ubyte outdata[100]; + uint8_t outdata[100]; int count = 0; int size; @@ -9430,7 +9430,7 @@ void MultiBashPlayerShip(int slot, char *ship) { int ObjInitTypeSpecific(object *objp, bool reinitializing); -void MultiDoBashPlayerShip(ubyte *data) { +void MultiDoBashPlayerShip(uint8_t *data) { int count = 0; SKIP_HEADER(data, &count); @@ -9477,7 +9477,7 @@ void MultiSendHeartbeat() { time_scalar = .5; // Server sends out twice as fast if ((timer_GetTime() - last_heartbeat) > (HEARTBEAT_INTERVAL * time_scalar)) { - ubyte outdata[100]; + uint8_t outdata[100]; int count = 0; int size; @@ -9499,8 +9499,8 @@ void MultiSendHeartbeat() { } //----------------------------------------------- -void MultiDoMSafeFunction(ubyte *data); -void MultiDoMSafePowerup(ubyte *data); +void MultiDoMSafeFunction(uint8_t *data); +void MultiDoMSafePowerup(uint8_t *data); // This allows us to specify under what sequences certain packets are accepted #define ACCEPT_CONDITION(s, e) \ @@ -9511,8 +9511,8 @@ void MultiDoMSafePowerup(ubyte *data); // #define ACCEPT_CONDITION(s,e) // Takes the individual packet types and passes their data to the appropriate routines -void MultiProcessData(ubyte *data, int len, int slot, network_address *from_addr) { - ubyte type = data[0]; +void MultiProcessData(uint8_t *data, int len, int slot, network_address *from_addr) { + uint8_t type = data[0]; len = len; int sequence = -1; @@ -9948,7 +9948,7 @@ void MultiProcessData(ubyte *data, int len, int slot, network_address *from_addr // Takes a bunch of messages, check them for validity, // and pass them to multi_process_data. -void MultiProcessBigData(ubyte *buf, int len, network_address *from_addr) { +void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr) { int type, bytes_processed = 0; short sub_len; int slot = 0; diff --git a/Descent3/multi.h b/Descent3/multi.h index b30eb903..b49b7b7d 100644 --- a/Descent3/multi.h +++ b/Descent3/multi.h @@ -46,7 +46,7 @@ * * 166 9/09/99 12:24p Kevin * Fixed a bug that was causing problems in the Mac version - * (Game_is_master_tracker_game was defined as a ubyte in the game, but an + * (Game_is_master_tracker_game was defined as a uint8_t in the game, but an * int in the dll) * * 165 9/02/99 3:34p Jason @@ -660,11 +660,11 @@ extern bool Multi_bail_ui_menu; #define PFP_FIRED 1 // the player fired this frame and the info should be packed in a player pos flag #define PFP_FIRED_RELIABLE 2 // used for secondaries of a non-peer to peer game typedef struct { - ubyte fired_on_this_frame; - ubyte wb_index; - ubyte fire_mask; - ubyte damage_scalar; - ubyte reliable; + uint8_t fired_on_this_frame; + uint8_t wb_index; + uint8_t fire_mask; + uint8_t damage_scalar; + uint8_t reliable; int dest_roomnum; } player_fire_packet; @@ -724,7 +724,7 @@ typedef struct { vector pos; int objnum; int roomnum; - ubyte used; + uint8_t used; short original_id; } powerup_respawn; @@ -737,7 +737,7 @@ extern powerup_timer Powerup_timer[]; extern powerup_respawn Powerup_respawn[]; extern network_game Network_games[]; extern netplayer NetPlayers[MAX_NET_PLAYERS]; -extern ubyte Multi_receive_buffer[MAX_RECEIVE_SIZE]; +extern uint8_t Multi_receive_buffer[MAX_RECEIVE_SIZE]; extern int Ok_to_join; extern int Num_powerup_respawn; extern int Num_powerup_timer; @@ -757,22 +757,22 @@ extern int Multi_requested_damage_type; extern float Multi_requested_damage_amount; extern float Multi_additional_shields[]; -extern ubyte Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; +extern uint8_t Multi_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; extern int Multi_send_size[MAX_NET_PLAYERS]; extern float Multi_last_sent_time[MAX_NET_PLAYERS][MAX_NET_PLAYERS]; extern int Multi_additional_damage_type[MAX_NET_PLAYERS]; -extern ubyte Multi_reliable_urgent[MAX_NET_PLAYERS]; -extern ubyte Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; +extern uint8_t Multi_reliable_urgent[MAX_NET_PLAYERS]; +extern uint8_t Multi_reliable_send_buffer[MAX_NET_PLAYERS][MAX_GAME_DATA_SIZE]; extern int Multi_reliable_send_size[MAX_NET_PLAYERS]; extern float Multi_reliable_last_send_time[MAX_NET_PLAYERS]; -extern ubyte Multi_reliable_sent_position[MAX_NET_PLAYERS]; +extern uint8_t Multi_reliable_sent_position[MAX_NET_PLAYERS]; extern uint32_t Multi_visible_players[]; extern int Got_level_info; extern int Got_new_game_time; // For keeping track of buildings that have changed -extern ubyte Multi_building_states[]; +extern uint8_t Multi_building_states[]; extern ushort Multi_num_buildings_changed; extern bool Multi_logo_state; @@ -827,12 +827,12 @@ typedef struct vmt_descent3_struct { extern vmt_descent3_struct MTPilotinfo[MAX_NET_PLAYERS]; // Display a menu based on what the server just told us about -void MultiDoGuidebotMenuData(ubyte *data); +void MultiDoGuidebotMenuData(uint8_t *data); // The user either wants a menu to display or they took an action off of the menu -void MultiDoGuidebotMenuRequest(ubyte *data, int slot); +void MultiDoGuidebotMenuRequest(uint8_t *data, int slot); -void MultiProcessBigData(ubyte *buf, int len, network_address *from_addr); +void MultiProcessBigData(uint8_t *buf, int len, network_address *from_addr); // Points the server_address variable at a new location void MultiSetServerAddress(network_address *addr); @@ -844,7 +844,7 @@ void MultiDoFrame(); int TryToJoinServer(network_address *addr); // The server says we can join! -void MultiDoConnectionAccepted(ubyte *data); +void MultiDoConnectionAccepted(uint8_t *data); // Polls for a connection message so we can finally join this game void MultiPollForConnectionAccepted(); @@ -860,7 +860,7 @@ void StartNewMultiplayerGame(); void MultiCloseGame(); // The server sends to everyone that the player is dead -void MultiSendPlayerDead(int slot, ubyte fate); +void MultiSendPlayerDead(int slot, uint8_t fate); // Called when you want to leave a netgame void MultiLeaveGame(); @@ -870,13 +870,13 @@ void MultiLeaveGame(); void MultiProcessIncoming(); // Starts a packet of data -int START_DATA(int type, ubyte *data, int *count, ubyte reliable = 0); +int START_DATA(int type, uint8_t *data, int *count, uint8_t reliable = 0); // End a pakcet of data -void END_DATA(int count, ubyte *data, int offset); +void END_DATA(int count, uint8_t *data, int offset); // Skip the header stuff -void SKIP_HEADER(ubyte *data, int *count); +void SKIP_HEADER(uint8_t *data, int *count); // Starts a level for multiplayer bool MultiStartNewLevel(int level); @@ -886,7 +886,7 @@ int MultiCountPlayers(); // Puts player "slot" position info into the passed in buffer // Returns the number of bytes used -int MultiStuffPosition(int slot, ubyte *data); +int MultiStuffPosition(int slot, uint8_t *data); // Sends a full packet out the the server // Resets the send_size variable @@ -902,7 +902,7 @@ void MultiMakePlayerGhost(int slot); void MultiMakePlayerReal(int slot); // Sends a fire packet from a player -void MultiSendFirePlayerWB(int playernum, ubyte wb_index, ubyte fire_mask, ubyte reliable = 0, float scalar = 1.0); +void MultiSendFirePlayerWB(int playernum, uint8_t wb_index, uint8_t fire_mask, uint8_t reliable = 0, float scalar = 1.0); void MultiMakeMatrix(multi_orientation *dest, matrix *src); @@ -942,33 +942,33 @@ int MultiMatchGeneric(uint32_t unique_id); void MultiSendMessageToServer(int, char *, int to = MULTI_SEND_MESSAGE_ALL); // Sends an object from the server to the client -void MultiSendObject(object *obj, ubyte announce, ubyte demo_record = false); +void MultiSendObject(object *obj, uint8_t announce, uint8_t demo_record = false); // Paints all the goal rooms in a level with their colors void MultiPaintGoalRooms(int *texcolors = NULL); // Sends a special script packet to a player -void MultiSendSpecialPacket(int slot, ubyte *outdata, int size); +void MultiSendSpecialPacket(int slot, uint8_t *outdata, int size); // Flushes all receive sockets so that there is no data coming from them void MultiFlushAllIncomingBuffers(); // Tells all clients to remove a specified object -void MultiSendRemoveObject(object *obj, ubyte playsound); +void MultiSendRemoveObject(object *obj, uint8_t playsound); // Sends the special script packet to the server -void MultiClientSendSpecialPacket(ubyte *outdata, int size); +void MultiClientSendSpecialPacket(uint8_t *outdata, int size); // Sends info out on my guided missile into a slot // returns number of bytes in packet -int MultiStuffGuidedInfo(ubyte, ubyte *); +int MultiStuffGuidedInfo(uint8_t, uint8_t *); // Polls for a connection message so we can finally join this game // Client only int MultiPollForLevelInfo(); // Server is telling us about the level -void MultiDoLevelInfo(ubyte *data); +void MultiDoLevelInfo(uint8_t *data); // Server is telling the client about the level currently playing // Server only @@ -976,7 +976,7 @@ void MultiSendLevelInfo(int slot); // Clients says he's ready for level info // so send it to him -void MultiDoReadyForLevel(ubyte *data); +void MultiDoReadyForLevel(uint8_t *data); // Client is telling the server that he is ready for a level // Client only @@ -992,10 +992,10 @@ void MultiEndLevel(); void GetServerGameTime(); // Send robot info -int MultiStuffRobotPosition(uint16_t objectnum, ubyte *data); +int MultiStuffRobotPosition(uint16_t objectnum, uint8_t *data); // Handle robot position -void MultiDoRobotPos(ubyte *data); +void MultiDoRobotPos(uint8_t *data); // Handle robot (or any AI created) weapon fire int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum); @@ -1004,7 +1004,7 @@ int MultiSendRobotFireWeapon(uint16_t objectnum, vector *pos, vector *dir, uint1 void MultiSendKillObject(object *hit_obj, object *killer, float damage, int death_flags, float delay, short seed); // handle robot damage -void MultiDoRobotExplode(ubyte *data); +void MultiDoRobotExplode(uint8_t *data); // Peer to peer request for damage void MultiSendRequestPeerDamage(object *, int, int, float); @@ -1013,7 +1013,7 @@ void MultiSendRequestPeerDamage(object *, int, int, float); void MultiSendInitialRank(int pnum); // Tells the other players that a slot is starting/stopping its on/off weapon -void MultiSendOnOff(object *obj, ubyte on, ubyte wb_index, ubyte fire_mask); +void MultiSendOnOff(object *obj, uint8_t on, uint8_t wb_index, uint8_t fire_mask); // Tells all the clients to apply damage to a player void MultiSendAdditionalDamage(int slot, int type, float amount); @@ -1025,19 +1025,19 @@ void MultiSendRequestCountermeasure(short objnum, int weapon_index); void MultiSendDamageObject(object *hit_obj, object *killer, float damage, int weaponid); // Handle message from server that robot/object took damage -void MultiDoRobotDamage(ubyte *data); +void MultiDoRobotDamage(uint8_t *data); // Add an object to the list of objects that need an animation update next player packet interval void MultiAddObjAnimUpdate(int objnum); // Stuff an animation update into a packet -int MultiStuffObjAnimUpdate(uint16_t objnum, ubyte *data); +int MultiStuffObjAnimUpdate(uint16_t objnum, uint8_t *data); // Handle an animation update -void MultiDoObjAnimUpdate(ubyte *data); +void MultiDoObjAnimUpdate(uint8_t *data); // Play a 3d sound that the server told us about -void MultiDoPlay3dSound(ubyte *data); +void MultiDoPlay3dSound(uint8_t *data); // Tell the clients to play a 3d sound void MultiPlay3dSound(short soundidx, ushort objnum, int priority); @@ -1046,63 +1046,63 @@ void MultiPlay3dSound(short soundidx, ushort objnum, int priority); void MultiSendRobotFireSound(short soundidx, ushort objnum); // Play the robot sound that the server told us about -void MultiDoRobotFireSound(ubyte *data); +void MultiDoRobotFireSound(uint8_t *data); // Add a turret to the list of stuff to be updated void MultiAddObjTurretUpdate(int objnum); // Stuff turret data into a packet -int MultiStuffTurretUpdate(uint16_t objnum, ubyte *data); +int MultiStuffTurretUpdate(uint16_t objnum, uint8_t *data); // Handle a turret update from the server -void MultiDoTurretUpdate(ubyte *data); +void MultiDoTurretUpdate(uint8_t *data); // Handle a client use inventory item packet -void MultiDoClientInventoryUseItem(int slot, ubyte *data); +void MultiDoClientInventoryUseItem(int slot, uint8_t *data); // Send a request to use an inventory item to the server void MultiSendClientInventoryUseItem(int type, int id); // Handle a remove item from inventory -void MultiDoClientInventoryRemoveItem(int slot, ubyte *data); +void MultiDoClientInventoryRemoveItem(int slot, uint8_t *data); // Tell the clients to remove an item from a player's inventory void MultiSendInventoryRemoveItem(int slot, int type, int id); void MultiAddObjWBAnimUpdate(int objnum); -int MultiStuffObjWBAnimUpdate(uint16_t objnum, ubyte *data); +int MultiStuffObjWBAnimUpdate(uint16_t objnum, uint8_t *data); -void MultiDoObjWBAnimUpdate(ubyte *data); +void MultiDoObjWBAnimUpdate(uint8_t *data); -void MultiDoBytesSent(ubyte *data); +void MultiDoBytesSent(uint8_t *data); void MultiSendBytesSent(int slot); void MultiSendPPSSet(int pps); -void MultiDoPPSSet(ubyte *data, int slot); +void MultiDoPPSSet(uint8_t *data, int slot); void MultiSendGreetings(uint32_t id); -void MultiDoGreetings(ubyte *data, network_address *addr); +void MultiDoGreetings(uint8_t *data, network_address *addr); // We're asking to enter observer mode void MultiSendRequestToObserve(int mode, int on, int objnum); // Server is telling us about players that we can see -void MultiDoVisiblePlayers(ubyte *data); +void MultiDoVisiblePlayers(uint8_t *data); // Sends all the visible players to another player void MultiSendVisiblePlayers(int to_slot); -void MultiDoFileReq(ubyte *data); +void MultiDoFileReq(uint8_t *data); -void MultiDoFileDenied(ubyte *data); +void MultiDoFileDenied(uint8_t *data); -void MultiDoFileData(ubyte *data); +void MultiDoFileData(uint8_t *data); -void MultiDoFileAck(ubyte *data); +void MultiDoFileAck(uint8_t *data); // Tells clients that a particular player's custom data is here and ready for downloading void MultiSendClientCustomData(int slot, int whoto = -1); @@ -1121,10 +1121,10 @@ void MultiSendRequestShields(int type, float amount); // Tells the clients to ghost or unghost an object void MultiSendGhostObject(object *obj, bool ghost); -void MultiDoGhostObject(ubyte *data); +void MultiDoGhostObject(uint8_t *data); // Sends this nonreliable packet to everyone except the server and the named slot -void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold); +void MultiSendToAllExcept(int except, uint8_t *data, int size, int seq_threshold); // Tells the server about the weapons we're carrying void MultiSendWeaponsLoad(); @@ -1136,19 +1136,19 @@ void MultiSendBreakGlass(room *rp, int facenum); void MultiSendHeartbeat(); // Ping functions to find the players latency -void MultiDoPong(ubyte *data); -void MultiDoPing(ubyte *data, network_address *addr); +void MultiDoPong(uint8_t *data); +void MultiDoPing(uint8_t *data, network_address *addr); void MultiSendPing(int slot); -void MultiDoLagInfo(ubyte *data); +void MultiDoLagInfo(uint8_t *data); // Stuffs a players firing information into a packet -int MultiStuffPlayerFire(int slot, ubyte *data); +int MultiStuffPlayerFire(int slot, uint8_t *data); // Stuffs request to move into a packet -int MultiStuffRequestToMove(ubyte *data); +int MultiStuffRequestToMove(uint8_t *data); // Stuff info for a guided missile -int MultiStuffGuidedInfo(int slot, ubyte *data); +int MultiStuffGuidedInfo(int slot, uint8_t *data); // Tell everyone I'm timingout my timeout weapon void MultiSendReleaseTimeoutMissile(); @@ -1170,33 +1170,33 @@ extern bool Multi_accept_state; void MultiSetAcceptState(bool state); void MultiSendAiWeaponFlags(object *obj, int flags, int wb_index); -void MultiDoAiWeaponFlags(ubyte *data); +void MultiDoAiWeaponFlags(uint8_t *data); void MultiSendAttach(object *parent, char parent_ap, object *child, char child_ap, bool f_aligned); -void MultiDoAttach(ubyte *data); +void MultiDoAttach(uint8_t *data); void MultiSendAttachRad(object *parent, char parent_ap, object *child, float rad); -void MultiDoAttachRad(ubyte *data); +void MultiDoAttachRad(uint8_t *data); void MultiSendUnattach(object *child); -void MultiDoUnattach(ubyte *data); +void MultiDoUnattach(uint8_t *data); -void MultiDoJoinDemoObjects(ubyte *data); +void MultiDoJoinDemoObjects(uint8_t *data); // Rank stuff -void MultiDoChangeRank(ubyte *data); +void MultiDoChangeRank(uint8_t *data); // Sets whether or not we want the logos to be displayed on ships void MultiSetLogoState(bool state); void MultiSendThiefSteal(int player, int item); -void MultiDoThiefSteal(ubyte *data); +void MultiDoThiefSteal(uint8_t *data); void MultiSetAudioTauntTime(float time, int to_who = -1); -void MultiDoAudioTauntTime(ubyte *data); +void MultiDoAudioTauntTime(uint8_t *data); // Server only function to clear a Guidebot for a disconnected player void MultiClearGuidebot(int slot); // Guided missile release -void MultiDoMissileRelease(int from_slot, ubyte *data); +void MultiDoMissileRelease(int from_slot, uint8_t *data); void MultiSendMissileRelease(int slot, bool is_guided); // Server telling a client what ship to switch to @@ -1205,7 +1205,7 @@ void MultiBashPlayerShip(int slot, char *ship); // Strips a player bare of weapons void MultiSendStripPlayer(int slot); -inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) { +inline void MultiGetTypeID(uint8_t *data, int *count, int *type, int *id) { *id = -1; *type = MultiGetByte(data, count); @@ -1217,7 +1217,7 @@ inline void MultiGetTypeID(ubyte *data, int *count, int *type, int *id) { *id = MultiMatchGeneric(hash_value); } -inline void MultiAddTypeID(int type, int id, ubyte *data, int *count) { +inline void MultiAddTypeID(int type, int id, uint8_t *data, int *count) { uint32_t hash_value; hash_value = MultiGetMatchChecksum(type, id); diff --git a/Descent3/multi_client.cpp b/Descent3/multi_client.cpp index 096d1184..495c18f4 100644 --- a/Descent3/multi_client.cpp +++ b/Descent3/multi_client.cpp @@ -158,7 +158,7 @@ extern int Use_file_xfer; // Tell the server about my info, such as name, ship type, etc void MultiSendMyInfo() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending my info\n")); @@ -224,7 +224,7 @@ void MultiSendMyInfo() { // Ask the server to tell me about the players void MultiSendRequestForPlayers() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending request for players\n")); @@ -239,7 +239,7 @@ void MultiSendRequestForPlayers() { // Ask the server to tell me about the buildings void MultiSendRequestForBuildings() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending request for buildings\n")); @@ -254,7 +254,7 @@ void MultiSendRequestForBuildings() { // Ask the server to tell me about the world void MultiSendRequestForWorldStates() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending request for world states\n")); @@ -275,7 +275,7 @@ void MultiSendRequestForWorldStates() { // Ask the server to tell me about the objects void MultiSendRequestForObjects() { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending request for objects\n")); @@ -436,7 +436,7 @@ void MultiDoClientFrame() { } } - ubyte data[MAX_GAME_DATA_SIZE], count = 0, add_count = 0; + uint8_t data[MAX_GAME_DATA_SIZE], count = 0, add_count = 0; count = MultiStuffPosition(Player_num, data); diff --git a/Descent3/multi_connect.cpp b/Descent3/multi_connect.cpp index f15f0a8c..83734960 100644 --- a/Descent3/multi_connect.cpp +++ b/Descent3/multi_connect.cpp @@ -295,7 +295,7 @@ int AskToJoin(network_address *addr) { int count = 0; int size; int tries = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; float start_time; network_address from_addr; @@ -421,7 +421,7 @@ int TryToJoinServer(network_address *addr) { // The server says we can join! // Client only -void MultiDoConnectionAccepted(ubyte *data) { +void MultiDoConnectionAccepted(uint8_t *data) { int count = 0; ushort server_version; @@ -438,7 +438,7 @@ void MultiDoConnectionAccepted(ubyte *data) { mprintf((0, "Client/server versions match.\n")); // Check if we have the mission needed - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); memcpy(Netgame.mission, &data[count], len); count += len; @@ -459,7 +459,7 @@ void MultiDoConnectionAccepted(ubyte *data) { SetGamemodeScript(Netgame.scriptname); // Get my player num and copy my name over - ubyte player_num = MultiGetByte(data, &count); + uint8_t player_num = MultiGetByte(data, &count); char name[CALLSIGN_LEN]; netplayer tempplayer; strcpy(name, Players[Player_num].callsign); @@ -501,7 +501,7 @@ void MultiDoConnectionAccepted(ubyte *data) { void MultiPollForConnectionAccepted() { float start_time; int connected = 0; - ubyte data[MAX_RECEIVE_SIZE]; + uint8_t data[MAX_RECEIVE_SIZE]; start_time = timer_GetTime(); @@ -526,7 +526,7 @@ void MultiPollForConnectionAccepted() { // is successfully talking to the client // Server only void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -598,7 +598,7 @@ void MultiSendConnectionAccepted(int slotnum, SOCKET sock, network_address *addr int MultiPollForLevelInfo() { float start_time, ask_time, initial_start_time; int connected = 0; - ubyte data[MAX_RECEIVE_SIZE]; + uint8_t data[MAX_RECEIVE_SIZE]; network_address from_addr; ShowProgressScreen(TXT_MLTWAITSERVER); @@ -718,7 +718,7 @@ void MultiProcessShipChecksum(MD5 *md5, int ship_index) { } // Server is telling us about the level -void MultiDoLevelInfo(ubyte *data) { +void MultiDoLevelInfo(uint8_t *data) { int count = 0; char pshipmodel[PAGENAME_LEN]; Current_pilot.get_ship(pshipmodel); @@ -750,7 +750,7 @@ void MultiDoLevelInfo(ubyte *data) { // Server only void MultiSendLevelInfo(int slot) { ASSERT(Netgame.local_role == LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -779,9 +779,9 @@ void MultiSendLevelInfo(int slot) { // Clients says he's ready for level info // so send it to him -void MultiDoReadyForLevel(ubyte *data) { +void MultiDoReadyForLevel(uint8_t *data) { int count = 0; - ubyte slot; + uint8_t slot; char ship_name[PAGENAME_LEN]; // Skip header stuff @@ -810,7 +810,7 @@ void MultiDoReadyForLevel(ubyte *data) { void MultiSendReadyForLevel() { ASSERT(Netgame.local_role != LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -906,7 +906,7 @@ int SearchForLocalGamesTCP(uint32_t ask, ushort port) { int count = 0; int size; int tries = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; network_address check_addr, from_addr; check_addr.connection_type = NP_TCP; if (ask) { @@ -935,7 +935,7 @@ int SearchForGamesPXO(uint32_t ask, ushort port) { int count = 0; int size; int tries = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; network_address check_addr, from_addr; check_addr.connection_type = NP_TCP; if (ask) { diff --git a/Descent3/multi_dll_mgr.cpp b/Descent3/multi_dll_mgr.cpp index def528fc..0d606438 100644 --- a/Descent3/multi_dll_mgr.cpp +++ b/Descent3/multi_dll_mgr.cpp @@ -321,7 +321,7 @@ void *callback = NULL; module MultiDLLHandle = {NULL}; int SearchForLocalGamesTCP(uint32_t ask, ushort port); int SearchForGamesPXO(uint32_t ask, ushort port); -extern ubyte NewUIWindow_alpha; +extern uint8_t NewUIWindow_alpha; extern void DoScreenshot(); extern void UpdateAndPackGameList(void); extern bool Multi_Gamelist_changed; @@ -846,7 +846,7 @@ void RemoveUITextItem(void *item) { UITextItem *old_text_item = (UITextItem *)item; delete old_text_item; } -void *CreateNewUIBmpItem(int handle, ubyte alpha) { +void *CreateNewUIBmpItem(int handle, uint8_t alpha) { UIBitmapItem *new_bmp_item; new_bmp_item = new UIBitmapItem(handle, alpha); return new_bmp_item; diff --git a/Descent3/multi_dll_mgr.h b/Descent3/multi_dll_mgr.h index e7362ec6..12fbd536 100644 --- a/Descent3/multi_dll_mgr.h +++ b/Descent3/multi_dll_mgr.h @@ -149,7 +149,7 @@ int PollUI(void); void RemoveUITextItem(void *item); void *CreateNewUITextItem(const char *newtext, uint32_t color, int font = -1); void RemoveUIBmpItem(void *item); -void *CreateNewUIBmpItem(int handle, ubyte alpha); +void *CreateNewUIBmpItem(int handle, uint8_t alpha); void CloseSplashScreen(void); void CreateSplashScreen(const char *msg, int usecancel); void *UIConsoleGadgetCreate(UIWindow *parentid, int id, int x, int y, int font, int cols, int rows, int flags); diff --git a/Descent3/multi_external.h b/Descent3/multi_external.h index efd9bb58..2a3e67c8 100644 --- a/Descent3/multi_external.h +++ b/Descent3/multi_external.h @@ -191,9 +191,9 @@ typedef struct { char voice_taunt2[_MAX_PATH]; char voice_taunt3[_MAX_PATH]; char voice_taunt4[_MAX_PATH]; - ubyte custom_file_seq; - ubyte sequence; // where we are in the sequence chain - ubyte pps; + uint8_t custom_file_seq; + uint8_t sequence; // where we are in the sequence chain + uint8_t pps; HANDLE hPlayerEvent; // player event to use for directplay DWORD dpidPlayer; // directplay ID of player created float ping_time; @@ -218,7 +218,7 @@ typedef struct { uint32_t flags; float last_update; bool dedicated_server; - ubyte difficulty; // Game difficulty level + uint8_t difficulty; // Game difficulty level uint32_t handle; } network_game; @@ -253,130 +253,130 @@ typedef struct { char connection_name[PAGENAME_LEN]; network_address server_address; // The address of the server that we're talking to - not used if we are the server - ubyte local_role; - ubyte server_sequence; + uint8_t local_role; + uint8_t server_sequence; float last_server_time; // last time we got a packet from the server - ubyte packets_per_second; // how many packets per second we'll send out + uint8_t packets_per_second; // how many packets per second we'll send out int flags; int timelimit; // how many minutes to play this level int killgoal; // kill goal for this level int respawn_time; int max_players; - ubyte difficulty; // Game difficulty level + uint8_t difficulty; // Game difficulty level u_char digest[16]; } netgame_info; // Inline functions for extracting/packing multiplayer data -inline void MultiAddUbyte(ubyte element, ubyte *data, int *count) { +inline void MultiAddUbyte(uint8_t element, uint8_t *data, int *count) { data[*count] = element; - *count += sizeof(ubyte); + *count += sizeof(uint8_t); } -inline void MultiAddByte(ubyte element, ubyte *data, int *count) { +inline void MultiAddByte(uint8_t element, uint8_t *data, int *count) { data[*count] = element; - *count += sizeof(ubyte); + *count += sizeof(uint8_t); } -inline void MultiAddSbyte(int8_t element, ubyte *data, int *count) { +inline void MultiAddSbyte(int8_t element, uint8_t *data, int *count) { data[*count] = element; *count += sizeof(int8_t); } -inline void MultiAddShort(short element, ubyte *data, int *count) { +inline void MultiAddShort(short element, uint8_t *data, int *count) { *(short *)(data + *count) = INTEL_SHORT(element); *count += sizeof(short); } -inline void MultiAddUshort(ushort element, ubyte *data, int *count) { +inline void MultiAddUshort(ushort element, uint8_t *data, int *count) { *(ushort *)(data + *count) = INTEL_SHORT(element); *count += sizeof(ushort); } -inline void MultiAddInt(int element, ubyte *data, int *count) { +inline void MultiAddInt(int element, uint8_t *data, int *count) { *(int *)(data + *count) = INTEL_INT(element); *count += sizeof(int); } -inline void MultiAddUint(uint32_t element, ubyte *data, int *count) { +inline void MultiAddUint(uint32_t element, uint8_t *data, int *count) { *(uint32_t *)(data + *count) = INTEL_INT(element); *count += sizeof(uint32_t); } -inline void MultiAddFloat(float element, ubyte *data, int *count) { +inline void MultiAddFloat(float element, uint8_t *data, int *count) { *(float *)(data + *count) = INTEL_FLOAT(element); *count += sizeof(float); } -inline void MultiAddString(const char *str, ubyte *data, int *count) { +inline void MultiAddString(const char *str, uint8_t *data, int *count) { size_t len = strlen(str) + 1; assert(len <= 0xFF); - MultiAddByte((ubyte)len, data, count); + MultiAddByte((uint8_t)len, data, count); memcpy(&data[*count], str, len); *count += len; } -inline ubyte MultiGetUbyte(ubyte *data, int *count) { - ubyte element = (*(ubyte *)(data + *count)); - (*count) += sizeof(ubyte); +inline uint8_t MultiGetUbyte(uint8_t *data, int *count) { + uint8_t element = (*(uint8_t *)(data + *count)); + (*count) += sizeof(uint8_t); return element; } -inline ubyte MultiGetByte(ubyte *data, int *count) { - ubyte element = (*(ubyte *)(data + *count)); - (*count) += sizeof(ubyte); +inline uint8_t MultiGetByte(uint8_t *data, int *count) { + uint8_t element = (*(uint8_t *)(data + *count)); + (*count) += sizeof(uint8_t); return element; } -inline int8_t MultiGetSbyte(ubyte *data, int *count) { +inline int8_t MultiGetSbyte(uint8_t *data, int *count) { int8_t element = (*(int8_t *)(data + *count)); (*count) += sizeof(int8_t); return element; } -inline short MultiGetShort(ubyte *data, int *count) { +inline short MultiGetShort(uint8_t *data, int *count) { short element = (*(short *)(data + *count)); *count += sizeof(short); return INTEL_SHORT(element); } -inline ushort MultiGetUshort(ubyte *data, int *count) { +inline ushort MultiGetUshort(uint8_t *data, int *count) { ushort element = (*(ushort *)(data + *count)); *count += sizeof(short); return INTEL_SHORT(element); } -inline int MultiGetInt(ubyte *data, int *count) { +inline int MultiGetInt(uint8_t *data, int *count) { int element = (*(int *)(data + *count)); *count += sizeof(int); return INTEL_INT(element); } -inline uint32_t MultiGetUint(ubyte *data, int *count) { +inline uint32_t MultiGetUint(uint8_t *data, int *count) { uint32_t element = (*(uint32_t *)(data + *count)); *count += sizeof(int); return INTEL_INT(element); } -inline float MultiGetFloat(ubyte *data, int *count) { +inline float MultiGetFloat(uint8_t *data, int *count) { float element = (*(float *)(data + *count)); *count += sizeof(float); return INTEL_FLOAT(element); } -inline void MultiGetString(char *str, ubyte *data, int *count) { - ubyte len = MultiGetByte(data, count); +inline void MultiGetString(char *str, uint8_t *data, int *count) { + uint8_t len = MultiGetByte(data, count); memcpy(str, &data[*count], len); *count += len; } -inline void MultiAddVector(vector v, ubyte *data, int *count) { +inline void MultiAddVector(vector v, uint8_t *data, int *count) { MultiAddFloat(v.x, data, count); MultiAddFloat(v.y, data, count); MultiAddFloat(v.z, data, count); } -inline vector MultiGetVector(ubyte *data, int *count) { +inline vector MultiGetVector(uint8_t *data, int *count) { vector v; v.x = MultiGetFloat(data, count); diff --git a/Descent3/multi_server.cpp b/Descent3/multi_server.cpp index 1f518218..1f64be65 100644 --- a/Descent3/multi_server.cpp +++ b/Descent3/multi_server.cpp @@ -166,7 +166,7 @@ * prevention * * 231 5/03/99 4:22p Jeff - * changed byte var to ubyte type for Linux + * changed byte var to uint8_t type for Linux * * 230 5/03/99 2:36p Jason * changes for multiplayer games @@ -936,7 +936,7 @@ void MultiCheckListen() { // Tells the client that we're done sending players void MultiSendDonePlayers(int slot) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending done players\n")); @@ -952,7 +952,7 @@ void MultiSendDonePlayers(int slot) { // Tells the client that we're done sending buildings void MultiSendDoneBuildings(int slot) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending done buildings\n")); @@ -966,7 +966,7 @@ void MultiSendDoneBuildings(int slot) { // Tells the client that we're done sending objects void MultiSendDoneObjects(int slot) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending done objects\n")); @@ -994,7 +994,7 @@ void MultiSendDoneObjects(int slot) { // Tells the client that we're done sending the world states void MultiSendDoneWorldStates(int slot) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending done world states\n")); @@ -1020,7 +1020,7 @@ void MultiClearPlayerMarkers(int slot) { // Tells our clients that a player disconnected void MultiSendPlayerDisconnect(int slot) { int size, count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; size = START_DATA(MP_DISCONNECT, data, &count); @@ -1112,7 +1112,7 @@ void MultiDisconnectPlayer(int slot) { void MultiSendPlayer(int slot, int which) { ASSERT(Netgame.local_role == LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -1149,7 +1149,7 @@ void MultiSendPlayer(int slot, int which) { if (slot == which) { int myteam = GameDLLGetConnectingPlayersTeam(slot); - ubyte temp_team = (myteam == -1) ? 255 : myteam; + uint8_t temp_team = (myteam == -1) ? 255 : myteam; MultiAddByte(temp_team, data, &count); if (myteam >= 0 && myteam <= 4) @@ -1162,7 +1162,7 @@ void MultiSendPlayer(int slot, int which) { MultiAddShort(Players[slot].start_index, data, &count); } else { - ubyte temp_team = (Players[which].team == -1) ? 255 : Players[which].team; + uint8_t temp_team = (Players[which].team == -1) ? 255 : Players[which].team; MultiAddByte(temp_team, data, &count); } @@ -1204,7 +1204,7 @@ void MultiSendPlayer(int slot, int which) { void MultiSendBuildings(int slot) { ASSERT(Netgame.local_role == LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -1253,7 +1253,7 @@ bool MultiIsValidMovedObject(object *obj) { } void MultiSendJoinDemoObjects(int slot) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset, i; @@ -1283,7 +1283,7 @@ void MultiSendJoinDemoObjects(int slot) { nw_SendReliable(NetPlayers[slot].reliable_socket, data, count); } -int StuffObjectIntoPacket(object *obj, ubyte *data) { +int StuffObjectIntoPacket(object *obj, uint8_t *data) { uint32_t index; int count = 0; bool obj_is_dummy = false; @@ -1335,7 +1335,7 @@ int StuffObjectIntoPacket(object *obj, ubyte *data) { if (obj->type == OBJ_MARKER) { // Add marker message to the end of this - ubyte len = strlen(MarkerMessages[obj->id]) + 1; + uint8_t len = strlen(MarkerMessages[obj->id]) + 1; MultiAddByte(len, data, &count); memcpy(data + count, MarkerMessages[obj->id], len); count += len; @@ -1357,7 +1357,7 @@ int StuffObjectIntoPacket(object *obj, ubyte *data) { void MultiSendJoinObjects(int slot) { ASSERT(Netgame.local_role == LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; ushort outgoing_objects[MAX_OBJECTS]; int count = 0; int size_offset; @@ -1417,7 +1417,7 @@ void MultiSendJoinObjects(int slot) { for (i = 0; i < num_objects_this_packet && !overflow; i++) { // Add objnum and id object *obj = &Objects[outgoing_objects[i + cur_object]]; - ubyte obj_data[MAX_GAME_DATA_SIZE]; + uint8_t obj_data[MAX_GAME_DATA_SIZE]; int num_bytes = StuffObjectIntoPacket(obj, obj_data); @@ -1447,7 +1447,7 @@ void MultiSendJoinObjects(int slot) { MultiSendJoinDemoObjects(slot); } -void MultiStoreWorldPacket(int slot, ubyte *big_data, int *big_count, ubyte *cur_data, int *cur_count, +void MultiStoreWorldPacket(int slot, uint8_t *big_data, int *big_count, uint8_t *cur_data, int *cur_count, int *size_offset) { if (*big_count + *cur_count >= (MAX_GAME_DATA_SIZE - 3)) { mprintf((0, "Starting another world packet!\n")); @@ -1474,8 +1474,8 @@ void MultiSendWorldStates(int slot) { int i; ASSERT(Netgame.local_role == LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; - ubyte cur_data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; + uint8_t cur_data[MAX_GAME_DATA_SIZE]; int cur_count; int count = 0; int size_offset; @@ -1820,7 +1820,7 @@ void MultiSendWorldStates(int slot) { } // Sends this reliable packet to everyone except the server and the named slot -void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_threshold, bool urgent) { +void MultiSendReliablyToAllExcept(int except, uint8_t *data, int size, int seq_threshold, bool urgent) { for (int i = 0; i < MAX_NET_PLAYERS; i++) { if (!(NetPlayers[i].flags & NPF_CONNECTED)) continue; @@ -1835,7 +1835,7 @@ void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_thr } // Sends this nonreliable packet to everyone except the server and the named slot -void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold) { +void MultiSendToAllExcept(int except, uint8_t *data, int size, int seq_threshold) { ASSERT(Netgame.local_role == LR_SERVER); for (int i = 0; i < MAX_NET_PLAYERS; i++) { @@ -1853,7 +1853,7 @@ void MultiSendToAllExcept(int except, ubyte *data, int size, int seq_threshold) // Flushes all receive sockets so that there is no data coming from them void MultiFlushAllIncomingBuffers() { - ubyte *data; + uint8_t *data; network_address from_addr; int size; @@ -1903,7 +1903,7 @@ void MultiCheckToRepositionPowerups() { if (obj->flags & OF_STOPPED_THIS_FRAME) { // Send out our positional change int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size = START_DATA(MP_POWERUP_REPOSITION, data, &count); changed++; @@ -1982,11 +1982,11 @@ void MultiCheckToRespawnPowerups() { extern int Multi_occluded; // Sends out positional updates based on clients pps void MultiSendPositionalUpdates(int to_slot) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; // Figure out if we should send positional updates to players for (int i = 0; i < MAX_PLAYERS; i++) { - ubyte send_position = 0, timer_popped = 0; + uint8_t send_position = 0, timer_popped = 0; if ((Netgame.flags & NF_PEER_PEER) && i != Player_num) continue; // Don't send out other positions if in peer mode @@ -2184,7 +2184,7 @@ void MultiSetupNonVisRobots(int slot, object *obj) { obj->generic_nonvis_flags | // Sends out a list of generics that this client can't see void MultiSendGenericNonVis(int slot, ushort *objarray, int num) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -2369,7 +2369,7 @@ bool MultiIsGenericVisibleToPlayer(int test_objnum, int to_slot) { void MultiDoServerRobotFrame(int slot) { int rcount = 0; int m = 0; - ubyte rdata[MAX_GAME_DATA_SIZE]; + uint8_t rdata[MAX_GAME_DATA_SIZE]; // send robot information for any robots that have moved. for (m = 0; m < Num_moved_robots[slot]; m++) { @@ -2734,7 +2734,7 @@ void MultiDoServerFrame() { // Tells clients to execute dlls on their machines void MultiSendClientExecuteDLL(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -2959,9 +2959,9 @@ int GetRankIndex(int pnum, char *rankbuf) { } // Tells the clients to change rank for a player -void MultiSendChangeRank(int pnum, char *str, ubyte goodnews) { +void MultiSendChangeRank(int pnum, char *str, uint8_t goodnews) { int size; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; mprintf((0, "Sending change rank!\n")); @@ -2981,7 +2981,7 @@ void MultiSendChangeRank(int pnum, char *str, ubyte goodnews) { void ChangeRankIndex(int old_index, int pnum) { char str[255]; int new_index = GetRankIndex(pnum); - ubyte goodnews = 1; + uint8_t goodnews = 1; if (old_index < new_index) // promoted { diff --git a/Descent3/multi_server.h b/Descent3/multi_server.h index 9ab41d99..857f374b 100644 --- a/Descent3/multi_server.h +++ b/Descent3/multi_server.h @@ -64,7 +64,7 @@ void MultiDisconnectPlayer(int slot); void MultiSendPlayer(int slot, int which); // Sends this reliable packet to everyone except the server and the named slot -void MultiSendReliablyToAllExcept(int except, ubyte *data, int size, int seq_threshold = 0, bool urgent = 1); +void MultiSendReliablyToAllExcept(int except, uint8_t *data, int size, int seq_threshold = 0, bool urgent = 1); // Tells clients to execute dlls on their machines void MultiSendClientExecuteDLL(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info = NULL); diff --git a/Descent3/multisafe.cpp b/Descent3/multisafe.cpp index b03eb151..dedd9d22 100644 --- a/Descent3/multisafe.cpp +++ b/Descent3/multisafe.cpp @@ -1298,10 +1298,10 @@ extern bool Demo_call_ok; // The main entry point for all the multisafe functions // Pass the type of function you want, and then fill in the relevant fields // of the mstruct -void msafe_CallFunction(ubyte type, msafe_struct *mstruct) { +void msafe_CallFunction(uint8_t type, msafe_struct *mstruct) { if ((Demo_flags == DF_PLAYBACK) && (!Demo_call_ok)) return; - ubyte send_it = 1; + uint8_t send_it = 1; switch (type) { case MSAFE_WEATHER_RAIN: SetRainState(mstruct->state, mstruct->scalar); @@ -2458,17 +2458,17 @@ bool AddPowerupEnergyToPlayer(int id) { return true; } // returns true if it was handled -bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup); -bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup); -bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pickup); -bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup); +bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup); +bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup); +bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup); +bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup); // Does whatever magic needs to be done to get the default powerups to work void msafe_DoPowerup(msafe_struct *mstruct) { char pname[255]; strcpy(pname, Object_info[MOBJ->id].name); ASSERT(MOBJ->type == OBJ_POWERUP); ASSERT(IOBJ->type == OBJ_PLAYER); - ubyte pickup = 0; + uint8_t pickup = 0; // Now go through and do the magic for each powerup bool handled = false; handled = HandleCommonPowerups(pname, mstruct, &pickup); @@ -2567,9 +2567,9 @@ void CheckForWeaponSelect(int id, int weapon_index) { } } } -extern ubyte AutomapVisMap[MAX_ROOMS]; +extern uint8_t AutomapVisMap[MAX_ROOMS]; // New spiffy table-based code -bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { +bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) { object *player = ObjGet(mstruct->ithandle); object *powerup = ObjGet(mstruct->objhandle); int p; @@ -2676,7 +2676,7 @@ bool HandleWeaponPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { return handled; } // returns true if it was handled -bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { +bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) { int pnum = IOBJ->id; bool handled = false; // Shield bonus @@ -2796,7 +2796,7 @@ bool HandleCommonPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { } return handled; } -bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { +bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) { bool handled = false; // Chaff if (!stricmp("Chaff", pname)) { @@ -2980,7 +2980,7 @@ bool HandleCounterMeasurePowerups(char *pname, msafe_struct *mstruct, ubyte *pic } return handled; } -bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, ubyte *pickup) { +bool HandleInventoryPowerups(char *pname, msafe_struct *mstruct, uint8_t *pickup) { bool handled = false; int pnum = IOBJ->id; // Afterburner cooler diff --git a/Descent3/multisafe.h b/Descent3/multisafe.h index ddaceab5..0dbb406a 100644 --- a/Descent3/multisafe.h +++ b/Descent3/multisafe.h @@ -23,7 +23,7 @@ #include "osiris_share.h" // LOCAL MULTISAFE FUNCTIONS -void msafe_CallFunction(ubyte type, msafe_struct *mstruct); +void msafe_CallFunction(uint8_t type, msafe_struct *mstruct); void msafe_DoPowerup(msafe_struct *mstruct); // Gets a value for the calling party @@ -32,7 +32,7 @@ void msafe_GetValue(int type, msafe_struct *mstruct); // MULTPLAYER SPECIFIC STUFF // MULTISAFE FUNCTIONS -void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct); +void MultiSendMSafeFunction(uint8_t type, msafe_struct *mstruct); void MultiSendMSafePowerup(msafe_struct *mstruct); #endif diff --git a/Descent3/multisafe_server.cpp b/Descent3/multisafe_server.cpp index d974a626..9b4a4fd6 100644 --- a/Descent3/multisafe_server.cpp +++ b/Descent3/multisafe_server.cpp @@ -54,13 +54,13 @@ int VerifyMSafeObject(int objnum) { // this bool tells msafe if it's ok to process a call even though it's playing back a demo. bool Demo_call_ok = false; // Extracts the multisafe function to be executed on the client machine -void MultiDoMSafeFunction(ubyte *data) { +void MultiDoMSafeFunction(uint8_t *data) { msafe_struct base_mstruct; msafe_struct *mstruct = &base_mstruct; int count = 0; SKIP_HEADER(data, &count); - ubyte type = MultiGetUbyte(data, &count); + uint8_t type = MultiGetUbyte(data, &count); switch (type) { case MSAFE_WEATHER_RAIN: mstruct->state = MultiGetByte(data, &count); @@ -507,14 +507,14 @@ void MultiDoMSafeFunction(ubyte *data) { } } -void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct) { +void MultiSendMSafeFunction(uint8_t type, msafe_struct *mstruct) { int sequence = -1; int to_slot = -1; uint32_t to_bitmask = 0xFFFFFFFF; ASSERT((Demo_flags == DF_RECORDING) || (Netgame.local_role == LR_SERVER)); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; @@ -1122,7 +1122,7 @@ void MultiSendMSafeFunction(ubyte type, msafe_struct *mstruct) { } // Resolves a powerup that the server is telling us about -void MultiDoMSafePowerup(ubyte *data) { +void MultiDoMSafePowerup(uint8_t *data) { int count = 0; msafe_struct base_mstruct; msafe_struct *mstruct = &base_mstruct; @@ -1151,7 +1151,7 @@ void MultiSendMSafePowerup(msafe_struct *mstruct) { // ASSERT (Netgame.local_role==LR_SERVER); - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int size_offset; diff --git a/Descent3/newui.cpp b/Descent3/newui.cpp index 31880479..a15ed7d1 100644 --- a/Descent3/newui.cpp +++ b/Descent3/newui.cpp @@ -484,7 +484,7 @@ void NewUIClose() { // DoWaitMessage(false); void DoWaitMessage(bool enable, const char *message) { static bool opened = false; - static ubyte cur_pos = 0; + static uint8_t cur_pos = 0; float curpos_f; // if (1) return; @@ -848,7 +848,7 @@ void DrawLargeBitmap(tLargeBitmap *bmp, int x, int y, float alpha) { /////////////////////////////////////////////////////////////////////////////// // Listbox procedure. -ubyte NewUIWindow_alpha = 192; +uint8_t NewUIWindow_alpha = 192; NewUIWindow::NewUIWindow() : UIWindow() {} diff --git a/Descent3/newui.h b/Descent3/newui.h index 250d6768..917905fd 100644 --- a/Descent3/newui.h +++ b/Descent3/newui.h @@ -299,7 +299,7 @@ typedef struct tLargeBitmap { } tLargeBitmap; // alpha for all NewUIWindows. -extern ubyte NewUIWindow_alpha; +extern uint8_t NewUIWindow_alpha; ////////////////////////////////////////////////////////////////////////////// // Core interface with UI system diff --git a/Descent3/newui_core.cpp b/Descent3/newui_core.cpp index 74d970e8..e4bd98d5 100644 --- a/Descent3/newui_core.cpp +++ b/Descent3/newui_core.cpp @@ -2198,7 +2198,7 @@ void newuiButton::OnDestroy() { } void newuiButton::OnDraw() { - ubyte alpha = IsDisabled() ? 128 : 255; + uint8_t alpha = IsDisabled() ? 128 : 255; if (GetStateItem(m_State)) { GetStateItem(m_State)->set_alpha(alpha); @@ -3130,7 +3130,7 @@ void newuiListBox::OnDraw() { // draw text? int i; - ubyte alpha = 255; + uint8_t alpha = 255; bool auto_select = ((m_Flags & UILB_AUTOSELECT) > 0); bool use_scroll = true; diff --git a/Descent3/object.cpp b/Descent3/object.cpp index 0a359016..4dff79f9 100644 --- a/Descent3/object.cpp +++ b/Descent3/object.cpp @@ -1210,7 +1210,7 @@ static short free_obj_list[MAX_OBJECTS]; object Objects[MAX_OBJECTS]; tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY]; -ubyte Object_position_head; +uint8_t Object_position_head; int16_t Object_map_position_history[MAX_OBJECTS]; short Object_map_position_free_slots[MAX_OBJECT_POS_HISTORY]; uint16_t Num_free_object_position_history; @@ -1680,7 +1680,7 @@ void ObjSetAABB(object *obj) { //----------------------------------------------------------------------------- // initialize a new object. adds to the list for the given room // returns the object number -int ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle) { +int ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle) { int objnum; object *obj; int handle; @@ -2398,7 +2398,7 @@ void DoFlyingControl(object *objp) { // Send an event to the Game DLLs so they can do any processing of game controls if (Game_mode & GM_MULTI) { DLLInfo.me_handle = DLLInfo.it_handle = objp->handle; - DLLInfo.special_data = (ubyte *)&controls; + DLLInfo.special_data = (uint8_t *)&controls; CallGameDLL(EVT_GAMEDOCONTROLS, &DLLInfo); } diff --git a/Descent3/object.h b/Descent3/object.h index 7b57654a..82f3bf63 100644 --- a/Descent3/object.h +++ b/Descent3/object.h @@ -741,7 +741,7 @@ void ObjSetAABB(object *obj); // initialize a new object. adds to the list for the given room // returns the object number -int ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, +int ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle = OBJECT_HANDLE_NONE); // remove object from the world @@ -824,7 +824,7 @@ typedef struct { vector pos[MAX_POSITION_HISTORY]; } tPosHistory; extern tPosHistory Object_position_samples[MAX_OBJECT_POS_HISTORY]; -extern ubyte Object_position_head; +extern uint8_t Object_position_head; extern int16_t Object_map_position_history[MAX_OBJECTS]; extern float Last_position_history_update[MAX_POSITION_HISTORY]; // last gametime the positions were updated void ObjInitPositionHistory(object *obj); diff --git a/Descent3/object_lighting.cpp b/Descent3/object_lighting.cpp index f56c38a1..91f4be0c 100644 --- a/Descent3/object_lighting.cpp +++ b/Descent3/object_lighting.cpp @@ -156,7 +156,7 @@ void FindPlayerThrusterColor(int slot, float *r, float *g, float *b) { Int3(); // No thruster glow? } -ubyte EasterEgg = 0; +uint8_t EasterEgg = 0; #define EASTER_EGG_TIMER (3600 * 4) void ReflectRay(vector *, vector *, vector *); diff --git a/Descent3/objinfo.h b/Descent3/objinfo.h index f34f3951..c4c99660 100644 --- a/Descent3/objinfo.h +++ b/Descent3/objinfo.h @@ -373,7 +373,7 @@ typedef struct { short from, to; float spc; int anim_sound_index; - ubyte used; + uint8_t used; } anim_entry; typedef struct { @@ -500,7 +500,7 @@ typedef struct { // Death information death_info death_types[MAX_DEATH_TYPES]; // the ways this object can die - ubyte death_probabilities[MAX_DEATH_TYPES]; // how likely each death is, from 0-100 (percent) + uint8_t death_probabilities[MAX_DEATH_TYPES]; // how likely each death is, from 0-100 (percent) // Valid for AI objects only t_ai_info *ai_info; // the AI info for this obj type diff --git a/Descent3/osiris_dll.h b/Descent3/osiris_dll.h index c8180573..80c0720a 100644 --- a/Descent3/osiris_dll.h +++ b/Descent3/osiris_dll.h @@ -250,7 +250,7 @@ extern void Osiris_CancelTimer(int handle); // Osiris_TimerExists // Purpose: // Returns true if the timer is valid -extern ubyte Osiris_TimerExists(int handle); +extern uint8_t Osiris_TimerExists(int handle); // Osiris_SaveSystemState // Purpose: @@ -322,11 +322,11 @@ extern bool Show_osiris_debug; // Osiris_EnableEvents // Purpose: // Enables the passed in mask of event types to be called -extern void Osiris_EnableEvents(ubyte mask); +extern void Osiris_EnableEvents(uint8_t mask); // Osiris_DisableEvents // Purpose: // Disables the passed in mask of event types -extern void Osiris_DisableEvents(ubyte mask); +extern void Osiris_DisableEvents(uint8_t mask); // Osiris_DisableCreateEvents // Purpose: diff --git a/Descent3/osiris_predefs.cpp b/Descent3/osiris_predefs.cpp index 8ab00cb6..ec5653b8 100644 --- a/Descent3/osiris_predefs.cpp +++ b/Descent3/osiris_predefs.cpp @@ -585,7 +585,7 @@ int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags return GoalAddGoal(obj, AIG_FOLLOW_PATH, (void *)&path_info, slot, 1.0f, flags, guid); } -int osipf_AIPowerSwitch(int objhandle, ubyte f_power_on) { +int osipf_AIPowerSwitch(int objhandle, uint8_t f_power_on) { object *obj = ObjGet(objhandle); if (!obj) { mprintf((0, "Illegal Object passed to AIPowerSwitch\n")); @@ -1632,7 +1632,7 @@ void osipf_ObjectValue(int handle, char op, char var_handle, void *ptr, int inde } } -ubyte osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec) { +uint8_t osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec) { object *objp = ObjGet(objhandle); if (!objp) { @@ -2030,7 +2030,7 @@ float osipf_AIGetDistToObj(int objhandle, int otherobjhandle) { return dist; } -int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, ubyte f_enable) { +int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, uint8_t f_enable) { object *obj = ObjGet(objhandle); if (obj == NULL) { @@ -2101,7 +2101,7 @@ void osipf_GetGroundPos(int objhandle, int ground_number, vector *ground_pnt, ve PhysCalcGround(ground_pnt, ground_normal, obj, ground_number); } -ubyte osipf_IsRoomValid(int roomnum) { +uint8_t osipf_IsRoomValid(int roomnum) { if (roomnum == -1.0) { return 0; } else if (ROOMNUM_OUTSIDE(roomnum)) { @@ -2158,7 +2158,7 @@ int osipf_GetAttachChildHandle(int objhandle, char attachpoint) { return (OBJECT_HANDLE_NONE); } -int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, ubyte f_use_aligned) { +int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, uint8_t f_use_aligned) { object *parent = ObjGet(parenthandle); object *child = ObjGet(childhandle); @@ -2465,7 +2465,7 @@ int osipf_RayCast(int objhandle, vector *p0, vector *p1, int start_roomnum, floa // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -int osipf_CFReadBytes(ubyte *buffer, int count, CFILE *cfp) { return cf_ReadBytes(buffer, count, cfp); } +int osipf_CFReadBytes(uint8_t *buffer, int count, CFILE *cfp) { return cf_ReadBytes(buffer, count, cfp); } // The following functions read numeric vales from a CFILE. All values are // stored in the file in Intel (little-endian) format. These functions @@ -2509,7 +2509,7 @@ int osipf_CFReadString(char *buf, size_t n, CFILE *cfp) { return cf_ReadString(b // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -int osipf_CFWriteBytes(const ubyte *buf, int count, CFILE *cfp) { return cf_WriteBytes(buf, count, cfp); } +int osipf_CFWriteBytes(const uint8_t *buf, int count, CFILE *cfp) { return cf_WriteBytes(buf, count, cfp); } // Writes a null-terminated string to a file. If the file is type binary, // the string is terminated in the file with a null. If the file is type @@ -2567,7 +2567,7 @@ void osipf_OpenMessageWindow(const char *title, ...) { Int3(); // ummm, this is a blank function, should we ever be calling it? } -int osipf_ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, +int osipf_ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, vector *initial_velocity) { object *obj; int objnum; @@ -2792,7 +2792,7 @@ void osipf_ObjWBValue(int obj_handle, char wb_index, char op, char vtype, void * // Sets/Clears mission flags // flag is which mission flag to set/clear (1-32) // value is 0 to clear, or 1 to set -void osipf_MissionFlagSet(int flag, ubyte value) { +void osipf_MissionFlagSet(int flag, uint8_t value) { if (flag < 1 && flag > 32) { mprintf((0, "Invalid flag passed to osipf_MissionFlagSet(%d)\n", flag)); return; @@ -2901,7 +2901,7 @@ void osipf_CFclose(CFILE *file) { cfclose(file); } int osipf_CFtell(CFILE *file) { return cftell(file); } -ubyte osipf_CFeof(CFILE *file) { return (cfeof(file) != 0) ? 1 : 0; } +uint8_t osipf_CFeof(CFILE *file) { return (cfeof(file) != 0) ? 1 : 0; } void osipf_SoundStop(int s_handle, bool f_immediately) { // JEFF - sorry, this can't be made multiplayer friendly diff --git a/Descent3/osiris_predefs.h b/Descent3/osiris_predefs.h index 0cc362e7..89fc29a7 100644 --- a/Descent3/osiris_predefs.h +++ b/Descent3/osiris_predefs.h @@ -204,7 +204,7 @@ void osipf_GetGunPos(int objhandle, int gun_number, vector *gun_pnt, vector *gun // Returns room values (Index is optional and not always used) void osipf_RoomValue(int roomnum, char op, char vhandle, void *ptr, int index = 0); -ubyte osipf_IsRoomValid(int roomnum); +uint8_t osipf_IsRoomValid(int roomnum); // Returns player only values (Index is optional and not always used) void osipf_PlayerValue(int obj_handle, char op, char vhandle, void *ptr, int index = 0); @@ -214,7 +214,7 @@ void osipf_ObjectCustomAnim(int handle, float start, float end, float time, char int osipf_GetAttachParent(int childhandle); int osipf_GetNumAttachSlots(int objhandle); int osipf_GetAttachChildHandle(int objhandle, char attachpoint); -int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, ubyte f_use_aligned); +int osipf_AttachObjectAP(int parenthandle, char parent_ap, int childhandle, char child_ap, uint8_t f_use_aligned); int osipf_AttachObjectRad(int parenthandle, char parent_ap, int childhandle, float percent_rad); void osipf_UnattachFromParent(int objhandle); void osipf_UnattachChild(int objhandle, char parent_ap); @@ -233,19 +233,19 @@ int osipf_AIFindEnergyCenter(int objhandle); float osipf_AIGetDistToObj(int objhandle, int otherobjhandle); void osipf_AISetType(int objhandle, int type); -int osipf_AIPowerSwitch(int objhandle, ubyte f_power_on); +int osipf_AIPowerSwitch(int objhandle, uint8_t f_power_on); int osipf_AIGoalAdd(int objhandle, int goal_type, int level, float influence, int guid, int flags, ...); int osipf_AIGoalAddEnabler(int objhandle, int goal_index, int enabler_type, float percent, float interval, void *ptr); void osipf_AIGoalClear(int objhandle, int goal_index); int osipf_AIGoalFollowPathSimple(int objhandle, int path_id, int guid, int flags, int slot = 3); void osipf_AISetGoalCircleDist(int objhandle, int goal_handle, float dist); -int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, ubyte f_enable); +int osipf_AISetGoalFlags(int objhandle, int goal_handle, int flags, uint8_t f_enable); -ubyte osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec); -ubyte osipf_AIMoveTowardsPosition(int objhandle, vector *pos, int *roomnum, float scalar, bool f_bline, +uint8_t osipf_AITurnTowardsVectors(int objhandle, vector *fvec, vector *uvec); +uint8_t osipf_AIMoveTowardsPosition(int objhandle, vector *pos, int *roomnum, float scalar, bool f_bline, bool f_bline_if_vis); -ubyte osipf_AIMoveTowardsDir(int objhandle, vector *dir, float scalar); +uint8_t osipf_AIMoveTowardsDir(int objhandle, vector *dir, float scalar); void osipf_AIValue(int objhandle, char op, char vtype, void *ptr); @@ -254,7 +254,7 @@ void osipf_AIValue(int objhandle, char op, char vtype, void *ptr); // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -int osipf_CFReadBytes(ubyte *buffer, int count, CFILE *cfp); +int osipf_CFReadBytes(uint8_t *buffer, int count, CFILE *cfp); // The following functions read numeric vales from a CFILE. All values are // stored in the file in Intel (little-endian) format. These functions @@ -298,7 +298,7 @@ int osipf_CFReadString(char *buf, size_t n, CFILE *cfp); // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -int osipf_CFWriteBytes(const ubyte *buf, int count, CFILE *cfp); +int osipf_CFWriteBytes(const uint8_t *buf, int count, CFILE *cfp); // Writes a null-terminated string to a file. If the file is type binary, // the string is terminated in the file with a null. If the file is type @@ -341,7 +341,7 @@ void osipf_SetAllControls(bool enabled); void osipf_SetControls(int fn, bool enabled); // Creates an object -int osipf_ObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, +int osipf_ObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, int parent_handle = OBJECT_HANDLE_NONE, vector *velocity = NULL); // OBJECT Properties. @@ -363,7 +363,7 @@ int osipf_MatcenFindId(char *str); // Sets/Clears mission flags // flag is which mission flag to set/clear (1-32) // value is 0 to clear, or 1 to set -void osipf_MissionFlagSet(int flag, ubyte value); +void osipf_MissionFlagSet(int flag, uint8_t value); // Gets a mission flag // flag is what mission flag to get. Returns 1 if set, 0 if not. @@ -384,7 +384,7 @@ void osipf_CFclose(CFILE *file); int osipf_CFtell(CFILE *file); // returns 1 if the file is at the EOF, else 0 (like feof()) -ubyte osipf_CFeof(CFILE *file); +uint8_t osipf_CFeof(CFILE *file); void osipf_SoundStop(int s_handle, bool f_immediately = false); int osipf_SoundPlay2d(int obj_handle, int s_id, float volume = 1.0f); diff --git a/Descent3/pilot.cpp b/Descent3/pilot.cpp index 263a791f..8a5a9a29 100644 --- a/Descent3/pilot.cpp +++ b/Descent3/pilot.cpp @@ -649,7 +649,7 @@ // Game global for current pilot pilot Current_pilot; char Default_pilot[_MAX_PATH] = {" "}; -ubyte ingame_difficulty = 1; +uint8_t ingame_difficulty = 1; /////////////////////////////////////////////// // Internals (Globals for the file) @@ -866,7 +866,7 @@ void PilotListSelectChangeCallback(int index) { pilot *Pilot = &working_pilot; char name[PILOT_STRING_SIZE]; - ubyte difficulty; + uint8_t difficulty; bool profanity, audiotaunts; bool in_edit = false; @@ -1307,7 +1307,7 @@ bool PilotCreate(pilot *Pilot, bool forceselection) { for (int id = 0; id < NUM_CONTROLLER_FUNCTIONS; id++) { ct_type type[2]; ct_config_data value; - ubyte flags[2]; + uint8_t flags[2]; Controller->get_controller_function(Controller_needs[id].id, type, &value, flags); Pilot->controls[id].id = Controller_needs[id].id; Pilot->controls[id].type[0] = type[0]; @@ -1472,7 +1472,7 @@ bool PilotCopy(pilot *Src,pilot *Dest) { char sname[PILOT_STRING_SIZE]; char sship[PAGENAME_LEN]; - ubyte sdiff; + uint8_t sdiff; Src->get_name(sname); Src->get_ship(sship); @@ -3912,8 +3912,8 @@ clean_up: // "Current Pilot" access functions void dCurrentPilotName(char *buffer) { Current_pilot.get_name(buffer); } -ubyte dCurrentPilotDifficulty(void) { - ubyte d; +uint8_t dCurrentPilotDifficulty(void) { + uint8_t d; Current_pilot.get_difficulty(&d); return d; } @@ -3923,7 +3923,7 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) { char filename[_MAX_PATH]; char pfilename[_MAX_FNAME]; char buffer[256]; - ubyte temp_b; + uint8_t temp_b; ushort temp_s; int temp_i; int filever, i, nctlfuncs; @@ -4025,7 +4025,7 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) { } length = cf_ReadByte(file); if (length) { - cf_ReadBytes((ubyte *)dummy, length, file); + cf_ReadBytes((uint8_t *)dummy, length, file); } } } @@ -4061,8 +4061,8 @@ void _ReadOldPilotFile(pilot *Pilot, bool keyconfig, bool missiondata) { // new flags for each controller item. if (filever >= 0xb) { - Pilot->controls[y].flags[0] = (ubyte)cf_ReadByte(file); - Pilot->controls[y].flags[1] = (ubyte)cf_ReadByte(file); + Pilot->controls[y].flags[0] = (uint8_t)cf_ReadByte(file); + Pilot->controls[y].flags[1] = (uint8_t)cf_ReadByte(file); } if (keyconfig) diff --git a/Descent3/pilot.h b/Descent3/pilot.h index 40dc77da..bf28b32e 100644 --- a/Descent3/pilot.h +++ b/Descent3/pilot.h @@ -210,12 +210,12 @@ typedef struct int id; ct_type type[2]; ct_config_data value; - ubyte flags[2]; + uint8_t flags[2]; } cntrldata; typedef struct { - ubyte highest_level; + uint8_t highest_level; bool finished; // was mission finished? (different than highest level,btw) char mission_name[MSN_NAMELEN]; } tMissionData; @@ -243,7 +243,7 @@ typedef struct ushort hud_stat; ushort hud_graphical_stat; // hud display mode - ubyte hud_mode; + uint8_t hud_mode; // do we read the controller port also (beyond keyboard/mouse) char read_controller; // axis sensitivities @@ -334,7 +334,7 @@ extern char Default_pilot[_MAX_PATH]; // "Current Pilot" access functions void dCurrentPilotName(char *buffer); -ubyte dCurrentPilotDifficulty(void); +uint8_t dCurrentPilotDifficulty(void); void IncrementPilotRestoredGamesForMission(pilot *Pilot, const char *mission_name); void IncrementPilotSavedGamesForMission(pilot *Pilot, const char *mission_name); diff --git a/Descent3/pilot_class.cpp b/Descent3/pilot_class.cpp index abba05e2..3da96561 100644 --- a/Descent3/pilot_class.cpp +++ b/Descent3/pilot_class.cpp @@ -203,7 +203,7 @@ void pilot::initialize(void) { guidebot_name = mem_strdup("GB"); picture_id = PPIC_INVALID_ID; difficulty = DIFFICULTY_ROOKIE; - hud_mode = (ubyte)HUD_COCKPIT; + hud_mode = (uint8_t)HUD_COCKPIT; hud_stat = 0; hud_graphical_stat = STAT_STANDARD; game_window_w = Video_res_list[Game_video_resolution].width; @@ -793,11 +793,11 @@ void pilot::get_multiplayer_data(char *logo, char *audio1, char *audio2, ushort } } -void pilot::set_difficulty(ubyte diff) { +void pilot::set_difficulty(uint8_t diff) { difficulty = diff; write_pending = true; } -void pilot::get_difficulty(ubyte *diff) { +void pilot::get_difficulty(uint8_t *diff) { if (diff) { *diff = difficulty; } @@ -848,7 +848,7 @@ void pilot::get_guidebot_name(char *name) { } } -void pilot::set_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) { +void pilot::set_hud_data(uint8_t *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) { if (hmode) { // should do checking here switch (*hmode) { @@ -882,7 +882,7 @@ void pilot::set_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, in write_pending = true; } } -void pilot::get_hud_data(ubyte *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) { +void pilot::get_hud_data(uint8_t *hmode, ushort *hstat, ushort *hgraphicalstat, int *gw_w, int *gw_h) { if (hmode) { *hmode = hud_mode; } @@ -1142,7 +1142,7 @@ void pilot::read_custom_multiplayer_data(CFILE *file, bool skip) { void pilot::write_difficulty(CFILE *file) { cf_WriteByte(file, difficulty); } void pilot::read_difficulty(CFILE *file, bool skip) { - ubyte temp; + uint8_t temp; temp = cf_ReadByte(file); if (!skip) { @@ -1213,7 +1213,7 @@ void pilot::write_hud_data(CFILE *file) { } void pilot::read_hud_data(CFILE *file, bool skip) { - ubyte temp_b; + uint8_t temp_b; ushort temp_s; int temp_i; @@ -1276,7 +1276,7 @@ void pilot::write_mission_data(CFILE *file) { void pilot::read_mission_data(CFILE *file, bool skip) { int temp_i, i, temp_perm; - ubyte temp_b1, temp_b2; + uint8_t temp_b1, temp_b2; int temp_restores = 0, temp_saves = 0; char temp_s[MSN_NAMELEN]; @@ -1398,7 +1398,7 @@ void pilot::write_controls(CFILE *file) { void pilot::read_controls(CFILE *file, bool skip) { float temp_f; - ubyte temp_b; + uint8_t temp_b; int i; // Controller data @@ -1433,8 +1433,8 @@ void pilot::read_controls(CFILE *file, bool skip) { controls[y].type[0] = type[0]; controls[y].type[1] = type[1]; controls[y].value = value; - controls[y].flags[0] = (ubyte)cf_ReadByte(file); - controls[y].flags[1] = (ubyte)cf_ReadByte(file); + controls[y].flags[0] = (uint8_t)cf_ReadByte(file); + controls[y].flags[1] = (uint8_t)cf_ReadByte(file); if (!skip) Controller->set_controller_function(controls[y].id, controls[y].type, controls[y].value, controls[y].flags); @@ -1519,13 +1519,13 @@ void pilot::read_weapon_select(CFILE *file) { } void pilot::read_gameplay_toggles(CFILE *file, bool skip) { - ubyte count, i; + uint8_t count, i; bool toggles[16]; for (i = 0; i < 16; i++) toggles[i] = false; - count = (ubyte)cf_ReadByte(file); + count = (uint8_t)cf_ReadByte(file); if (count > 16) { Int3(); count = 16; diff --git a/Descent3/pilot_class.h b/Descent3/pilot_class.h index 755dacd5..264256a4 100644 --- a/Descent3/pilot_class.h +++ b/Descent3/pilot_class.h @@ -150,7 +150,7 @@ IIIIIIIII N N P OOOO R R T A A NN NN T #define PLTR_TOO_NEW 6 // pilot file too new typedef struct { - ubyte highest_level; // highlest level completed in the mission + uint8_t highest_level; // highlest level completed in the mission int ship_permissions; // Ship permissions at highest level achieved bool finished; // was mission finished? (different than highest level,btw) char mission_name[MSN_NAMELEN]; // name of the mission (from the mission file) @@ -162,7 +162,7 @@ typedef struct { int id; ct_type type[2]; ct_config_data value; - ubyte flags[2]; + uint8_t flags[2]; } cntrldata; class pilot { @@ -213,12 +213,12 @@ public: void get_multiplayer_data(char *logo = NULL, char *audio1 = NULL, char *audio2 = NULL, ushort *ppic = NULL, char *audio3 = NULL, char *audio4 = NULL); - void set_difficulty(ubyte diff); - void get_difficulty(ubyte *diff); + void set_difficulty(uint8_t diff); + void get_difficulty(uint8_t *diff); - void set_hud_data(ubyte *hmode = NULL, ushort *hstat = NULL, ushort *hgraphicalstat = NULL, int *gw_w = NULL, + void set_hud_data(uint8_t *hmode = NULL, ushort *hstat = NULL, ushort *hgraphicalstat = NULL, int *gw_w = NULL, int *gw_h = NULL); - void get_hud_data(ubyte *hmode = NULL, ushort *hstat = NULL, ushort *hgraphicalstat = NULL, int *gw_w = NULL, + void get_hud_data(uint8_t *hmode = NULL, ushort *hstat = NULL, ushort *hgraphicalstat = NULL, int *gw_w = NULL, int *gw_h = NULL); void set_profanity_filter(bool enable); @@ -285,8 +285,8 @@ private: char *guidebot_name; // guidebot name ushort picture_id; // pilot picture image id - ubyte difficulty; // difficulty setting for this pilot (DIFFICULTY_*) - ubyte hud_mode; // hud display mode + uint8_t difficulty; // difficulty setting for this pilot (DIFFICULTY_*) + uint8_t hud_mode; // hud display mode bool profanity_filter_on, audiotaunts; ushort hud_stat; // hud layout using the STAT mask @@ -314,7 +314,7 @@ public: bool lrearview_enabled; bool rrearview_enabled; // are these small views enabled? - ubyte ingame_difficulty; // DAJ for optimization + uint8_t ingame_difficulty; // DAJ for optimization }; #endif diff --git a/Descent3/postrender.h b/Descent3/postrender.h index 116c024c..919a245c 100644 --- a/Descent3/postrender.h +++ b/Descent3/postrender.h @@ -26,7 +26,7 @@ #define PRT_WALL 2 typedef struct { - ubyte type; // See types above + uint8_t type; // See types above union { short objnum; short visnum; diff --git a/Descent3/procedurals.cpp b/Descent3/procedurals.cpp index 03c61117..8de4c334 100644 --- a/Descent3/procedurals.cpp +++ b/Descent3/procedurals.cpp @@ -75,16 +75,16 @@ static short Proc_free_list[MAX_PROC_ELEMENTS]; ushort ProcFadeTable[32768]; #define NUM_WATER_SHADES 64 ushort WaterProcTableHi[NUM_WATER_SHADES][256]; -ubyte WaterProcTableLo[NUM_WATER_SHADES][256]; +uint8_t WaterProcTableLo[NUM_WATER_SHADES][256]; const char *ProcNames[] = {"None", "Line Lightning", "Sphere lightning", "Straight", "Rising Embers", "Random Embers", "Spinners", "Roamers", "Fountain", "Cone", "Fall Right", "Fall Left", "END"}; const char *WaterProcNames[] = {"None", "Height blob", "Sine Blob", "Random Raindrops", "Random Blobdrops", "END"}; -static ubyte *ProcDestData; +static uint8_t *ProcDestData; int pholdrand = 1; static inline int prand() { return (((pholdrand = pholdrand * 214013L + 2531011L) >> 16) & 0x7fff); } // Given an array of r,g,b values, generates a 16bit palette table for those colors -void GeneratePaletteForProcedural(ubyte *r, ubyte *g, ubyte *b, ushort *pal) { +void GeneratePaletteForProcedural(uint8_t *r, uint8_t *g, uint8_t *b, ushort *pal) { int i; float fr, fg, fb; for (i = 0; i < 256; i++) { @@ -145,7 +145,7 @@ float GradNoise(float x, float y) { return LERP(wy, vy0, vy1); } -extern ubyte EasterEgg; +extern uint8_t EasterEgg; int Easter_egg_handle = -1; // Goes through our array and clears the slots out void InitProcedurals() { @@ -272,11 +272,11 @@ int ProcElementFree(int index) { return 1; } // Draws a line into the passed in bitmap -void DrawProceduralLine(int x1, int y1, int x2, int y2, ubyte color) { +void DrawProceduralLine(int x1, int y1, int x2, int y2, uint8_t color) { int DY, DX; int i, x, y, yinc = 1, xinc = 1, error_term; - ubyte *surface_ptr = ProcDestData; + uint8_t *surface_ptr = ProcDestData; int xmask = PROC_SIZE - 1; int ymask = PROC_SIZE - 1; @@ -338,7 +338,7 @@ void DrawProceduralLine(int x1, int y1, int x2, int y2, ubyte color) { // Fades an entire bitmap one step closer to black void FadeProcTexture(int tex_handle) { int total = PROC_SIZE * PROC_SIZE; - ubyte *src_data = ProcDestData; + uint8_t *src_data = ProcDestData; int fadeval; fadeval = 255 - GameTextures[tex_handle].procedural->heat; fadeval >>= 3; @@ -357,9 +357,9 @@ void FadeProcTexture(int tex_handle) { // Heats an entire bitmap void HeatProcTexture(int tex_handle) { int total = PROC_SIZE * PROC_SIZE; - ubyte *src_data = ProcDestData; - ubyte val; - ubyte heat = GameTextures[tex_handle].procedural->heat; + uint8_t *src_data = ProcDestData; + uint8_t val; + uint8_t heat = GameTextures[tex_handle].procedural->heat; val = 255 - heat; for (int i = 0; i < total; i++, src_data++) { @@ -371,12 +371,12 @@ void HeatProcTexture(int tex_handle) { // Fades and entire bitmap one step closer to black void BlendProcTexture(int tex_handle) { int total = PROC_SIZE * PROC_SIZE; - ubyte *src_data = (ubyte *)GameTextures[tex_handle].procedural->proc1; - ubyte *dest_data = (ubyte *)GameTextures[tex_handle].procedural->proc2; - ubyte *start_data = src_data; + uint8_t *src_data = (uint8_t *)GameTextures[tex_handle].procedural->proc1; + uint8_t *dest_data = (uint8_t *)GameTextures[tex_handle].procedural->proc2; + uint8_t *start_data = src_data; for (int i = 0; i < PROC_SIZE; i++) { - ubyte *downrow; - ubyte *start_row = src_data; + uint8_t *downrow; + uint8_t *start_row = src_data; // Get row underneath if (i != PROC_SIZE - 1) downrow = src_data + PROC_SIZE; @@ -404,7 +404,7 @@ void BlendProcTexture(int tex_handle) { } } // Draws lightning into a bitmap -void AddProcLightning(int x1, int y1, int x2, int y2, ubyte color, static_proc_element *proc) { +void AddProcLightning(int x1, int y1, int x2, int y2, uint8_t color, static_proc_element *proc) { float dx = x2 - x1; float dy = y2 - y1; @@ -470,7 +470,7 @@ void ClearAllProceduralsFromTexture(int texnum) { GameTextures[texnum].procedural->num_static_elements = 0; } // Adds one point to a bitmap -void AddProcPoint(int x, int y, ubyte color) { +void AddProcPoint(int x, int y, uint8_t color) { x &= (PROC_SIZE - 1); y &= (PROC_SIZE - 1); @@ -478,7 +478,7 @@ void AddProcPoint(int x, int y, ubyte color) { ProcDestData[index] = color; } // Adds one point to a bitmap -static inline void PlaceProcPoint(int x, int y, ubyte color) { +static inline void PlaceProcPoint(int x, int y, uint8_t color) { x &= (PROC_SIZE - 1); y &= (PROC_SIZE - 1); ProcDestData[y * PROC_SIZE + x] = color; @@ -1050,11 +1050,11 @@ void AddProcRaindrops(static_proc_element *proc, int handle) { int procnum = proc - GameTextures[handle].procedural->static_proc_elements; if (proc->frequency && ((FrameCount + procnum) % proc->frequency)) return; - ubyte proc_frequency = proc->frequency; - ubyte proc_size = proc->size; - ubyte proc_speed = proc->speed; - ubyte x1 = proc->x1; - ubyte y1 = proc->y1; + uint8_t proc_frequency = proc->frequency; + uint8_t proc_size = proc->size; + uint8_t proc_speed = proc->speed; + uint8_t x1 = proc->x1; + uint8_t y1 = proc->y1; proc->frequency = 0; proc->size = (ps_rand() % 3) + 1; proc->speed = std::max(0, proc_speed + ((ps_rand() % 10) - 5)); @@ -1071,11 +1071,11 @@ void AddProcBlobdrops(static_proc_element *proc, int handle) { int procnum = proc - GameTextures[handle].procedural->static_proc_elements; if (proc->frequency && ((FrameCount + procnum) % proc->frequency)) return; - ubyte proc_frequency = proc->frequency; - ubyte proc_size = proc->size; - ubyte proc_speed = proc->speed; - ubyte x1 = proc->x1; - ubyte y1 = proc->y1; + uint8_t proc_frequency = proc->frequency; + uint8_t proc_size = proc->size; + uint8_t proc_speed = proc->speed; + uint8_t x1 = proc->x1; + uint8_t y1 = proc->y1; proc->frequency = 0; proc->size = (ps_rand() % 6) + 4; proc->speed = std::max(0, proc_speed + ((ps_rand() % 50) - 25)); @@ -1236,11 +1236,11 @@ void AllocateMemoryForFireProcedural(int handle) { mem_free(procedural->proc1); if (procedural->proc2) mem_free(procedural->proc2); - GameTextures[handle].procedural->proc1 = (ubyte *)mem_malloc(w * h * 1); + GameTextures[handle].procedural->proc1 = (uint8_t *)mem_malloc(w * h * 1); ASSERT(GameTextures[handle].procedural->proc1); memset(GameTextures[handle].procedural->proc1, 0, w * h * 1); - GameTextures[handle].procedural->proc2 = (ubyte *)mem_malloc(w * h * 1); + GameTextures[handle].procedural->proc2 = (uint8_t *)mem_malloc(w * h * 1); ASSERT(GameTextures[handle].procedural->proc2); memset(GameTextures[handle].procedural->proc2, 0, w * h * 1); procedural->memory_type = PROC_MEMORY_TYPE_FIRE; @@ -1252,7 +1252,7 @@ void EvaluateFireProcedural(int handle) { if (procedural->memory_type != PROC_MEMORY_TYPE_FIRE) { AllocateMemoryForFireProcedural(handle); } - ProcDestData = (ubyte *)procedural->proc1; + ProcDestData = (uint8_t *)procedural->proc1; // fade and the current texture FadeProcTexture(handle); // HeatProcTexture (handle); @@ -1332,7 +1332,7 @@ void EvaluateFireProcedural(int handle) { // blend the current texture BlendProcTexture(handle); - ProcDestData = (ubyte *)procedural->proc2; + ProcDestData = (uint8_t *)procedural->proc2; int total = PROC_SIZE * PROC_SIZE; ushort *data = bm_data(dest_bitmap, 0); ushort *pal = procedural->palette; @@ -1340,7 +1340,7 @@ void EvaluateFireProcedural(int handle) { *data = pal[*ProcDestData]; } // Swap for next time - ubyte *temp = (ubyte *)procedural->proc1; + uint8_t *temp = (uint8_t *)procedural->proc1; procedural->proc1 = procedural->proc2; procedural->proc2 = temp; } diff --git a/Descent3/procedurals.h b/Descent3/procedurals.h index 456c3864..46c7034a 100644 --- a/Descent3/procedurals.h +++ b/Descent3/procedurals.h @@ -46,13 +46,13 @@ #define PROC_WATER_BLOBDROPS 4 typedef struct { - ubyte type; + uint8_t type; fix dx, dy; - ubyte frames_left; - ubyte speed; - ubyte color; + uint8_t frames_left; + uint8_t speed; + uint8_t color; - ubyte size; + uint8_t size; fix x1, y1; @@ -92,6 +92,6 @@ int ProcElementAllocate(); int ProcElementFree(int index); // Given an array of r,g,b values, generates a 16bit palette table for those colors -void GeneratePaletteForProcedural(ubyte *r, ubyte *g, ubyte *b, ushort *pal); +void GeneratePaletteForProcedural(uint8_t *r, uint8_t *g, uint8_t *b, ushort *pal); #endif diff --git a/Descent3/program.cpp b/Descent3/program.cpp index 2bbc92f5..4292369e 100644 --- a/Descent3/program.cpp +++ b/Descent3/program.cpp @@ -69,7 +69,7 @@ program_version Program_version; // Initializes the current program state -void ProgramVersion(int version_type, ubyte major, ubyte minor, ubyte build) { +void ProgramVersion(int version_type, uint8_t major, uint8_t minor, uint8_t build) { #if defined(WIN32) // I'm sorry. Samir oeWin32AppDatabase dbase((oeWin32AppDatabase *)Database); #elif defined(__LINUX__) diff --git a/Descent3/program.h b/Descent3/program.h index e679a182..f34ef1ae 100644 --- a/Descent3/program.h +++ b/Descent3/program.h @@ -167,7 +167,7 @@ typedef struct t_program_version { int version_type; - ubyte major, minor, build; + uint8_t major, minor, build; bool debug : 1; // are we in debug mode bool beta : 1; // are we in beta testing mode bool release : 1; // are we a final release candidate @@ -183,6 +183,6 @@ extern program_version Program_version; #define PROGRAM(_c) Program_version._c // functions -void ProgramVersion(int version_type, ubyte major, ubyte minor, ubyte build); +void ProgramVersion(int version_type, uint8_t major, uint8_t minor, uint8_t build); #endif diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 25fdc8e9..1e7e9d5b 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -83,9 +83,9 @@ void RotateRoomPoints(room *rp, vector4 *world_vecs); static int Faces_rendered = 0; extern float GetFPS(); -extern ubyte Outline_release_mode; +extern uint8_t Outline_release_mode; // 3d point for each vertex for use during rendering a room -ubyte Room_clips[MAX_VERTS_PER_ROOM]; // used for face culling +uint8_t Room_clips[MAX_VERTS_PER_ROOM]; // used for face culling // default face reflectivity float Face_reflectivity = 0.5; // the position of the viewer - valid while a frame is being rendered @@ -114,8 +114,8 @@ int No_render_windows_hack = -1; #else // ifdef _DEBUG // If true, draw white outline for each polygon int Render_portals = 0; -ubyte Outline_mode = 0; -ubyte Shell_render_flag = 0; +uint8_t Outline_mode = 0; +uint8_t Shell_render_flag = 0; bool Outline_alpha = 0; bool Outline_lightmaps = 0; bool Render_floating_triggers = 0; @@ -147,7 +147,7 @@ int Clear_window = 2; // 1 = Clear whole background window, 2 = clear view porta char Rooms_visited[MAX_ROOMS + MAX_PALETTE_ROOMS]; int Facing_visited[MAX_ROOMS + MAX_PALETTE_ROOMS]; // For keeping track of portal recursion -ubyte Room_depth_list[MAX_ROOMS + MAX_PALETTE_ROOMS]; +uint8_t Room_depth_list[MAX_ROOMS + MAX_PALETTE_ROOMS]; short Render_list[MAX_RENDER_ROOMS]; short External_room_list[MAX_ROOMS]; int N_external_rooms; @@ -177,8 +177,8 @@ short Fog_faces[MAX_FACES_PER_ROOM]; int Num_fog_faces_to_render = 0; #define MAX_EXTERNAL_ROOMS 100 vector External_room_corners[MAX_EXTERNAL_ROOMS][8]; -ubyte External_room_codes[MAX_EXTERNAL_ROOMS]; -ubyte External_room_project_net[MAX_EXTERNAL_ROOMS]; +uint8_t External_room_codes[MAX_EXTERNAL_ROOMS]; +uint8_t External_room_project_net[MAX_EXTERNAL_ROOMS]; // For light glows #define MAX_LIGHT_GLOWS 100 #define LGF_USED 1 @@ -190,7 +190,7 @@ typedef struct { float size; vector center; float scalar; - ubyte flags; + uint8_t flags; } light_glow; light_glow LightGlows[MAX_LIGHT_GLOWS]; light_glow LightGlowsThisFrame[MAX_LIGHT_GLOWS]; @@ -207,7 +207,7 @@ bool Render_mirror_for_room = false; int Mirror_room; int Num_mirrored_rooms; short Mirrored_room_list[MAX_ROOMS]; -ubyte Mirrored_room_checked[MAX_ROOMS]; +uint8_t Mirrored_room_checked[MAX_ROOMS]; short Mirror_rooms[MAX_ROOMS]; int Num_mirror_rooms = 0; // @@ -294,7 +294,7 @@ int first_terminal_room; void OutlineCurrentFace(room *rp, int facenum, int edgenum, int vertnum, ddgr_color face_color, ddgr_color edge_color) { face *fp = &rp->faces[facenum]; g3Point p0, p1; - ubyte c0, c1; + uint8_t c0, c1; int v; for (v = 0; v < fp->num_verts; v++) { c0 = g3_RotatePoint(&p0, &rp->verts[fp->face_verts[v]]); @@ -336,7 +336,7 @@ static void DrawPlacedRoomFace(room *rp, vector *rotpoint, matrix *rotmat, vecto face *fp = &rp->faces[facenum]; g3Point p0, p1; - ubyte c0, c1; + uint8_t c0, c1; int v; for (v = 0; v < fp->num_verts; v++) { vector tv; @@ -560,7 +560,7 @@ void MarkFacingFaces(int roomnum, vector *world_verts) { // Returns true if the external room is visible from the passed in portal int ExternalRoomVisibleFromPortal(int index, clip_wnd *wnd) { int i; - ubyte code = 0xff; + uint8_t code = 0xff; g3Point pnt; // This is a stupid hack to prevent really large buildings from popping in and out of view if (External_room_project_net[index]) @@ -658,10 +658,10 @@ void MarkFacesForRendering(int roomnum, clip_wnd *wnd) { int objnum; for (objnum = rp->objects; (objnum != -1); objnum = Objects[objnum].next) { object *obj = &Objects[objnum]; - ubyte anded = 0xff; + uint8_t anded = 0xff; g3Point pnts[8]; vector vecs[8]; - ubyte code; + uint8_t code; if (rp->flags & RF_DOOR) // Render all objects in a door room { obj->flags |= OF_SAFE_TO_RENDER; @@ -712,7 +712,7 @@ void RotateAllExternalRooms() { room *rp = &Rooms[roomnum]; MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); - ubyte andbyte = 0xff; + uint8_t andbyte = 0xff; g3Point pnt; External_room_codes[i] = 0xff; External_room_project_net[i] = 0; @@ -883,7 +883,7 @@ void BuildRoomListSub(int start_room_num, clip_wnd *wnd, int depth) { // First we must rotate and clip this polygon for (k = 0; k < this_fp->num_verts; k++) { - ubyte c = g3_RotatePoint(&Combined_portal_points[num_points + k], &rp->verts[this_fp->face_verts[k]]); + uint8_t c = g3_RotatePoint(&Combined_portal_points[num_points + k], &rp->verts[this_fp->face_verts[k]]); combine_cc.cc_or |= c; combine_cc.cc_and &= c; } @@ -967,7 +967,7 @@ void BuildRoomListSub(int start_room_num, clip_wnd *wnd, int depth) { for (i = 0; i < 4; i++) { Combined_portal_points[i] = four_points[i]; Combined_portal_points[i].p3_flags &= ~(PF_PROJECTED | PF_TEMP_POINT); - ubyte c = Combined_portal_points[i].p3_codes; + uint8_t c = Combined_portal_points[i].p3_codes; cc.cc_and &= c; cc.cc_or |= c; } @@ -976,7 +976,7 @@ void BuildRoomListSub(int start_room_num, clip_wnd *wnd, int depth) { for (i = 0; i < nv; i++) { g3_RotatePoint(&Combined_portal_points[i], &rp->verts[fp->face_verts[i]]); - ubyte c = Combined_portal_points[i].p3_codes; + uint8_t c = Combined_portal_points[i].p3_codes; cc.cc_and &= c; cc.cc_or |= c; } @@ -1654,7 +1654,7 @@ void RenderLightmapFace(room *rp, int facenum) { face *fp = &rp->faces[facenum]; g3Point *pointlist[MAX_VERTS_PER_FACE]; g3Point pointbuffer[MAX_VERTS_PER_FACE]; - ubyte face_code = 255; + uint8_t face_code = 255; if (NoLightmaps) return; if (fp->lmi_handle == BAD_LMI_INDEX) @@ -1732,7 +1732,7 @@ void RenderFace(room *rp, int facenum) { int bm_handle; float uchange = 0, vchange = 0; texture_type tt; - ubyte do_triangle_test = 0; + uint8_t do_triangle_test = 0; g3Codes face_cc; static int first = 1; static float lm_red[32], lm_green[32], lm_blue[32]; @@ -2707,7 +2707,7 @@ void BuildMirroredRoomListSub(int start_room_num, clip_wnd *wnd) { temp_vec = *vec - (*mirror_norm * (dist_from_mirror * 2)); g3_RotatePoint(&portal_points[i], &temp_vec); - ubyte c = portal_points[i].p3_codes; + uint8_t c = portal_points[i].p3_codes; cc.cc_and &= c; cc.cc_or |= c; } @@ -3028,7 +3028,7 @@ static inline void IsRoomDynamicValid(room *rp, int x, int y, int z, float *r, f int h = rp->volume_height; int d = rp->volume_depth; - ubyte color = rp->volume_lights[(z * w * h) + (y * w) + x]; + uint8_t color = rp->volume_lights[(z * w * h) + (y * w) + x]; *r = (float)((color >> 5) / 7.0); *g = (float)((color >> 2) & 0x07) / 7.0; @@ -3120,7 +3120,7 @@ void GetRoomDynamicScalar(vector *pos, room *rp, float *r, float *g, float *b) { (*g) *= Room_light_val; (*b) *= Room_light_val; } -ubyte Trick_type = 0; +uint8_t Trick_type = 0; // Render the objects and viseffects in a room. Do a simple sort void RenderRoomObjects(room *rp) { int n_objs = 0, objnum, i, visnum; @@ -3399,7 +3399,7 @@ void RenderRoomOutline(room *rp) { for (fn = 0; fn < rp->num_faces; fn++) { face *fp = &rp->faces[fn]; g3Point p0, p1; - ubyte c0, c1; + uint8_t c0, c1; int v; ddgr_color color; for (v = 0; v < fp->num_verts; v++) { diff --git a/Descent3/render.h b/Descent3/render.h index f404e915..4d7f3903 100644 --- a/Descent3/render.h +++ b/Descent3/render.h @@ -175,8 +175,8 @@ extern int Render_portals; extern bool Lighting_on; // If true, draw w/ normal lighting, else draw full brightness -extern ubyte Outline_mode; // Controls outline drawing. See constants below -extern ubyte Shell_render_flag; +extern uint8_t Outline_mode; // Controls outline drawing. See constants below +extern uint8_t Shell_render_flag; extern bool Render_floating_triggers; // If true, render the floating triggers extern bool Outline_lightmaps; extern bool Use_software_zbuffer; diff --git a/Descent3/renderobject.cpp b/Descent3/renderobject.cpp index 4fb4de31..e115662f 100644 --- a/Descent3/renderobject.cpp +++ b/Descent3/renderobject.cpp @@ -623,13 +623,13 @@ #define RO_STATIC 0 #define RO_GOURAUD 1 #define RO_LIGHTMAPS 2 -extern ubyte Use_motion_blur; -ubyte RenderObjectType = RO_STATIC; +extern uint8_t Use_motion_blur; +uint8_t RenderObjectType = RO_STATIC; float RenderObjectStaticRedValue = 1.0f; float RenderObjectStaticGreenValue = 1.0f; float RenderObjectStaticBlueValue = 1.0f; float RenderObjectStaticScalar = 1.0f; -ubyte *RenderObjectGouraudValue = NULL; +uint8_t *RenderObjectGouraudValue = NULL; lightmap_object *RenderObjectLightmapObject = NULL; vector RenderObject_LightDirection; @@ -998,11 +998,11 @@ void DrawShardObject(object *obj) { bool flip = 0; g3Point rotated_points[3]; g3Point *pointlist[3]; - ubyte codes_and = 0xff; + uint8_t codes_and = 0xff; g3_StartInstanceMatrix(&obj->pos, &obj->orient); // Build list of points and UVLs for this face for (int i = 0; i < 3; i++) { - ubyte c; + uint8_t c; g3Point *p = &rotated_points[i]; c = g3_RotatePoint(p, &si->points[i]); codes_and &= c; @@ -1779,7 +1779,7 @@ int Point_visible_last_frame = -1; // visible from the current view matrix int IsPointVisible(vector *pos, float size, float *pointz) { g3Point pnt; - ubyte ccode; + uint8_t ccode; static float last_render_fov = -1; static vector left_normal, right_normal, top_normal, bottom_normal, view_position; static matrix unscaled_matrix; @@ -2110,7 +2110,7 @@ void DrawPlayerTypingIndicator(object *obj) { int bmh, bmw; g3Point *pntlist[32], points[4]; g3Codes cc; - ubyte code; + uint8_t code; cc.cc_and = 0xFF; cc.cc_or = 0; diff --git a/Descent3/robotfirestruct.h b/Descent3/robotfirestruct.h index c532c990..5bdaa40e 100644 --- a/Descent3/robotfirestruct.h +++ b/Descent3/robotfirestruct.h @@ -34,10 +34,10 @@ typedef struct poly_wb_info { // Static Data (Add to robot generic page) uint16_t num_gps; - ubyte gp_index[MAX_WB_GUNPOINTS]; + uint8_t gp_index[MAX_WB_GUNPOINTS]; // Turrets are listed from most important (greatest mobility) to least important - ubyte num_turrets; + uint8_t num_turrets; uint16_t turret_index[MAX_WB_TURRETS]; } poly_wb_info; @@ -50,17 +50,17 @@ typedef struct otype_wb_info { uint16_t fm_fire_sound_index[MAX_WB_FIRING_MASKS]; uint16_t aiming_gp_index; - ubyte num_masks; - ubyte gp_fire_masks[MAX_WB_FIRING_MASKS]; + uint8_t num_masks; + uint8_t gp_fire_masks[MAX_WB_FIRING_MASKS]; float gp_fire_wait[MAX_WB_FIRING_MASKS]; - ubyte gp_quad_fire_mask; + uint8_t gp_quad_fire_mask; - ubyte num_levels; + uint8_t num_levels; uint16_t gp_level_weapon_index[MAX_WB_UPGRADES]; uint16_t gp_level_fire_sound_index[MAX_WB_UPGRADES]; - ubyte aiming_flags; + uint8_t aiming_flags; float aiming_3d_dot; // These can be reused. float aiming_3d_dist; float aiming_XZ_dot; @@ -87,9 +87,9 @@ typedef struct dynamic_wb_info { float norm_turret_angle[MAX_WB_TURRETS]; float turret_next_think_time[MAX_WB_TURRETS]; - ubyte turret_direction[MAX_WB_TURRETS]; + uint8_t turret_direction[MAX_WB_TURRETS]; - ubyte wb_anim_mask; + uint8_t wb_anim_mask; float wb_anim_frame; vector cur_target; diff --git a/Descent3/room.cpp b/Descent3/room.cpp index 434910a6..3d686091 100644 --- a/Descent3/room.cpp +++ b/Descent3/room.cpp @@ -466,8 +466,8 @@ int CountRoomFaceVerts(room *rp) { #endif // Vars for the room memory system -ubyte *Room_mem_buf = NULL; // pointer to the rooms block of memory -ubyte *Room_mem_ptr = NULL; // pointer to free memory in the rooms block +uint8_t *Room_mem_buf = NULL; // pointer to the rooms block of memory +uint8_t *Room_mem_ptr = NULL; // pointer to free memory in the rooms block int Room_mem_size; // How big our chunk is // Closes down the room memory system. @@ -495,7 +495,7 @@ void RoomMemInit(int nverts, int nfaces, int nfaceverts, int nportals) { if (Room_mem_buf) mem_free(Room_mem_buf); - Room_mem_buf = (ubyte *)mem_malloc(size); + Room_mem_buf = (uint8_t *)mem_malloc(size); Room_mem_size = size; Room_mem_ptr = Room_mem_buf; diff --git a/Descent3/room.h b/Descent3/room.h index 9708bb0d..ea5e4541 100644 --- a/Descent3/room.h +++ b/Descent3/room.h @@ -393,7 +393,7 @@ typedef struct { float start_depth, end_depth; float start_time; float total_time; - ubyte used; + uint8_t used; } room_changes; // diff --git a/Descent3/room_external.h b/Descent3/room_external.h index a5fbebd2..e561231a 100644 --- a/Descent3/room_external.h +++ b/Descent3/room_external.h @@ -131,13 +131,13 @@ typedef struct roomUVL { float u, v; // texture coordinates float u2, v2; - ubyte alpha; // alpha for this vertex + uint8_t alpha; // alpha for this vertex } roomUVL; // an n-sided polygon used as part of a room or portal typedef struct face { ushort flags; // flags for this face (see above) - ubyte num_verts; // how many vertices in this face + uint8_t num_verts; // how many vertices in this face int8_t portal_num; // which portal this face is part of, or -1 if none short *face_verts; // index into list of vertices for this face @@ -146,8 +146,8 @@ typedef struct face { short tmap; // texture numbers for this face ushort lmi_handle; // the lightmap info number for this face short special_handle; // the index into the special_faces array - ubyte renderframe; // what frame this face was last rendered (for lighting) - ubyte light_multiple; // what multiple to times by + uint8_t renderframe; // what frame this face was last rendered (for lighting) + uint8_t light_multiple; // what multiple to times by vector min_xyz, max_xyz; // min & max extents of this face (for FVI) } face; @@ -235,33 +235,33 @@ typedef struct room { short *num_bbf; vector *bbf_list_min_xyz; vector *bbf_list_max_xyz; - ubyte *bbf_list_sector; + uint8_t *bbf_list_sector; bn_list bn_info; short wpb_index; // world point buffer index - where this room starts - ubyte pulse_time; // each room can has a pulse time - ubyte pulse_offset; // each room has a timer offset for which it pulses + uint8_t pulse_time; // each room can has a pulse time + uint8_t pulse_offset; // each room has a timer offset for which it pulses vector wind; // Wind vector for the room int ambient_sound; // Index of ambient sound pattern for this room, or -1 if none short vis_effects; // index of first visual effect in this room short mirror_face; // Index of face that this room is to be mirrored by - ubyte num_mirror_faces; // Number of faces in this room that have the same texture as the mirror + uint8_t num_mirror_faces; // Number of faces in this room that have the same texture as the mirror ushort *mirror_faces_list; // the list of faces in this room that have the same texture as the mirror float damage; // The damage per second applied to players (& maybe others) in room vector path_pnt; // Point used by the path system - ubyte *volume_lights; // Pointer to memory for our volumetric lighting + uint8_t *volume_lights; // Pointer to memory for our volumetric lighting short volume_width; // The dimensions of our volumetric room short volume_height; short volume_depth; float fog_depth; // How far until fog is totally opaque float fog_r, fog_g, fog_b; // Fog color - ubyte env_reverb; // environmental reverb preset - ubyte room_change_flags; // For multiplayer, detects what characteristics have to be sent - ubyte damage_type; // What type of damage this rooms does (for sound) if damage > 0 - ubyte used; // is this room holding data? + uint8_t env_reverb; // environmental reverb preset + uint8_t room_change_flags; // For multiplayer, detects what characteristics have to be sent + uint8_t damage_type; // What type of damage this rooms does (for sound) if damage > 0 + uint8_t used; // is this room holding data? } room; diff --git a/Descent3/scorch.cpp b/Descent3/scorch.cpp index 065c8d4d..ec9c7d94 100644 --- a/Descent3/scorch.cpp +++ b/Descent3/scorch.cpp @@ -112,10 +112,10 @@ typedef struct { int roomface; // room number & face number combined into an int vector pos; // the position of the center of the scorch mark - ubyte handle_index; // which mark? + uint8_t handle_index; // which mark? int8_t rx, ry, rz; // right vector int8_t ux, uy, uz; // up vector - ubyte size; // floating-point size times 16 + uint8_t size; // floating-point size times 16 } scorch; // How many scorch marks diff --git a/Descent3/screens.cpp b/Descent3/screens.cpp index 66d95b88..58754893 100644 --- a/Descent3/screens.cpp +++ b/Descent3/screens.cpp @@ -467,7 +467,7 @@ void SinglePlayerPostLevelResults() { snprintf(PLRLevel, sizeof(PLRLevel), "%s", Level_info.name); snprintf(PLRText[curline], sizeof(PLRText[curline]), "%s", TXT_PLTDIFFICULT); - ubyte dif; + uint8_t dif; Current_pilot.get_difficulty(&dif); snprintf(PLRVal[curline], sizeof(PLRVal[curline]), "%s", difficulty_levels[dif]); curline++; diff --git a/Descent3/ship.h b/Descent3/ship.h index b8e0bdfa..9a0dd154 100644 --- a/Descent3/ship.h +++ b/Descent3/ship.h @@ -156,7 +156,7 @@ typedef struct { float lo_lod_distance; otype_wb_info static_wb[MAX_PLAYER_WEAPONS]; - ubyte fire_flags[MAX_PLAYER_WEAPONS]; // how a particular weapon fires + uint8_t fire_flags[MAX_PLAYER_WEAPONS]; // how a particular weapon fires int max_ammo[MAX_PLAYER_WEAPONS]; int firing_sound[MAX_PLAYER_WEAPONS]; // sound the weapon makes while button held down @@ -170,7 +170,7 @@ typedef struct { float armor_scalar; int flags; - ubyte used; + uint8_t used; } ship; extern int Num_ships; diff --git a/Descent3/special_face.h b/Descent3/special_face.h index 9f9666b7..d68738c2 100644 --- a/Descent3/special_face.h +++ b/Descent3/special_face.h @@ -38,10 +38,10 @@ typedef struct { #define SFF_SPEC_SMOOTH 2 typedef struct { - ubyte type; // See types (above) - ubyte num; // Number of instances - ubyte used; - ubyte flags; + uint8_t type; // See types (above) + uint8_t num; // Number of instances + uint8_t used; + uint8_t flags; specular_instance *spec_instance; diff --git a/Descent3/spew.h b/Descent3/spew.h index e8171bbd..85889665 100644 --- a/Descent3/spew.h +++ b/Descent3/spew.h @@ -94,7 +94,7 @@ typedef struct point_info { } pointinfo; typedef struct spew_t { - ubyte flags; // flags + uint8_t flags; // flags bool inuse; // if this slot is in use bool use_gunpoint; // is this a gunpoint based object (yes=true) bool real_obj; // if this object should be treated as a real object (can hurt you) (yes=true) diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index af022e4f..c15b1373 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -69,12 +69,12 @@ ushort *Terrain_rotate_list; // which points have been sub/rotated this frame g3Point *World_point_buffer; // Rotated points // The min/max values for a particular region of terrain -ubyte *Terrain_min_height_int[7]; -ubyte *Terrain_max_height_int[7]; +uint8_t *Terrain_min_height_int[7]; +uint8_t *Terrain_max_height_int[7]; // Texture values for a particular region // Terrain dynamic lighting table -ubyte Terrain_dynamic_table[TERRAIN_WIDTH * TERRAIN_DEPTH]; +uint8_t Terrain_dynamic_table[TERRAIN_WIDTH * TERRAIN_DEPTH]; // Terrain normals depending on LOD terrain_normals *TerrainNormals[MAX_TERRAIN_LOD]; @@ -83,13 +83,13 @@ terrain_normals *TerrainNormals[MAX_TERRAIN_LOD]; float *TerrainDeltaBlocks[MAX_TERRAIN_LOD]; // Tracks edges of LOD -ubyte TerrainJoinMap[TERRAIN_WIDTH * TERRAIN_DEPTH]; +uint8_t TerrainJoinMap[TERRAIN_WIDTH * TERRAIN_DEPTH]; // Terrain Y values float Terrain_y_values[256]; #if (defined(EDITOR) || defined(NEWEDITOR)) -ubyte TerrainSelected[TERRAIN_WIDTH * TERRAIN_DEPTH]; +uint8_t TerrainSelected[TERRAIN_WIDTH * TERRAIN_DEPTH]; int Num_terrain_selected = 0; int Editor_LOD_engine_off = 1; bool Terrain_render_ext_room_objs = true; @@ -100,13 +100,13 @@ int TSearch_on = 0, TSearch_found_type, TSearch_x, TSearch_y, TSearch_seg, TSear int Terrain_LOD_engine_off = 0; int TerrainEdgeTest[MAX_TERRAIN_LOD][16]; -ubyte TerrainEdgeJump[MAX_TERRAIN_LOD]; +uint8_t TerrainEdgeJump[MAX_TERRAIN_LOD]; // Unique terrain geometry identifier int Terrain_checksum = -1; // Occlusion data for knowing what to draw -ubyte Terrain_occlusion_map[256][32]; +uint8_t Terrain_occlusion_map[256][32]; int Terrain_occlusion_checksum = -2; // returns the index of the highest float @@ -673,7 +673,7 @@ void SetupSkyTexture() { } // Compute a parametric sphere for our sky. -void SetupSky(float radius, int flags, ubyte randit) { +void SetupSky(float radius, int flags, uint8_t randit) { int jump = 65536 / MAX_HORIZON_PIECES; int top = ((65536 / 4) * 3) + (65536 / 8); @@ -819,7 +819,7 @@ int LoadPCXTerrain(char *filename) { total = width * height; - lando = (ubyte *)mem_malloc(total); + lando = (uint8_t *)mem_malloc(total); mprintf((0, "Heightmap is %d x %d\n", width, height)); @@ -981,8 +981,8 @@ void InitTerrain(void) { h = 1 << i; // Index 1 cuts the whole thing into 4ths, index 2 into 8ths, etc - Terrain_min_height_int[i] = (ubyte *)mem_malloc(w * h * sizeof(ubyte)); - Terrain_max_height_int[i] = (ubyte *)mem_malloc(w * h * sizeof(ubyte)); + Terrain_min_height_int[i] = (uint8_t *)mem_malloc(w * h * sizeof(uint8_t)); + Terrain_max_height_int[i] = (uint8_t *)mem_malloc(w * h * sizeof(uint8_t)); ASSERT(Terrain_min_height_int[i] != NULL); ASSERT(Terrain_max_height_int[i] != NULL); diff --git a/Descent3/terrain.h b/Descent3/terrain.h index e14410e2..a4447aff 100644 --- a/Descent3/terrain.h +++ b/Descent3/terrain.h @@ -84,21 +84,21 @@ typedef struct { float y; // Y position of the lower left corner of the terrain cell float mody; // The modified y position of this cell - used for LOD - ubyte l, r, g, b; + uint8_t l, r, g, b; short objects; // Index of the first object in this cell short texseg_index; // index into the tex_segment array - ubyte flags; // various flags - ubyte lm_quad; // which lightmap quad this index belongs to - ubyte ypos; // this is so we don't have to constantly convert + uint8_t flags; // various flags + uint8_t lm_quad; // which lightmap quad this index belongs to + uint8_t ypos; // this is so we don't have to constantly convert // floats to ints when traversing the terrain // it's the integer version of pos.y - ubyte pad; // for alignment + uint8_t pad; // for alignment } terrain_segment; typedef struct { - ubyte rotation; + uint8_t rotation; short tex_index; } terrain_tex_segment; @@ -132,11 +132,11 @@ typedef struct { vector star_vectors[MAX_STARS]; vector satellite_vectors[MAX_SATELLITES]; - ubyte satellite_flags[MAX_SATELLITES]; + uint8_t satellite_flags[MAX_SATELLITES]; float satellite_size[MAX_SATELLITES]; - ubyte num_satellites; - ubyte num_stars; + uint8_t num_satellites; + uint8_t num_stars; short satellite_texture[MAX_SATELLITES]; @@ -160,17 +160,17 @@ typedef struct { typedef struct { int terrain_seg; - ubyte num_segs; + uint8_t num_segs; short mine_segs[50]; } terrain_mine_list; typedef struct { float z; ushort right_edge, left_edge, top_edge, bottom_edge; // for fixing tjoint problems - ubyte right_count, left_count, top_count, bottom_count; + uint8_t right_count, left_count, top_count, bottom_count; ushort segment; // what segment to render - ubyte lod; // what level of detail: 0=16x16, 1=8x8, 2=4x4, 3=2x2, 4=just this segment (1x1) - ubyte pad; + uint8_t lod; // what level of detail: 0=16x16, 1=8x8, 2=4x4, 3=2x2, 4=just this segment (1x1) + uint8_t pad; } terrain_render_info; typedef struct { @@ -178,11 +178,11 @@ typedef struct { vector normal2; // Lower right triangle } terrain_normals; -extern ubyte Terrain_dynamic_table[]; +extern uint8_t Terrain_dynamic_table[]; extern terrain_normals *TerrainNormals[MAX_TERRAIN_LOD]; // Occlusion data for knowing what to draw -extern ubyte Terrain_occlusion_map[256][32]; +extern uint8_t Terrain_occlusion_map[256][32]; extern int Terrain_occlusion_checksum; extern int Check_terrain_portal; @@ -201,7 +201,7 @@ extern float VisibleTerrainZ; extern float Terrain_average_height; extern float Clip_scale_left, Clip_scale_right, Clip_scale_top, Clip_scale_bot; -extern ubyte Terrain_from_mine; +extern uint8_t Terrain_from_mine; extern float Last_terrain_render_time; @@ -235,18 +235,18 @@ extern int Terrain_LOD_engine_off; extern float Terrain_texture_distance; // how far we should texture before going to flat shad -extern ubyte TerrainJoinMap[]; +extern uint8_t TerrainJoinMap[]; extern float *TerrainDeltaBlocks[]; -extern ubyte *Terrain_max_height_int[]; -extern ubyte *Terrain_min_height_int[]; -extern ubyte Fast_terrain; -extern ubyte Flat_terrain; -extern ubyte Show_invisible_terrain; +extern uint8_t *Terrain_max_height_int[]; +extern uint8_t *Terrain_min_height_int[]; +extern uint8_t Fast_terrain; +extern uint8_t Flat_terrain; +extern uint8_t Show_invisible_terrain; extern int Camera_direction, Sort_direction; #if (defined(_DEBUG) || defined(NEWEDITOR)) -extern ubyte TerrainSelected[]; +extern uint8_t TerrainSelected[]; extern int Num_terrain_selected; #endif @@ -278,7 +278,7 @@ extern int CheckToRenderSky(int); // left,top,right,bot are optional parameters. Omiting them (or setting them to -1) will // render to the whole screen. Passing valid values will only render tiles visible in the // specified window (though it won't clip those tiles to the window) -void RenderTerrain(ubyte from_mine, int left = -1, int top = -1, int right = -1, int bot = -1); +void RenderTerrain(uint8_t from_mine, int left = -1, int top = -1, int right = -1, int bot = -1); void GetPreRotatedPoint(g3Point *, int, int, int); void GenerateTerrainLight(); @@ -308,7 +308,7 @@ void ComputeTerrainSegmentCenter(vector *pos, int segnum); // Also now can return the normal at that ground point float GetTerrainGroundPoint(vector *pos, vector *normal = NULL); -void SetupSky(float radius, int flags, ubyte randit = 0); +void SetupSky(float radius, int flags, uint8_t randit = 0); // Builds the surface normal for terrain segment n void BuildNormalForTerrainSegment(int n); @@ -327,7 +327,7 @@ void GenerateLightSource(); int GetFurthestMineSegment(int mine_seg); // codes a point for visibility in the window passed to RenderTerrain() -ubyte CodeTerrainPoint(g3Point *p); +uint8_t CodeTerrainPoint(g3Point *p); // Generates info for the LOD engine...must be called after the geometry changes void GenerateLODDeltas(); diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index 10977514..b54275e4 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -836,11 +836,11 @@ void DrawSky(vector *veye, matrix *vorient); function_mode View_mode; int ManageFramerate = 0; int MinAllowableFramerate = 15; -ubyte Fast_terrain = 1; +uint8_t Fast_terrain = 1; float Far_fog_border; vector Terrain_viewer_eye; -ubyte Terrain_from_mine = 0; -ubyte Show_invisible_terrain = 0; +uint8_t Terrain_from_mine = 0; +uint8_t Show_invisible_terrain = 0; int Terrain_objects_drawn = 0; vector Last_frame_stars[MAX_STARS]; float Terrain_texture_distance = DEFAULT_TEXTURE_DISTANCE; @@ -877,8 +877,8 @@ void InitTerrainRenderSpeedups() { } } // codes a point for visibility in the window passed to RenderTerrain() -ubyte CodeTerrainPoint(g3Point *p) { - ubyte cc = 0; +uint8_t CodeTerrainPoint(g3Point *p) { + uint8_t cc = 0; if (p->p3_sx > Clip_scale_right) cc |= CC_OFF_RIGHT; if (p->p3_sx < Clip_scale_left) @@ -895,7 +895,7 @@ int IsTerrainDynamicChecked(int seg, int bit) { return 1; if (bit >= 8) return 1; - ubyte val = Terrain_dynamic_table[seg] & (1 << bit); + uint8_t val = Terrain_dynamic_table[seg] & (1 << bit); if (val) return 1; return 0; @@ -960,7 +960,7 @@ static int obj_sort_func(const obj_sort_item *a, const obj_sort_item *b) { // Returns true if the object is outside of our terrain portal int ObjectOutOfPortal(object *obj) { g3Point pnt1, pnt2; - ubyte anded = 0xff; + uint8_t anded = 0xff; g3_RotatePoint(&pnt1, &obj->min_xyz); if (pnt1.p3_codes & CC_BEHIND) return 0; @@ -1015,13 +1015,13 @@ int ShootRaysToObject(object *obj) { bool ExternalRoomVisible(room *rp, vector *center, float *zdist) { ASSERT(rp->flags & RF_EXTERNAL); g3Point pnt; - ubyte ccode; + uint8_t ccode; vector corners[8]; g3_RotatePoint(&pnt, center); *zdist = pnt.p3_z; MakePointsFromMinMax(corners, &rp->min_xyz, &rp->max_xyz); - ubyte andbyte = 0xff; + uint8_t andbyte = 0xff; for (int t = 0; t < 8; t++) { g3_RotatePoint(&pnt, &corners[t]); ccode = g3_CodePoint(&pnt); @@ -1308,7 +1308,7 @@ void DrawCloudLayer() { // left,top,right,bot are optional parameters. Omiting them (or setting them to -1) will // render to the whole screen. Passing valid values will only render tiles visible in the // specified window (though it won't clip those tiles to the window) -void RenderTerrain(ubyte from_mine, int left, int top, int right, int bot) { +void RenderTerrain(uint8_t from_mine, int left, int top, int right, int bot) { static int first = 1; if (first) { InitTerrainRenderSpeedups(); diff --git a/Descent3/vclip.cpp b/Descent3/vclip.cpp index 92cc9a40..43960eaa 100644 --- a/Descent3/vclip.cpp +++ b/Descent3/vclip.cpp @@ -317,7 +317,7 @@ void PageInVClip(int vcnum) { mprintf((0, "Paging in vclip %s!\n", vc->name)); - ubyte start_val = cf_ReadByte(infile); + uint8_t start_val = cf_ReadByte(infile); int version = 0; if (start_val != 127) { version = 0; diff --git a/Descent3/vclip.h b/Descent3/vclip.h index b9616711..450ac8ad 100644 --- a/Descent3/vclip.h +++ b/Descent3/vclip.h @@ -36,8 +36,8 @@ typedef struct { short *frames; // bitmap indices float frame_time; // time (in seconds) of each frame int flags; - ubyte target_size; // what size this vclip should use (texture wise) - ubyte used; // Is this vclip in use? + uint8_t target_size; // what size this vclip should use (texture wise) + uint8_t used; // Is this vclip in use? } vclip; extern vclip GameVClips[MAX_VCLIPS]; diff --git a/Descent3/viseffect.cpp b/Descent3/viseffect.cpp index b7b92875..5110fec6 100644 --- a/Descent3/viseffect.cpp +++ b/Descent3/viseffect.cpp @@ -564,7 +564,7 @@ int VisEffectInitType(vis_effect *vis) { // initialize a new viseffect. adds to the list for the given room // returns the vis number -int VisEffectCreate(ubyte type, ubyte id, int roomnum, vector *pos) { +int VisEffectCreate(uint8_t type, uint8_t id, int roomnum, vector *pos) { int visnum; vis_effect *vis; @@ -629,7 +629,7 @@ int VisEffectCreate(ubyte type, ubyte id, int roomnum, vector *pos) { // Creates vis effects but has the caller set their parameters // initialize a new viseffect. adds to the list for the given room // returns the vis number -int VisEffectCreateControlled(ubyte type, object *parent, ubyte id, int roomnum, vector *pos, float lifetime, +int VisEffectCreateControlled(uint8_t type, object *parent, uint8_t id, int roomnum, vector *pos, float lifetime, vector *velocity, int phys_flags, float size, float drag, float mass, bool isreal) { int visnum; vis_effect *vis; diff --git a/Descent3/viseffect.h b/Descent3/viseffect.h index 26ae5fdb..428d0b1f 100644 --- a/Descent3/viseffect.h +++ b/Descent3/viseffect.h @@ -128,7 +128,7 @@ int VisEffectInitType(vis_effect *vis); // initialize a new viseffect. adds to the list for the given room // returns the object number -int VisEffectCreate(ubyte type, ubyte id, int roomnum, vector *pos); +int VisEffectCreate(uint8_t type, uint8_t id, int roomnum, vector *pos); // link the viseffect into the list for its room // Does nothing for effects over terrain @@ -169,7 +169,7 @@ void CreateRandomLineSparks(int num_sparks, vector *pos, int roomnum, ushort col // Creates vis effects but has the caller set their parameters // initialize a new viseffect. adds to the list for the given room // returns the vis number -int VisEffectCreateControlled(ubyte type, object *parent, ubyte id, int roomnum, vector *pos, float lifetime, +int VisEffectCreateControlled(uint8_t type, object *parent, uint8_t id, int roomnum, vector *pos, float lifetime, vector *velocity, int phys_flags = 0, float size = 0, float mass = 0.0f, float drag = 0.0f, bool isreal = 0); diff --git a/Descent3/viseffect_external.h b/Descent3/viseffect_external.h index a354d1ac..9bc233ef 100644 --- a/Descent3/viseffect_external.h +++ b/Descent3/viseffect_external.h @@ -83,13 +83,13 @@ typedef struct { ushort vertnum; ushort end_vertnum; - ubyte subnum, subnum2; + uint8_t subnum, subnum2; } vis_attach_info; typedef struct { - ubyte width; - ubyte height; - ubyte texture; + uint8_t width; + uint8_t height; + uint8_t texture; } axis_billboard_info; typedef struct { @@ -118,8 +118,8 @@ typedef struct { vis_attach_info attach_info; axis_billboard_info billboard_info; - ubyte movement_type; - ubyte type, id; + uint8_t movement_type; + uint8_t type, id; } vis_effect; #endif diff --git a/Descent3/voice.cpp b/Descent3/voice.cpp index 5d8b02ff..6937788a 100644 --- a/Descent3/voice.cpp +++ b/Descent3/voice.cpp @@ -91,8 +91,8 @@ public: private: char filenames[QUEUE_SIZE][_MAX_PATH]; int flags[QUEUE_SIZE]; - ubyte currvoice; - ubyte pos; + uint8_t currvoice; + uint8_t pos; char motherloadat; bool inuse[QUEUE_SIZE]; bool full; diff --git a/Descent3/weapon.h b/Descent3/weapon.h index 2e270927..48bd6fc4 100644 --- a/Descent3/weapon.h +++ b/Descent3/weapon.h @@ -281,13 +281,13 @@ typedef struct { short particle_handle; // particle handle to texture short icon_handle; short scorch_handle; // handle for scorch bitmap, or -1 for none - ubyte spawn_count; // how many of spawn handle gets created - ubyte alternate_chance; // how often the alternate spawn weapon gets chosen (0 to 100) + uint8_t spawn_count; // how many of spawn handle gets created + uint8_t alternate_chance; // how often the alternate spawn weapon gets chosen (0 to 100) uint16_t used; - ubyte particle_count; - ubyte terrain_damage_depth; + uint8_t particle_count; + uint8_t terrain_damage_depth; float terrain_damage_size; @@ -451,7 +451,7 @@ void LoadWeaponSelectStates(CFILE *fp); void DrawAlphaBlendedScreen(float r, float g, float b, float alpha); // Does the weapon spray effect for an object -void DoSprayEffect(object *obj, otype_wb_info *static_wb, ubyte wb_index); +void DoSprayEffect(object *obj, otype_wb_info *static_wb, uint8_t wb_index); // Plays the animation that accompanies a weapon death void DoWeaponExploded(object *, vector *norm = NULL, vector *collision_point = NULL, object *hit_object = NULL); diff --git a/Descent3/weather.h b/Descent3/weather.h index cd6fda29..d0192941 100644 --- a/Descent3/weather.h +++ b/Descent3/weather.h @@ -35,7 +35,7 @@ typedef struct { int lightning_color; // the color of the lightning int sky_flash_color; // the color of the sky when lightning occurs - ubyte lightning_sequence; + uint8_t lightning_sequence; float last_lightning_evaluation_time; float lightning_interval_time; diff --git a/Descent3/winmain.cpp b/Descent3/winmain.cpp index 81878278..ab3b11ae 100644 --- a/Descent3/winmain.cpp +++ b/Descent3/winmain.cpp @@ -397,14 +397,14 @@ bool Win32SystemCheck(HINSTANCE hInst) { if (lResult == ERROR_SUCCESS) { char version[32]; DWORD dwType, dwLen = 32; - lResult = RegQueryValueEx(hKey, "Version", NULL, &dwType, (ubyte *)version, &dwLen); + lResult = RegQueryValueEx(hKey, "Version", NULL, &dwType, (uint8_t *)version, &dwLen); if (lResult == ERROR_SUCCESS) { version_num = atoi(strstr(version, ".") + 1); } else { int val; DWORD dwType, dwLen = 4; - lResult = RegQueryValueEx(hKey, "InstalledVersion", NULL, &dwType, (ubyte *)&val, &dwLen); + lResult = RegQueryValueEx(hKey, "InstalledVersion", NULL, &dwType, (uint8_t *)&val, &dwLen); if (lResult == ERROR_SUCCESS) { version_num = val; } diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index af808470..8edd1881 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -323,7 +323,7 @@ int Num_of_bitmaps = 0; bms_bitmap GameBitmaps[MAX_BITMAPS]; uint32_t Bitmap_memory_used = 0; -ubyte Bitmaps_initted = 0; +uint8_t Bitmaps_initted = 0; /* modify these lines to establish data type */ typedef bms_bitmap *bm_T; /* type of item to be stored */ typedef int bm_hashTableIndex; /* index into hash table */ @@ -998,7 +998,7 @@ void bm_MakeBad(int handle) { // Saves a bitmap to an open file. Saves the bitmap as an OUTRAGE_COMPRESSED_OGF. // Returns -1 if something is wrong. int bm_SaveBitmap(CFILE *fp, int handle) { - ubyte dumbbyte = 0, image_type = OUTRAGE_1555_COMPRESSED_MIPPED, pixsize = 32, desc = 8 + 32; + uint8_t dumbbyte = 0, image_type = OUTRAGE_1555_COMPRESSED_MIPPED, pixsize = 32, desc = 8 + 32; int i, done = 0; int num_mips; mprintf((0, "Saving bitmap %s...\n", GameBitmaps[handle].name)); @@ -1048,7 +1048,7 @@ int bm_SaveBitmap(CFILE *fp, int handle) { } ASSERT(curptr < total); ushort curpix = src_data[curptr]; - ubyte count = 1; + uint8_t count = 1; while (src_data[curptr + count] == curpix && count < 250 && (curptr + count) < total) count++; if (count == 1) { diff --git a/bitmap/bumpmap.cpp b/bitmap/bumpmap.cpp index b973f0e4..ecef2a65 100644 --- a/bitmap/bumpmap.cpp +++ b/bitmap/bumpmap.cpp @@ -117,13 +117,13 @@ ushort *bump_data(int handle) { } // returns width of bumpmap -ubyte bump_w(int handle) { +uint8_t bump_w(int handle) { ASSERT(GameBumpmaps[handle].flags & BUMPF_USED); return GameBumpmaps[handle].width; } // returns height of bumpmap -ubyte bump_h(int handle) { +uint8_t bump_h(int handle) { ASSERT(GameBumpmaps[handle].flags & BUMPF_USED); return GameBumpmaps[handle].height; } diff --git a/bitmap/iff.cpp b/bitmap/iff.cpp index 56eb8b75..412a639b 100644 --- a/bitmap/iff.cpp +++ b/bitmap/iff.cpp @@ -94,7 +94,7 @@ // Palette entry structure typedef struct { - ubyte r, g, b; + uint8_t r, g, b; } pal_entry; // structure of the header in the file @@ -104,11 +104,11 @@ typedef struct iff_bitmap_header { short type; // see types above short transparentcolor; // which color is transparent (if any) short pagewidth, pageheight; // width & height of source screen - ubyte nplanes; // number of planes (8 for 256 color image) - ubyte masking, compression; // see constants above - ubyte xaspect, yaspect; // aspect ratio (usually 5/6) + uint8_t nplanes; // number of planes (8 for 256 color image) + uint8_t masking, compression; // see constants above + uint8_t xaspect, yaspect; // aspect ratio (usually 5/6) pal_entry palette[256]; // the palette for this bitmap - ubyte *raw_data; // ptr to array of data + uint8_t *raw_data; // ptr to array of data short row_size; // offset to next row } iff_bitmap_header; @@ -213,7 +213,7 @@ int bm_iff_parse_bmhd(CFILE *ifile, uint32_t len, iff_bitmap_header *bmheader) { // the buffer pointed to by raw_data is stuffed with a pointer to decompressed pixel data int bm_iff_parse_body(CFILE *ifile, int len, iff_bitmap_header *bmheader) { - ubyte *p = bmheader->raw_data; + uint8_t *p = bmheader->raw_data; int width = 0, depth = 0, done = 0; if (bmheader->type == TYPE_PBM) { @@ -243,8 +243,8 @@ int bm_iff_parse_body(CFILE *ifile, int len, iff_bitmap_header *bmheader) { } else if (bmheader->compression == cmpByteRun1) // compression { - ubyte *data_end = p + (bmheader->h * depth * width); - ubyte mask = (bmheader->masking == mskHasMask); + uint8_t *data_end = p + (bmheader->h * depth * width); + uint8_t mask = (bmheader->masking == mskHasMask); int cur_width = 0, skip_mask = 0; int command; int plane = 0; @@ -312,9 +312,9 @@ int bm_iff_parse_delta(CFILE *ifile, int len, iff_bitmap_header *bmheader) { cf_ReadInt(ifile); // longword, seems to be equal to 4. Don't know what it is for (y = 0; y < bmheader->h; y++) { - ubyte n_items; + uint8_t n_items; int cnt = bmheader->w; - ubyte code; + uint8_t code; n_items = cf_ReadByte(ifile); @@ -322,7 +322,7 @@ int bm_iff_parse_delta(CFILE *ifile, int len, iff_bitmap_header *bmheader) { code = cf_ReadByte(ifile); if (code == 0) { - ubyte rep, val; + uint8_t rep, val; rep = cf_ReadByte(ifile); val = cf_ReadByte(ifile); @@ -400,7 +400,7 @@ int bm_iff_parse_file(CFILE *ifile, iff_bitmap_header *bmheader, iff_bitmap_head return ret; else { - bmheader->raw_data = (ubyte *)mem_malloc(bmheader->w * bmheader->h); + bmheader->raw_data = (uint8_t *)mem_malloc(bmheader->w * bmheader->h); if (!bmheader->raw_data) return IFF_NO_MEM; } @@ -416,7 +416,7 @@ int bm_iff_parse_file(CFILE *ifile, iff_bitmap_header *bmheader, iff_bitmap_head bmheader->w = prev_bm->w; bmheader->h = prev_bm->h; bmheader->type = prev_bm->type; - bmheader->raw_data = (ubyte *)mem_malloc(bmheader->w * bmheader->h); + bmheader->raw_data = (uint8_t *)mem_malloc(bmheader->w * bmheader->h); if (!bmheader->raw_data) return IFF_NO_MEM; @@ -488,7 +488,7 @@ void bm_iff_convert_8_to_16(int dest_bm, iff_bitmap_header *iffbm) { for (int i = 0; i < iffbm->h; i++) for (int t = 0; t < iffbm->w; t++) { ushort pixel; - ubyte c = iffbm->raw_data[i * iffbm->w + t]; + uint8_t c = iffbm->raw_data[i * iffbm->w + t]; int r = iffbm->palette[c].r >> 1; int g = iffbm->palette[c].g >> 1; diff --git a/bitmap/pcx.cpp b/bitmap/pcx.cpp index f6921ffe..cc15d485 100644 --- a/bitmap/pcx.cpp +++ b/bitmap/pcx.cpp @@ -68,7 +68,7 @@ static int bm_pcx_24bit_alloc_file(CFILE *infile); // Loads a pcx file and converts it to 16 bit. Returns bitmap handle or -1 on error int bm_pcx_alloc_file(CFILE *infile) { - ubyte temp[128]; + uint8_t temp[128]; cf_ReadBytes(temp, 128, infile); cfseek(infile, 0, SEEK_SET); @@ -94,9 +94,9 @@ int bm_pcx_8bit_alloc_file(CFILE *infile) { int total, run = 0; int i, t; int src_bm; - ubyte pred[256], pgreen[256], pblue[256]; - ubyte buf; - ubyte temp[128]; + uint8_t pred[256], pgreen[256], pblue[256]; + uint8_t buf; + uint8_t temp[128]; cf_ReadBytes(temp, 4, infile); @@ -117,7 +117,7 @@ int bm_pcx_8bit_alloc_file(CFILE *infile) { height = 1 + ymax - ymin; total = width * height; - ubyte *rawdata = (ubyte *)mem_malloc(width * height); + uint8_t *rawdata = (uint8_t *)mem_malloc(width * height); if (!rawdata) return -1; // no memory! @@ -125,7 +125,7 @@ int bm_pcx_8bit_alloc_file(CFILE *infile) { while (run < total) { buf = cf_ReadByte(infile); if (buf >= 192) { - ubyte tb; + uint8_t tb; tb = cf_ReadByte(infile); for (i = 0; i < (buf - 192); i++, run++) rawdata[run] = tb; @@ -158,7 +158,7 @@ int bm_pcx_8bit_alloc_file(CFILE *infile) { for (i = 0; i < height; i++) { for (t = 0; t < width; t++) { ushort pixel; - ubyte c = rawdata[i * width + t]; + uint8_t c = rawdata[i * width + t]; int r = pred[c]; int g = pgreen[c]; @@ -183,8 +183,8 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { int total, run = 0; int i, t; int src_bm; - ubyte buf; - ubyte temp[128]; + uint8_t buf; + uint8_t temp[128]; cf_ReadBytes(temp, 4, infile); @@ -226,7 +226,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { // scanline length total = 3 * BytesPerLine; - ubyte *rawdata = (ubyte *)mem_malloc(total * height); + uint8_t *rawdata = (uint8_t *)mem_malloc(total * height); if (!rawdata) { mprintf((0, "PCXLoad: Out of memory\n")); return -1; // no memory! @@ -246,7 +246,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { while (run < BytesPerLine) { buf = cf_ReadByte(infile); if (buf >= 192) { - ubyte tb; + uint8_t tb; tb = cf_ReadByte(infile); for (i = 0; i < (buf - 192); i++, run++, data_index++) rawdata[data_index] = tb; @@ -262,7 +262,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { while (run < BytesPerLine) { buf = cf_ReadByte(infile); if (buf >= 192) { - ubyte tb; + uint8_t tb; tb = cf_ReadByte(infile); for (i = 0; i < (buf - 192); i++, run++, data_index++) rawdata[data_index] = tb; @@ -278,7 +278,7 @@ int bm_pcx_24bit_alloc_file(CFILE *infile) { while (run < BytesPerLine) { buf = cf_ReadByte(infile); if (buf >= 192) { - ubyte tb; + uint8_t tb; tb = cf_ReadByte(infile); for (i = 0; i < (buf - 192); i++, run++, data_index++) rawdata[data_index] = tb; diff --git a/bitmap/tga.cpp b/bitmap/tga.cpp index 4e9df86e..57068094 100644 --- a/bitmap/tga.cpp +++ b/bitmap/tga.cpp @@ -241,7 +241,7 @@ int bm_tga_read_outrage_compressed16(CFILE *infile, int n, int num_mips, int typ while (count != total) { ASSERT(count < total); - ubyte command = tga_read_byte(); + uint8_t command = tga_read_byte(); if (Bad_tga) return 0; @@ -324,8 +324,8 @@ int bm_tga_read_outrage_compressed16(CFILE *infile, int n, int num_mips, int typ // Loads a tga or ogf file into a bitmap...returns handle to bm or -1 on error int bm_tga_alloc_file(CFILE *infile, char *name, int format) { - ubyte image_id_len, color_map_type, image_type, pixsize, descriptor; - ubyte upside_down = 0; + uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor; + uint8_t upside_down = 0; ushort width, height; uint32_t pixel; int i, t, n, data8bit = 0, savepos; @@ -419,8 +419,8 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { int total = 0; while (total < (height * width)) { - ubyte command = cf_ReadByte(infile); - ubyte len = (command & 127) + 1; + uint8_t command = cf_ReadByte(infile); + uint8_t len = (command & 127) + 1; if (command & 128) // rle chunk { @@ -452,9 +452,9 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { pixel = cf_ReadInt(infile); else { int r, g, b; - b = (ubyte)cf_ReadByte(infile); - g = (ubyte)cf_ReadByte(infile); - r = (ubyte)cf_ReadByte(infile); + b = (uint8_t)cf_ReadByte(infile); + g = (uint8_t)cf_ReadByte(infile); + r = (uint8_t)cf_ReadByte(infile); pixel = (255 << 24) | (r << 16) | (g << 8) | b; } ushort newpix = bm_tga_translate_pixel(pixel, format); @@ -477,9 +477,9 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { pixel = cf_ReadInt(infile); else { int r, g, b; - b = (ubyte)cf_ReadByte(infile); - g = (ubyte)cf_ReadByte(infile); - r = (ubyte)cf_ReadByte(infile); + b = (uint8_t)cf_ReadByte(infile); + g = (uint8_t)cf_ReadByte(infile); + r = (uint8_t)cf_ReadByte(infile); pixel = (255 << 24) | (r << 16) | (g << 8) | b; } @@ -511,7 +511,7 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { Bad_tga = 0; Fake_file_size = numleft; - cf_ReadBytes((ubyte *)Tga_file_data, numleft, infile); + cf_ReadBytes((uint8_t *)Tga_file_data, numleft, infile); read_ok = bm_tga_read_outrage_compressed16(infile, n, num_mips, image_type); } @@ -537,8 +537,8 @@ int bm_tga_alloc_file(CFILE *infile, char *name, int format) { // Pages in bitmap index n. Returns 1 if successful, 0 if not int bm_page_in_file(int n) { - ubyte image_id_len, color_map_type, image_type, pixsize, descriptor; - ubyte upside_down = 0; + uint8_t image_id_len, color_map_type, image_type, pixsize, descriptor; + uint8_t upside_down = 0; ushort width, height; int i, data8bit = 0, savepos; int mipped = 0, file_mipped = 0; @@ -669,7 +669,7 @@ int bm_page_in_file(int n) { Bad_tga = 0; Fake_file_size = numleft; - cf_ReadBytes((ubyte *)Tga_file_data, numleft, infile); + cf_ReadBytes((uint8_t *)Tga_file_data, numleft, infile); bm_tga_read_outrage_compressed16(infile, n, num_mips, image_type); } diff --git a/cfile/cfile.cpp b/cfile/cfile.cpp index 36fa3a7d..93ca193c 100644 --- a/cfile/cfile.cpp +++ b/cfile/cfile.cpp @@ -61,13 +61,13 @@ typedef struct library { // entry in extension->path table typedef struct { char ext[_MAX_EXT]; - ubyte pathnum; + uint8_t pathnum; } ext_entry; // entry in list of paths typedef struct { char path[_MAX_PATH]; - ubyte specific; // if non-zero, only for specific extensions + uint8_t specific; // if non-zero, only for specific extensions } path_entry; #define MAX_PATHS 100 @@ -884,7 +884,7 @@ int cfexist(const char *filename) { // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -int cf_ReadBytes(ubyte *buf, int count, CFILE *cfp) { +int cf_ReadBytes(uint8_t *buf, int count, CFILE *cfp) { int i; const char *error_msg = eof_error; // default error ASSERT(!(cfp->flags & CFF_TEXT)); @@ -912,35 +912,35 @@ int cf_ReadBytes(ubyte *buf, int count, CFILE *cfp) { // Throws an exception of type (cfile_error *) if the OS returns an error on read int32_t cf_ReadInt(CFILE *cfp) { int32_t i; - cf_ReadBytes((ubyte *)&i, sizeof(i), cfp); + cf_ReadBytes((uint8_t *)&i, sizeof(i), cfp); return INTEL_INT(i); } // Read and return a short (16 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on read int16_t cf_ReadShort(CFILE *cfp) { int16_t i; - cf_ReadBytes((ubyte *)&i, sizeof(i), cfp); + cf_ReadBytes((uint8_t *)&i, sizeof(i), cfp); return INTEL_SHORT(i); } // Read and return a byte (8 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on read int8_t cf_ReadByte(CFILE *cfp) { int8_t i; - cf_ReadBytes((ubyte *)&i, sizeof(i), cfp); + cf_ReadBytes((uint8_t *)&i, sizeof(i), cfp); return i; } // Read and return a float (32 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on read float cf_ReadFloat(CFILE *cfp) { float f; - cf_ReadBytes((ubyte *)&f, sizeof(f), cfp); + cf_ReadBytes((uint8_t *)&f, sizeof(f), cfp); return INTEL_FLOAT(f); } // Read and return a double (64 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on read double cf_ReadDouble(CFILE *cfp) { double f; - cf_ReadBytes((ubyte *)&f, sizeof(f), cfp); + cf_ReadBytes((uint8_t *)&f, sizeof(f), cfp); return D3::convert_le(f); } // Reads a string from a CFILE. If the file is type binary, this @@ -980,7 +980,7 @@ int cf_ReadString(char *buf, size_t n, CFILE *cfp) { // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -int cf_WriteBytes(const ubyte *buf, int count, CFILE *cfp) { +int cf_WriteBytes(const uint8_t *buf, int count, CFILE *cfp) { int i; if (!(cfp->flags & CFF_WRITING)) return 0; @@ -1002,7 +1002,7 @@ int cf_WriteString(CFILE *cfp, const char *buf) { int len; len = strlen(buf); if (len != 0) // write string - cf_WriteBytes((ubyte *)buf, len, cfp); + cf_WriteBytes((uint8_t *)buf, len, cfp); // Terminate with newline (text file) or NULL (binary file) cf_WriteByte(cfp, (cfp->flags & CFF_TEXT) ? '\n' : 0); return len + 1; @@ -1026,14 +1026,14 @@ int cfprintf(CFILE *cfp, const char *format, ...) { // Throws an exception of type (cfile_error *) if the OS returns an error on write void cf_WriteInt(CFILE *cfp, int32_t i) { int t = INTEL_INT(i); - cf_WriteBytes((ubyte *)&t, sizeof(t), cfp); + cf_WriteBytes((uint8_t *)&t, sizeof(t), cfp); } // Write a short (16 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on write void cf_WriteShort(CFILE *cfp, int16_t s) { short t = INTEL_SHORT(s); - cf_WriteBytes((ubyte *)&t, sizeof(t), cfp); + cf_WriteBytes((uint8_t *)&t, sizeof(t), cfp); } // Write a byte (8 bits). @@ -1051,14 +1051,14 @@ void cf_WriteByte(CFILE *cfp, int8_t b) { // Throws an exception of type (cfile_error *) if the OS returns an error on write void cf_WriteFloat(CFILE *cfp, float f) { float t = INTEL_FLOAT(f); - cf_WriteBytes((ubyte *)&t, sizeof(t), cfp); + cf_WriteBytes((uint8_t *)&t, sizeof(t), cfp); } // Write a double (64 bits) // Throws an exception of type (cfile_error *) if the OS returns an error on write void cf_WriteDouble(CFILE *cfp, double d) { auto t = D3::convert_le(d); - cf_WriteBytes((ubyte *)&t, sizeof(t), cfp); + cf_WriteBytes((uint8_t *)&t, sizeof(t), cfp); } // Copies a file. Returns TRUE if copied ok. Returns FALSE if error opening either file. @@ -1078,9 +1078,9 @@ bool cf_CopyFile(char *dest, const char *src, int copytime) { int progress = 0; int readcount = 0; #define COPY_CHUNK_SIZE 5000 - ubyte copybuf[COPY_CHUNK_SIZE]; + uint8_t copybuf[COPY_CHUNK_SIZE]; while (!cfeof(infile)) { - // ubyte c; + // uint8_t c; if (progress + COPY_CHUNK_SIZE <= infile->size) { readcount = COPY_CHUNK_SIZE; @@ -1132,7 +1132,7 @@ void cf_Rewind(CFILE *fp) { uint32_t cf_CalculateFileCRC(CFILE *infile) { int i, j; - ubyte crcbuf[CRC_BUFFER_SIZE]; + uint8_t crcbuf[CRC_BUFFER_SIZE]; static bool Cfile_crc_calculated = false; static uint32_t CRCTable[256]; uint32_t crc; diff --git a/cfile/cfile.h b/cfile/cfile.h index c9b2d3b7..7f6d746b 100644 --- a/cfile/cfile.h +++ b/cfile/cfile.h @@ -217,7 +217,7 @@ int cfexist(const char *filename); // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -int cf_ReadBytes(ubyte *buf, int count, CFILE *cfp); +int cf_ReadBytes(uint8_t *buf, int count, CFILE *cfp); // The following functions read numeric vales from a CFILE. All values are // stored in the file in Intel (little-endian) format. These functions @@ -261,7 +261,7 @@ int cf_ReadString(char *buf, size_t n, CFILE *cfp); // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -int cf_WriteBytes(const ubyte *buf, int count, CFILE *cfp); +int cf_WriteBytes(const uint8_t *buf, int count, CFILE *cfp); // Writes a null-terminated string to a file. If the file is type binary, // the string is terminated in the file with a null. If the file is type diff --git a/czip/BitIO.cpp b/czip/BitIO.cpp index 847a7c4c..00d45fb8 100644 --- a/czip/BitIO.cpp +++ b/czip/BitIO.cpp @@ -220,7 +220,7 @@ tVirtualFile *CZip::VFopen(const char *filename, const char *flags, int size) { f->count = 0; f->size = size; f->file_size = 0; - f->memory = (ubyte *)malloc(size); + f->memory = (uint8_t *)malloc(size); if (!f->memory) { free(f); return NULL; @@ -302,7 +302,7 @@ int CZip::VFgetc(tVirtualFile *file) { } int CZip::VFwrite(void *buf, int size, int count, tVirtualFile *file) { - ubyte *buffer = (ubyte *)buf; + uint8_t *buffer = (uint8_t *)buf; if (file->type) { // memory int c = std::min(count, (file->size - file->count) / size); @@ -321,7 +321,7 @@ int CZip::VFwrite(void *buf, int size, int count, tVirtualFile *file) { } int CZip::VFread(void *buf, int size, int count, tVirtualFile *file) { - ubyte *buffer = (ubyte *)buf; + uint8_t *buffer = (uint8_t *)buf; if (file->type) { // memory int c = std::min(count, (file->size - file->count) / size); diff --git a/czip/CZip.cpp b/czip/CZip.cpp index 00f4c203..e3615074 100644 --- a/czip/CZip.cpp +++ b/czip/CZip.cpp @@ -69,7 +69,7 @@ bool CZip::OpenInputArchive(char *filename, bool open_raw) { // read in the header based on what type of file it is if (open_raw) { // it should be a raw compressed file - ubyte type; + uint8_t type; if (ReadRawHeader(bfile->file, &type)) { ret = true; m_iCompressionType = type; @@ -77,7 +77,7 @@ bool CZip::OpenInputArchive(char *filename, bool open_raw) { } } else { // it should be an OCF file - ubyte type; + uint8_t type; tFileInfo temp; if (ReadOCFHeader(bfile->file, &temp, &type)) { ret = true; @@ -145,7 +145,7 @@ bool CZip::OpenOutputArchive(char *filename, bool open_raw, int compression_type // Reads in a Raw type file header // returns true on succes, if so, compr_type contains the compression type -bool CZip::ReadRawHeader(tVirtualFile *file, ubyte *compr_type) { +bool CZip::ReadRawHeader(tVirtualFile *file, uint8_t *compr_type) { int magic_num; if (!VFread(&magic_num, sizeof(int), 1, file)) @@ -155,7 +155,7 @@ bool CZip::ReadRawHeader(tVirtualFile *file, ubyte *compr_type) { return false; // it looks good, get our compression type and scram - ubyte type; + uint8_t type; if (!VFread(&type, 1, 1, bfile->file)) return false; @@ -167,7 +167,7 @@ bool CZip::ReadRawHeader(tVirtualFile *file, ubyte *compr_type) { // Writes out a Raw type file header // returns true on succes -bool CZip::WriteRawHeader(tVirtualFile *file, ubyte compr_type) { +bool CZip::WriteRawHeader(tVirtualFile *file, uint8_t compr_type) { int magic_num = 0x52415743; // check compression type!? @@ -183,7 +183,7 @@ bool CZip::WriteRawHeader(tVirtualFile *file, ubyte compr_type) { // Reads in an OCF header // returns true on success, info is filled in the appropriate values,compr_type is compression type -bool CZip::ReadOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte *compr_type) { +bool CZip::ReadOCFHeader(tVirtualFile *file, tFileInfo *info, uint8_t *compr_type) { int magic_num; if (!VFread(&magic_num, sizeof(int), 1, file)) @@ -193,7 +193,7 @@ bool CZip::ReadOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte *compr_type) return false; // it looks good, its an OCF at least - ubyte version; + uint8_t version; if (!VFread(&version, 1, 1, file)) return false; @@ -201,12 +201,12 @@ bool CZip::ReadOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte *compr_type) return false; // version is corrent, fill in the rest - ubyte filename_size; + uint8_t filename_size; char buffer[300]; int lo_time, hi_time; - ubyte ctype; + uint8_t ctype; int compressed_size, expand_size; - ubyte last_ditch_value; + uint8_t last_ditch_value; if (!VFread(&filename_size, 1, 1, file)) return false; @@ -251,11 +251,11 @@ bool CZip::ReadOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte *compr_type) // Writes out an OCF header // returns true on success -bool CZip::WriteOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte compr_type, int header_pos) { +bool CZip::WriteOCFHeader(tVirtualFile *file, tFileInfo *info, uint8_t compr_type, int header_pos) { int magic_num = 0x4D495241; - ubyte filename_size; - ubyte last_ditch_value; - ubyte version; + uint8_t filename_size; + uint8_t last_ditch_value; + uint8_t version; bool ret = false; int filepos = VFtell(file); // save the position of the file restorfilepos: @@ -306,7 +306,7 @@ restorfilepos: // you must call this before you compress data, then when done, call the read WriteOCFHeader bool CZip::WriteDummyOCFHeader(tVirtualFile *file, char *filename) { int itemp = 0; - ubyte btemp = 0; + uint8_t btemp = 0; if (!VFwrite(&itemp, sizeof(int), 1, file)) return false; @@ -315,7 +315,7 @@ bool CZip::WriteDummyOCFHeader(tVirtualFile *file, char *filename) { return false; // version is corrent, fill in the rest - ubyte filename_size = strlen(filename); + uint8_t filename_size = strlen(filename); if (!VFwrite(&filename_size, 1, 1, file)) return false; @@ -488,7 +488,7 @@ bool CZip::ExtractFileFromArchive(char *filename, char *destfilename) { VFseek(bfile->file, pos, SEEK_SET); // read in header - ubyte compr_type; + uint8_t compr_type; if (!ReadOCFHeader(bfile->file, ¤t_file, &compr_type)) return false; @@ -522,8 +522,8 @@ int CZip::FindFileInOCF(tVirtualFile *file, char *filename) { VFseek(file, 0, SEEK_SET); // go to the beginning of the file int magic_num, pos; - ubyte version, filename_size; - ubyte buffer[300]; + uint8_t version, filename_size; + uint8_t buffer[300]; bool done = false; int compsize; @@ -580,7 +580,7 @@ int CZip::GetOCFFileList(BITFILE *bfile, tFileInfo **info) { VFseek(file, 0, SEEK_SET); // go to the beginning of the file int magic_num, compsize; - ubyte filename_size; + uint8_t filename_size; bool done = false; while (!done) { @@ -657,11 +657,11 @@ void CZip::WriteBytes(char *data, int count) { } } -ubyte CZip::ReadRawByte(void) { +uint8_t CZip::ReadRawByte(void) { if (!m_bRawType) return -1; - ubyte data = 0; + uint8_t data = 0; switch (m_iCompressionType) { case COMPT_HUFFADAPT_0: if (!ha_ReadRawByte(&data, bfile)) @@ -706,7 +706,7 @@ float CZip::ReadRawFloat(void) { return *((float *)&data); } -void CZip::WriteRawByte(ubyte value) { +void CZip::WriteRawByte(uint8_t value) { switch (m_iCompressionType) { case COMPT_HUFFADAPT_0: ha_WriteRawByte(value, bfile); @@ -718,7 +718,7 @@ void CZip::WriteRawShort(ushort value) { if (!m_bRawType) return; // write 2 bytes - ubyte data; + uint8_t data; data = ((value & 0xFF00) >> 8); WriteRawByte(data); data = (value & 0xFF); @@ -728,7 +728,7 @@ void CZip::WriteRawInt(uint32_t value) { if (!m_bRawType) return; // write 4 bytes - ubyte data; + uint8_t data; data = ((value & 0xFF000000) >> 24); WriteRawByte(data); data = ((value & 0xFF0000) >> 16); @@ -742,7 +742,7 @@ void CZip::WriteRawFloat(float value) { if (!m_bRawType) return; // write 4 bytes - ubyte data; + uint8_t data; uint32_t v = 0; v = *((int *)&value); diff --git a/czip/HuffmanAdapt.cpp b/czip/HuffmanAdapt.cpp index 800aa2ee..3abef275 100644 --- a/czip/HuffmanAdapt.cpp +++ b/czip/HuffmanAdapt.cpp @@ -70,7 +70,7 @@ void CZip::ha_PrepareCompress(void) { ha_InitializeTree(&Tree); } -void CZip::ha_WriteRawByte(ubyte data, BITFILE *output) { +void CZip::ha_WriteRawByte(uint8_t data, BITFILE *output) { if (!ok_to_raw_write) return; ha_EncodeSymbol(&Tree, data, output); @@ -99,7 +99,7 @@ void CZip::ha_PrepareDecompress(void) { ha_InitializeTree(&Tree); } -bool CZip::ha_ReadRawByte(ubyte *data, BITFILE *input) { +bool CZip::ha_ReadRawByte(uint8_t *data, BITFILE *input) { if (!ok_to_raw_read) return false; diff --git a/ddebug/winmono.cpp b/ddebug/winmono.cpp index 041e83a6..7de960fc 100644 --- a/ddebug/winmono.cpp +++ b/ddebug/winmono.cpp @@ -90,7 +90,7 @@ static bool Mono_initialized = 0; static mono_element (*Mono_screen)[25][80]; static char Dbgstr_format[512]; static WINDOW Window[MAX_NUM_WINDOWS]; -static ubyte Mono_virtual_window_list[MAX_NUM_VWINDOWS]; +static uint8_t Mono_virtual_window_list[MAX_NUM_VWINDOWS]; #ifndef RELEASE #define MAX_MONO_LENGTH 2048 diff --git a/ddio_common/key.cpp b/ddio_common/key.cpp index 86d4a21a..42df0bc5 100644 --- a/ddio_common/key.cpp +++ b/ddio_common/key.cpp @@ -144,7 +144,7 @@ // ---------------------------------------------------------------------------- static bool DDIO_key_init = 0; -volatile ubyte DDIO_key_state[DDIO_MAX_KEYS]; +volatile uint8_t DDIO_key_state[DDIO_MAX_KEYS]; volatile short DDIO_key_down_count[DDIO_MAX_KEYS]; static struct t_key_queue { @@ -182,7 +182,7 @@ float ddio_KeyDownTime(int key) { ASSERT(DDIO_key_init); // snap off shift states, etc. - return ddio_InternalKeyDownTime((ubyte)(key & 0xff)); + return ddio_InternalKeyDownTime((uint8_t)(key & 0xff)); } // return number of times a key's been down since last call. @@ -195,7 +195,7 @@ int ddio_KeyDownCount(int key) { // returns the state of an ADJUSTED KEY VALUE bool ddio_GetAdjKeyState(int adj_key) { - ubyte key_raw = adj_key & 0xff; + uint8_t key_raw = adj_key & 0xff; int key_test = 0; if (adj_key & KEY_SHIFTED) { diff --git a/ddio_lnx/lnxkey.cpp b/ddio_lnx/lnxkey.cpp index 0db484b9..8454473a 100644 --- a/ddio_lnx/lnxkey.cpp +++ b/ddio_lnx/lnxkey.cpp @@ -78,22 +78,22 @@ volatile struct tLnxKeys { // null mode ddio bool ddio_null_InternalKeyInit(ddio_init_info *init_info); void ddio_null_InternalKeyClose(); -bool ddio_null_InternalKeyState(ubyte key); +bool ddio_null_InternalKeyState(uint8_t key); void ddio_null_InternalKeySuspend(); void ddio_null_InternalKeyResume(); -float ddio_null_InternalKeyDownTime(ubyte key); -void ddio_null_InternalResetKey(ubyte key); +float ddio_null_InternalKeyDownTime(uint8_t key); +void ddio_null_InternalResetKey(uint8_t key); bool ddio_null_KeyFrame(); void ddio_null_InternalKeyFrame(void); // sdl mode ddio bool ddio_sdl_InternalKeyInit(ddio_init_info *init_info); void ddio_sdl_InternalKeyClose(); -bool ddio_sdl_InternalKeyState(ubyte key); +bool ddio_sdl_InternalKeyState(uint8_t key); void ddio_sdl_InternalKeySuspend(); void ddio_sdl_InternalKeyResume(); -float ddio_sdl_InternalKeyDownTime(ubyte key); -void ddio_sdl_InternalResetKey(ubyte key); +float ddio_sdl_InternalKeyDownTime(uint8_t key); +void ddio_sdl_InternalResetKey(uint8_t key); bool ddio_sdl_KeyFrame(); void ddio_sdl_InternalKeyFrame(void); @@ -138,7 +138,7 @@ void ddio_InternalKeyClose() { } } -bool ddio_InternalKeyState(ubyte key) { +bool ddio_InternalKeyState(uint8_t key) { switch (Keyboard_mode) { case Input_null: return ddio_null_InternalKeyState(key); @@ -169,7 +169,7 @@ void ddio_InternalKeyResume() { } } -float ddio_InternalKeyDownTime(ubyte key) { +float ddio_InternalKeyDownTime(uint8_t key) { switch (Keyboard_mode) { case Input_null: return ddio_null_InternalKeyDownTime(key); @@ -180,7 +180,7 @@ float ddio_InternalKeyDownTime(ubyte key) { return 0.0f; } -void ddio_InternalResetKey(ubyte key) { +void ddio_InternalResetKey(uint8_t key) { switch (Keyboard_mode) { case Input_null: ddio_null_InternalResetKey(key); diff --git a/ddio_lnx/lnxkey_null.cpp b/ddio_lnx/lnxkey_null.cpp index b95a57b0..21085dab 100644 --- a/ddio_lnx/lnxkey_null.cpp +++ b/ddio_lnx/lnxkey_null.cpp @@ -77,13 +77,13 @@ bool ddio_null_InternalKeyInit(ddio_init_info *init_info) { void ddio_null_InternalKeyClose() {} -bool ddio_null_InternalKeyState(ubyte key) { return LKeys[key].status; } +bool ddio_null_InternalKeyState(uint8_t key) { return LKeys[key].status; } void ddio_null_InternalKeySuspend() {} void ddio_null_InternalKeyResume() {} -float ddio_null_InternalKeyDownTime(ubyte key) { +float ddio_null_InternalKeyDownTime(uint8_t key) { float down_time = 0.0f; if (LKeys[key].status) { float timer = timer_GetTime(); @@ -97,7 +97,7 @@ float ddio_null_InternalKeyDownTime(ubyte key) { return down_time; } -void ddio_null_InternalResetKey(ubyte key) { +void ddio_null_InternalResetKey(uint8_t key) { LKeys[key].down_time = 0.0f; LKeys[key].up_time = 0.0f; LKeys[key].status = false; diff --git a/ddio_lnx/lnxkey_sdl.cpp b/ddio_lnx/lnxkey_sdl.cpp index d209b9b2..9e6ce6e6 100644 --- a/ddio_lnx/lnxkey_sdl.cpp +++ b/ddio_lnx/lnxkey_sdl.cpp @@ -94,7 +94,7 @@ int sdlkey_to_ddiocode[27] = {0, KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, K KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N, KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U, KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z}; -static inline ubyte sdlkeycode_to_keycode(uint32_t sdlkeycode) { +static inline uint8_t sdlkeycode_to_keycode(uint32_t sdlkeycode) { // unceremoniously taken from Heretic source code with a few modifications. // (by Outrage. Not Loki. We know better. :) --ryan.) int rc = sdlkeycode; @@ -344,11 +344,11 @@ static inline ubyte sdlkeycode_to_keycode(uint32_t sdlkeycode) { break; } - return (ubyte)rc; + return (uint8_t)rc; } int sdlKeyFilter(const SDL_Event *event) { - ubyte kc = 0; + uint8_t kc = 0; if ((event->type != SDL_KEYUP) && (event->type != SDL_KEYDOWN)) return (1); @@ -428,13 +428,13 @@ bool ddio_sdl_InternalKeyInit(ddio_init_info *init_info) { void ddio_sdl_InternalKeyClose() {} -bool ddio_sdl_InternalKeyState(ubyte key) { return LKeys[key].status; } +bool ddio_sdl_InternalKeyState(uint8_t key) { return LKeys[key].status; } void ddio_sdl_InternalKeySuspend() {} void ddio_sdl_InternalKeyResume() {} -float ddio_sdl_InternalKeyDownTime(ubyte key) { +float ddio_sdl_InternalKeyDownTime(uint8_t key) { float down_time = 0.0f; if (LKeys[key].status) { float timer = timer_GetTime(); @@ -448,7 +448,7 @@ float ddio_sdl_InternalKeyDownTime(ubyte key) { return down_time; } -void ddio_sdl_InternalResetKey(ubyte key) { +void ddio_sdl_InternalResetKey(uint8_t key) { LKeys[key].down_time = 0.0f; LKeys[key].up_time = 0.0f; LKeys[key].status = false; diff --git a/ddio_lnx/lnxmouse.cpp b/ddio_lnx/lnxmouse.cpp index cb6252ed..68cc827b 100644 --- a/ddio_lnx/lnxmouse.cpp +++ b/ddio_lnx/lnxmouse.cpp @@ -105,8 +105,8 @@ static struct mses_state { typedef struct t_mse_button_info { bool is_down[N_MSEBTNS]; - ubyte down_count[N_MSEBTNS]; - ubyte up_count[N_MSEBTNS]; + uint8_t down_count[N_MSEBTNS]; + uint8_t up_count[N_MSEBTNS]; float time_down[N_MSEBTNS]; float time_up[N_MSEBTNS]; } t_mse_button_info; diff --git a/ddio_win/winjoy.cpp b/ddio_win/winjoy.cpp index 564f9377..14f77c2f 100644 --- a/ddio_win/winjoy.cpp +++ b/ddio_win/winjoy.cpp @@ -114,8 +114,8 @@ ////////////////////////////////////////////////////////////////////////////// typedef struct tJoystickRecord { - ubyte valid; // is this a valid device. - ubyte flags; // defined in ddio_win.h + uint8_t valid; // is this a valid device. + uint8_t flags; // defined in ddio_win.h short spad; union { diff --git a/ddio_win/winkey.cpp b/ddio_win/winkey.cpp index f56fdd59..671d7e47 100644 --- a/ddio_win/winkey.cpp +++ b/ddio_win/winkey.cpp @@ -250,7 +250,7 @@ LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam); void __cdecl dikey_Thread(void *dp); // translates scan code to foreign equivs. -ubyte xlate_scancode(ubyte scan_code); +uint8_t xlate_scancode(uint8_t scan_code); /////////////////////////////////////////////////////////////////////////////// @@ -370,9 +370,9 @@ void ddio_InternalKeyFrame() {} ////////////////////////////////////////////////////////////////////////////// // returns if key is up or down -bool ddio_InternalKeyState(ubyte key) { return WKeys[key].status; } +bool ddio_InternalKeyState(uint8_t key) { return WKeys[key].status; } -float ddio_InternalKeyDownTime(ubyte key) { +float ddio_InternalKeyDownTime(uint8_t key) { float down_time = 0.0f; if (WKeys[key].status) { if (WKD.winhook) { @@ -404,7 +404,7 @@ float ddio_InternalKeyDownTime(ubyte key) { } // flush a key internally -void ddio_InternalResetKey(ubyte key) { +void ddio_InternalResetKey(uint8_t key) { WKeys[key].down_ticks = 0; WKeys[key].up_ticks = 0; WKeys[key].status = false; @@ -421,8 +421,8 @@ void ddio_InternalResetKey(ubyte key) { void ddio_SetKeyboardLanguage(int language) { DDIO_key_language = language; } // translates scan code to foreign equivs. -ubyte xlate_scancode(ubyte scan_code) { - ubyte code = scan_code; +uint8_t xlate_scancode(uint8_t scan_code) { + uint8_t code = scan_code; if (DDIO_key_language == KBLANG_FRENCH) { switch (scan_code) { @@ -607,7 +607,7 @@ void __cdecl dikey_Thread(void *dp) { DWORD diobjitems = DIKEY_BUFFER_SIZE; HRESULT hr; // SHORT async_key_state; - ubyte key; + uint8_t key; int i; @@ -632,7 +632,7 @@ void __cdecl dikey_Thread(void *dp) { // note that dwOfs is the acutal key that is either down or up, and dwData tells us if // it is up or down. So place on key array, and in queue. for (i = 0; i < (int)diobjitems; i++) { - key = xlate_scancode((ubyte)(diobjdata[i].dwOfs)); + key = xlate_scancode((uint8_t)(diobjdata[i].dwOfs)); if (diobjdata[i].dwData & 0x80) { if (WKeys[key].status) { WKeys[key].up_ticks = 0; @@ -729,7 +729,7 @@ LRESULT CALLBACK KeyboardProc(int code, WPARAM wParam, LPARAM lParam) { } int ddio_KeyHandler(HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) { - ubyte scan_code; + uint8_t scan_code; float timer = timer_GetTime(); if (!WKD.winhook) diff --git a/ddio_win/winmouse.cpp b/ddio_win/winmouse.cpp index b07f5c4e..a8ecfd93 100644 --- a/ddio_win/winmouse.cpp +++ b/ddio_win/winmouse.cpp @@ -33,8 +33,8 @@ typedef struct t_mse_button_info { bool is_down[N_MSEBTNS]; - ubyte down_count[N_MSEBTNS]; - ubyte up_count[N_MSEBTNS]; + uint8_t down_count[N_MSEBTNS]; + uint8_t up_count[N_MSEBTNS]; DWORD time_down[N_MSEBTNS]; // in milliseconds windows ticks DWORD time_up[N_MSEBTNS]; } t_mse_button_info; diff --git a/grtext/grfont.cpp b/grtext/grfont.cpp index 9efe0be8..ad7d243e 100644 --- a/grtext/grfont.cpp +++ b/grtext/grfont.cpp @@ -137,7 +137,7 @@ typedef struct tFontInfo { char filename[32]; // filename of font int references; // number of references of that font int bmps[MAX_FONT_BITMAPS]; // font bitmap handles - ubyte *ch_u, *ch_v, *ch_w, *ch_h; + uint8_t *ch_u, *ch_v, *ch_w, *ch_h; int *ch_bmp; float *ch_uf, *ch_vf, *ch_wf, *ch_hf; tFontFileInfo font; @@ -158,7 +158,7 @@ typedef CFILE *FONTFILE; static inline int READ_FONT_INT(FONTFILE ffile); static inline short READ_FONT_SHORT(FONTFILE ffile); -static inline ubyte READ_FONT_BYTE(FONTFILE ffile); +static inline uint8_t READ_FONT_BYTE(FONTFILE ffile); static inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem); static inline FONTFILE OPEN_FONT(char *filename); static inline void CLOSE_FONT(FONTFILE ffile); @@ -167,12 +167,12 @@ inline int READ_FONT_INT(FONTFILE ffile) { return cf_ReadInt(ffile); } inline short READ_FONT_SHORT(FONTFILE ffile) { return cf_ReadShort(ffile); } -inline ubyte READ_FONT_BYTE(FONTFILE ffile) { return (ubyte)cf_ReadByte(ffile); } +inline uint8_t READ_FONT_BYTE(FONTFILE ffile) { return (uint8_t)cf_ReadByte(ffile); } inline int READ_FONT_DATA(FONTFILE ffile, void *buf, int size, int nelem) { int i; - i = cf_ReadBytes((ubyte *)buf, size * nelem, ffile); + i = cf_ReadBytes((uint8_t *)buf, size * nelem, ffile); ASSERT(i == (size * nelem)); @@ -200,7 +200,7 @@ typedef FILE *FONTFILE2; static inline int WRITE_FONT_INT(FONTFILE2 ffile, int i); static inline int WRITE_FONT_SHORT(FONTFILE2 ffile, short s); -static inline int WRITE_FONT_BYTE(FONTFILE2 ffile, ubyte c); +static inline int WRITE_FONT_BYTE(FONTFILE2 ffile, uint8_t c); static inline int WRITE_FONT_DATA(FONTFILE2 ffile, void *buf, int size, int nelem); static inline FONTFILE2 OPEN_FONT2(char *filename); static inline void CLOSE_FONT2(FONTFILE2 ffile); @@ -209,7 +209,7 @@ inline int WRITE_FONT_INT(FONTFILE2 ffile, int i) { return fwrite(&i, sizeof(i), inline int WRITE_FONT_SHORT(FONTFILE2 ffile, short s) { return fwrite(&s, sizeof(s), 1, (FILE *)ffile); } -inline int WRITE_FONT_BYTE(FONTFILE2 ffile, ubyte c) { return fwrite(&c, sizeof(c), 1, (FILE *)ffile); } +inline int WRITE_FONT_BYTE(FONTFILE2 ffile, uint8_t c) { return fwrite(&c, sizeof(c), 1, (FILE *)ffile); } inline int WRITE_FONT_DATA(FONTFILE2 ffile, void *buf, int size, int nelem) { int i; @@ -330,9 +330,9 @@ int grfont_Load(const char *fname) { // Read in all widths if (fnt.flags & FT_PROPORTIONAL) { - fnt.char_widths = (ubyte *)mem_malloc(sizeof(ubyte) * num_char); + fnt.char_widths = (uint8_t *)mem_malloc(sizeof(uint8_t) * num_char); for (i = 0; i < num_char; i++) - fnt.char_widths[i] = (ubyte)READ_FONT_SHORT(ff); + fnt.char_widths[i] = (uint8_t)READ_FONT_SHORT(ff); // mprintf((0, "::proportional")); } else { fnt.char_widths = NULL; @@ -341,7 +341,7 @@ int grfont_Load(const char *fname) { // Read in kerning data if (fnt.flags & FT_KERNED) { int n_pairs = (int)READ_FONT_SHORT(ff); - fnt.kern_data = (ubyte *)mem_malloc(sizeof(ubyte) * 3 * (n_pairs + 1)); + fnt.kern_data = (uint8_t *)mem_malloc(sizeof(uint8_t) * 3 * (n_pairs + 1)); for (i = 0; i < n_pairs; i++) { fnt.kern_data[i * 3] = READ_FONT_BYTE(ff); fnt.kern_data[i * 3 + 1] = READ_FONT_BYTE(ff); @@ -361,8 +361,8 @@ int grfont_Load(const char *fname) { // generate character data pointer table int bytesize = READ_FONT_INT(ff); - fnt.raw_data = (ubyte *)mem_malloc(bytesize); - fnt.char_data = (ubyte **)mem_malloc(num_char * sizeof(ubyte *)); + fnt.raw_data = (uint8_t *)mem_malloc(bytesize); + fnt.char_data = (uint8_t **)mem_malloc(num_char * sizeof(uint8_t *)); READ_FONT_DATA(ff, fnt.raw_data, bytesize, 1); @@ -377,7 +377,7 @@ int grfont_Load(const char *fname) { off += (fnt.width * fnt.height * BITS_TO_BYTES(BPP_16)); } } else { // Monochrome - ubyte *ptr = fnt.raw_data; + uint8_t *ptr = fnt.raw_data; // mprintf((0, "::mono")); for (i = 0; i < num_char; i++) { fnt.char_data[i] = ptr; @@ -486,16 +486,16 @@ bool grfont_LoadTemplate(const char *fname, tFontTemplate *ft) { // Read in all widths if (ft_flags & FT_PROPORTIONAL) { - ft->ch_widths = (ubyte *)mem_malloc(num_char); + ft->ch_widths = (uint8_t *)mem_malloc(num_char); for (i = 0; i < num_char; i++) - ft->ch_widths[i] = (ubyte)READ_FONT_SHORT(ff); + ft->ch_widths[i] = (uint8_t)READ_FONT_SHORT(ff); } else { ft->ch_widths = NULL; } if (ft_flags & FT_KERNED) { int n_pairs = (int)READ_FONT_SHORT(ff); - ft->kern_data = (ubyte *)mem_malloc(sizeof(ubyte) * 3 * (n_pairs + 1)); + ft->kern_data = (uint8_t *)mem_malloc(sizeof(uint8_t) * 3 * (n_pairs + 1)); for (i = 0; i < n_pairs; i++) { ft->kern_data[i * 3] = READ_FONT_BYTE(ff); ft->kern_data[i * 3 + 1] = READ_FONT_BYTE(ff); @@ -508,8 +508,8 @@ bool grfont_LoadTemplate(const char *fname, tFontTemplate *ft) { ft->kern_data = NULL; } - ft->ch_height = (ubyte)ft_height; - ft->ch_maxwidth = (ubyte)ft_width; + ft->ch_height = (uint8_t)ft_height; + ft->ch_maxwidth = (uint8_t)ft_width; ft->max_ascii = ft_maxasc; ft->min_ascii = ft_minasc; ft->proportional = (ft_flags & FT_PROPORTIONAL) ? true : false; @@ -578,9 +578,9 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { // Read in all widths if (fnt.flags & FT_PROPORTIONAL) { - fnt.char_widths = (ubyte *)mem_malloc(sizeof(ubyte) * num_char); + fnt.char_widths = (uint8_t *)mem_malloc(sizeof(uint8_t) * num_char); for (i = 0; i < num_char; i++) - fnt.char_widths[i] = (ubyte)READ_FONT_SHORT(ffin); + fnt.char_widths[i] = (uint8_t)READ_FONT_SHORT(ffin); } else { fnt.char_widths = NULL; } @@ -588,7 +588,7 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { // Read in kerning data if (fnt.flags & FT_KERNED) { int n_pairs = (int)READ_FONT_SHORT(ffin); - fnt.kern_data = (ubyte *)mem_malloc(sizeof(ubyte) * 3 * (n_pairs + 1)); + fnt.kern_data = (uint8_t *)mem_malloc(sizeof(uint8_t) * 3 * (n_pairs + 1)); for (i = 0; i < n_pairs; i++) { fnt.kern_data[i * 3] = READ_FONT_BYTE(ffin); fnt.kern_data[i * 3 + 1] = READ_FONT_BYTE(ffin); @@ -604,7 +604,7 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { // Read in pixel data. int bytesize = READ_FONT_INT(ffin); - fnt.raw_data = (ubyte *)mem_malloc(bytesize); + fnt.raw_data = (uint8_t *)mem_malloc(bytesize); READ_FONT_DATA(ffin, fnt.raw_data, bytesize, 1); @@ -615,8 +615,8 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { fnt.height = ft->ch_height; fnt.flags = (ft->proportional ? FT_PROPORTIONAL : 0) + ((!ft->monochromatic) ? FT_COLOR : 0) + (ft->kern_data ? FT_KERNED : 0) + (ft->newstyle ? FT_FMT4444 : 0); - fnt.min_ascii = (ubyte)ft->min_ascii; - fnt.max_ascii = (ubyte)ft->max_ascii; + fnt.min_ascii = (uint8_t)ft->min_ascii; + fnt.max_ascii = (uint8_t)ft->max_ascii; if (ft->ffi2) fnt.flags |= FT_FFI2; @@ -661,7 +661,7 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { if (fnt.flags & FT_KERNED) { // iterate new kerning info bytes - ubyte *ch = fnt.kern_data; + uint8_t *ch = fnt.kern_data; int n_bytes = 0, n_pairs; while (ch[n_bytes] != 255) { n_bytes += 3; @@ -691,7 +691,7 @@ bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft) { // MTS: Unused? // sets a font's template without saving... -bool grfont_SetKerning(int font, ubyte *kern_data) { +bool grfont_SetKerning(int font, uint8_t *kern_data) { tFontInfo *oldft = &Fonts[font]; int n_pairs = 0; @@ -705,7 +705,7 @@ bool grfont_SetKerning(int font, ubyte *kern_data) { while (kern_data[n_pairs * 3] != 255) n_pairs++; - oldft->font.kern_data = (ubyte *)mem_malloc((n_pairs + 1) * 3 * sizeof(ubyte)); + oldft->font.kern_data = (uint8_t *)mem_malloc((n_pairs + 1) * 3 * sizeof(uint8_t)); n_pairs = 0; while (kern_data[n_pairs * 3] != 255) { oldft->font.kern_data[n_pairs * 3] = kern_data[n_pairs * 3]; @@ -798,7 +798,7 @@ int grfont_GetCharWidth(int font, int ch) { ASSERT(font > -1 && font < MAX_FONTS); ft = &Fonts[font].font; - ch = (int)((ubyte)ch); + ch = (int)((uint8_t)ch); if (ch > ft->max_ascii && (ft->flags & FT_UPPERCASE)) { ch = toupper(ch); @@ -832,17 +832,17 @@ void grfont_TranslateToBitmaps(int handle) { // create a 128x128 bitmap. // draw each character into bitmap until we need to create another // surface. - ubyte u = 0, v = 0, w; + uint8_t u = 0, v = 0, w; int ch, num_ch; - ubyte surf_index = 0; + uint8_t surf_index = 0; num_ch = fntfile->max_ascii - fntfile->min_ascii + 1; // initialize memory - fnt->ch_w = new ubyte[num_ch]; - fnt->ch_h = new ubyte[num_ch]; - fnt->ch_u = new ubyte[num_ch]; - fnt->ch_v = new ubyte[num_ch]; + fnt->ch_w = new uint8_t[num_ch]; + fnt->ch_h = new uint8_t[num_ch]; + fnt->ch_u = new uint8_t[num_ch]; + fnt->ch_v = new uint8_t[num_ch]; fnt->ch_bmp = new int[num_ch]; fnt->ch_uf = new float[num_ch]; fnt->ch_vf = new float[num_ch]; @@ -896,7 +896,7 @@ void grfont_TranslateToBitmaps(int handle) { grfont_XlateMonoChar(fnt->bmps[surf_index - 1], u, v, ch, fntfile, w); } - fnt->ch_h[ch] = (ubyte)fntfile->height; + fnt->ch_h[ch] = (uint8_t)fntfile->height; fnt->ch_w[ch] = w; fnt->ch_u[ch] = u; fnt->ch_v[ch] = v; @@ -914,8 +914,8 @@ void grfont_TranslateToBitmaps(int handle) { // Font translation routines void grfont_XlateMonoChar(int bmp_handle, int x, int y, int index, tFontFileInfo *ft, int width) { int row, col; // byte width of char - ubyte bit_mask = 0, byte; - ubyte *fp; + uint8_t bit_mask = 0, byte; + uint8_t *fp; fp = ft->char_data[index]; @@ -1011,11 +1011,11 @@ void grfont_XlateColorGrayChar(int bmp_handle, int x, int y, int index, tFontFil if (col565 == 0x07e0) dptr[x + col] = NEW_TRANSPARENT_COLOR; else { - ubyte r = (ubyte)((col565 & 0xf800) >> 11); - ubyte g = (ubyte)((col565 & 0x07c0) >> 6); - ubyte b = (ubyte)(col565 & 0x001f); + uint8_t r = (uint8_t)((col565 & 0xf800) >> 11); + uint8_t g = (uint8_t)((col565 & 0x07c0) >> 6); + uint8_t b = (uint8_t)(col565 & 0x001f); float brightness = ((r * 0.30f) + (g * 0.59f) + (b * 0.11f)) * recip32; - ubyte elem = (ubyte)(255 * brightness * ft->brightness); + uint8_t elem = (uint8_t)(255 * brightness * ft->brightness); if ((brightness * ft->brightness) > 1.0f) elem = 255; dptr[x + col] = GR_RGB16(elem, elem, elem) | OPAQUE_FLAG; @@ -1112,7 +1112,7 @@ int grfont_GetKernedSpacing(int font, int ch1, int ch2) { ft = &Fonts[font].font; if (ft->kern_data) { - ubyte *kern = ft->kern_data; + uint8_t *kern = ft->kern_data; while (kern[0] != 255) { if (ch1 == kern[0] && ch2 == kern[1]) { return (int)((int8_t)kern[2]); @@ -1126,7 +1126,7 @@ int grfont_GetKernedSpacing(int font, int ch1, int ch2) { // returns a character's width int grfont_GetKernedSpacingTemp(const tFontTemplate *ft, int ch1, int ch2) { if (ft->kern_data) { - ubyte *kern = ft->kern_data; + uint8_t *kern = ft->kern_data; while (kern[0] != 255) { if (ch1 == kern[0] && ch2 == kern[1]) { return (int)((int8_t)kern[2]); diff --git a/grtext/grtext.cpp b/grtext/grtext.cpp index 94a53267..bcfb3dd0 100644 --- a/grtext/grtext.cpp +++ b/grtext/grtext.cpp @@ -169,8 +169,8 @@ #define GRTEXTOP_SETCOLOR 0x2 // 1 ddgr_color #define GRTEXTOP_FANCYCOLOR 0x3 // 4 ddgr_colors #define GRTEXTOP_SETFONT 0x4 // 1 font handle (int) -#define GRTEXTOP_SETALPHA 0x5 // 1 ubyte -#define GRTEXTOP_PUTCHAR 0x6 // (2 shorts) 1 ubyte +#define GRTEXTOP_SETALPHA 0x5 // 1 uint8_t +#define GRTEXTOP_PUTCHAR 0x6 // (2 shorts) 1 uint8_t #define GRTEXTOP_SETFLAGS 0x7 // (flags) = 1 int. #define GRTEXTOP_SCALE 0x8 // 1 float (scale) scale current font. @@ -179,7 +179,7 @@ int Grtext_spacing = 1; static char Grtext_buffer[GRTEXT_BUFLEN]; static int Grtext_ptr = 0; static int Grtext_font = 0; -static ubyte Grtext_alpha = 255; +static uint8_t Grtext_alpha = 255; static int8_t Grtext_alphatype = ATF_TEXTURE + ATF_CONSTANT; static bool Grtext_shadow = false; static int Grtext_line_spacing = 1; @@ -354,10 +354,10 @@ void grtext_SetFancyColor(ddgr_color col1, ddgr_color col2, ddgr_color col3, ddg } // sets the alpha value for text -void grtext_SetAlpha(ubyte alpha) { +void grtext_SetAlpha(uint8_t alpha) { struct { char op; - ubyte alpha; + uint8_t alpha; } cmd; ASSERT((Grtext_ptr + sizeof(cmd)) < GRTEXT_BUFLEN); @@ -370,7 +370,7 @@ void grtext_SetAlpha(ubyte alpha) { } // gets font alpha -ubyte grtext_GetAlpha() { return Grtext_alpha; } +uint8_t grtext_GetAlpha() { return Grtext_alpha; } // toggles text saturation void grtext_SetFlags(int flags) { @@ -503,7 +503,7 @@ void grtext_PutChar(int x, int y, int ch) { struct { char op; short x, y; - ubyte ch; + uint8_t ch; } cmd; ASSERT((Grtext_ptr + sizeof(cmd)) < GRTEXT_BUFLEN); @@ -511,7 +511,7 @@ void grtext_PutChar(int x, int y, int ch) { cmd.op = GRTEXTOP_PUTCHAR; cmd.x = (short)x; cmd.y = (short)y; - cmd.ch = (ubyte)ch; + cmd.ch = (uint8_t)ch; memcpy(&Grtext_buffer[Grtext_ptr], &cmd, sizeof(cmd)); Grtext_ptr += sizeof(cmd); } @@ -596,7 +596,7 @@ void grtext_Render() { case GRTEXTOP_SETALPHA: { struct { char op; - ubyte alpha; + uint8_t alpha; } cmd; memcpy(&cmd, &Grtext_buffer[pos], sizeof(cmd)); @@ -639,7 +639,7 @@ void grtext_Render() { struct { char op; short x, y; - ubyte ch; + uint8_t ch; } cmd; memcpy(&cmd, &Grtext_buffer[pos], sizeof(cmd)); @@ -880,10 +880,10 @@ void grtext_DrawTextLineClip(int x, int y, char *str) { cur_x = x; for (i = 0; i < strsize; i++) { - ubyte ch, ch2; + uint8_t ch, ch2; int w; - ch = (ubyte)str[i]; - ch2 = (ubyte)str[i + 1]; + ch = (uint8_t)str[i]; + ch2 = (uint8_t)str[i + 1]; w = CHAR_WIDTH(Grtext_font, ch); @@ -958,10 +958,10 @@ void grtext_DrawTextLine(int x, int y, char *str) { */ cur_x = x; for (i = 0; i < strsize; i++) { - ubyte ch, ch2; + uint8_t ch, ch2; int w; - ch = (ubyte)str[i]; - ch2 = (ubyte)str[i + 1]; + ch = (uint8_t)str[i]; + ch2 = (uint8_t)str[i + 1]; w = CHAR_WIDTH(Grtext_font, ch); if (ch == GR_COLOR_CHAR) { diff --git a/legacy/D3Launch/D3Launch.cpp b/legacy/D3Launch/D3Launch.cpp index 034bb667..2ab00be0 100644 --- a/legacy/D3Launch/D3Launch.cpp +++ b/legacy/D3Launch/D3Launch.cpp @@ -799,7 +799,7 @@ int GetDirectXVersion(void) "Version", // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *) version, // value to set + (uint8_t *) version, // value to set &dwLen // How many bytes to set ); @@ -818,7 +818,7 @@ int GetDirectXVersion(void) "InstalledVersion", // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *) &val, // value to set + (uint8_t *) &val, // value to set &dwLen // How many bytes to set ); diff --git a/legacy/D3Launch/DirectXTab.cpp b/legacy/D3Launch/DirectXTab.cpp index 7cce368f..3b2a058b 100644 --- a/legacy/D3Launch/DirectXTab.cpp +++ b/legacy/D3Launch/DirectXTab.cpp @@ -136,7 +136,7 @@ BOOL CDirectXTab::OnInitDialog() "Version", // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *) version, // value to set + (uint8_t *) version, // value to set &dwLen // How many bytes to set ); @@ -157,7 +157,7 @@ BOOL CDirectXTab::OnInitDialog() "InstalledVersion", // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *) &val, // value to set + (uint8_t *) &val, // value to set &dwLen // How many bytes to set ); diff --git a/legacy/D3Launch/OS_Config.cpp b/legacy/D3Launch/OS_Config.cpp index 09848d50..75184526 100644 --- a/legacy/D3Launch/OS_Config.cpp +++ b/legacy/D3Launch/OS_Config.cpp @@ -332,7 +332,7 @@ char * os_config_read_string( char *section, char *name, char *default_value ) name, // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *)&tmp_string_data, // value to set + (uint8_t *)&tmp_string_data, // value to set &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { @@ -379,7 +379,7 @@ char * os_config_read_string_ex( char *keyname, char *name, char *default_value name, // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *)&tmp_string_data_ex, // value to set + (uint8_t *)&tmp_string_data_ex, // value to set &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { @@ -431,7 +431,7 @@ char * os_config_read_string2( char *section, char *name, char *default_value ) name, // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *)&tmp_string_data, // value to set + (uint8_t *)&tmp_string_data, // value to set &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { @@ -487,7 +487,7 @@ uint32_t os_config_read_uint( char *section, char *name, uint32_t default_value name, // The values name NULL, // DWORD reserved &dwType, // What kind it is - (ubyte *)&tmp_val, // value to set + (uint8_t *)&tmp_val, // value to set &dwLen ); // How many bytes to set if ( lResult != ERROR_SUCCESS ) { diff --git a/legacy/FontEditor/FontCreate.cpp b/legacy/FontEditor/FontCreate.cpp index b9ecdb63..b5f5a73e 100644 --- a/legacy/FontEditor/FontCreate.cpp +++ b/legacy/FontEditor/FontCreate.cpp @@ -65,7 +65,7 @@ inline int WRITE_FONT_SHORT(FONTFILE ffile, short s) { return fwrite(&s, sizeof(s), 1, (FILE *)ffile); } -inline int WRITE_FONT_BYTE(FONTFILE ffile, ubyte c) { +inline int WRITE_FONT_BYTE(FONTFILE ffile, uint8_t c) { return fwrite(&c, sizeof(c), 1, (FILE *)ffile); } @@ -151,7 +151,7 @@ void message_box(const char *fmt, ...) static bool m_FontProp; -static ubyte m_CharWidths[MAX_FONT_CHARS]; +static uint8_t m_CharWidths[MAX_FONT_CHARS]; static short m_CharHeight; static short m_CharMaxWidth; static ushort *m_FontBmData; @@ -349,7 +349,7 @@ bool extract_font(int bm_handle, tFontFileInfo *ft) ft->baseline = m_CharHeight; ft->min_ascii = 0; ft->max_ascii = cur_char-1; - ft->raw_data = (ubyte *)m_DataBuffer; + ft->raw_data = (uint8_t *)m_DataBuffer; ft->char_data = NULL; ft->char_widths = m_CharWidths; ft->kern_data= NULL; @@ -443,21 +443,21 @@ void FontCreate(const char *fnt_file_source, const char *fnt_file_dest, int min_ if (ft.flags & FT_COLOR) { WRITE_FONT_INT(ffile, (int)(m_DataPtr-m_DataBuffer)*sizeof(ushort)); - WRITE_FONT_DATA(ffile, (ubyte *)m_DataBuffer, (m_DataPtr-m_DataBuffer)*sizeof(ushort), 1); + WRITE_FONT_DATA(ffile, (uint8_t *)m_DataBuffer, (m_DataPtr-m_DataBuffer)*sizeof(ushort), 1); } else { // bitpack for mono font storage:: 16bpp -> 8 bits/1 byte int i,x,y,w,cnt=0; ushort *p = m_DataBuffer; - ubyte *bits; + uint8_t *bits; - bits = (ubyte *)mem_malloc(256 * MAX_FONT_CHARS); + bits = (uint8_t *)mem_malloc(256 * MAX_FONT_CHARS); for (i = 0; i < num_char; i++) { for (y = 0; y < ft.height; y++) { - ubyte mask, datum; + uint8_t mask, datum; w = (ft.flags & FT_PROPORTIONAL) ? ft.char_widths[i] : ft.width; diff --git a/legacy/FontEditor/FontKern.cpp b/legacy/FontEditor/FontKern.cpp index 7be4dd70..7938416a 100644 --- a/legacy/FontEditor/FontKern.cpp +++ b/legacy/FontEditor/FontKern.cpp @@ -67,7 +67,7 @@ int fonttool_get_kerning( int c1, int c2, int *pairnum=NULL); int fonttool_get_kerning( int c1, int c2, int *pairnum) { int i; - ubyte *kern_data; + uint8_t *kern_data; kern_data= Font_template.kern_data; @@ -75,7 +75,7 @@ int fonttool_get_kerning( int c1, int c2, int *pairnum) i=0; while (kern_data[i] != 255) { - if (kern_data[i] == (ubyte)c1 && kern_data[i+1] == (ubyte)c2) { + if (kern_data[i] == (uint8_t)c1 && kern_data[i+1] == (uint8_t)c2) { if (pairnum) *pairnum = i/3; return (int)((int8_t)kern_data[i+2]); } @@ -90,7 +90,7 @@ int fonttool_get_kerning( int c1, int c2, int *pairnum) void fonttool_set_kerning( int c1, int c2, int dist ) { int i,j; - ubyte *kern_data; + uint8_t *kern_data; if (c1 == 255 || c2 == 255) { mprintf((0, "seting illegal kerning of 255!\n")); @@ -101,9 +101,9 @@ void fonttool_set_kerning( int c1, int c2, int dist ) if (!kern_data) { // create a one entry kern table. - kern_data = (ubyte *)mem_malloc(KERNINFO_PAIR_SIZE*2); - kern_data[0] = (ubyte)c1; - kern_data[1] = (ubyte)c2; + kern_data = (uint8_t *)mem_malloc(KERNINFO_PAIR_SIZE*2); + kern_data[0] = (uint8_t)c1; + kern_data[1] = (uint8_t)c2; kern_data[2] = (int8_t)dist; kern_data[3] = 255; kern_data[4] = 255; @@ -117,7 +117,7 @@ void fonttool_set_kerning( int c1, int c2, int dist ) i=0; while (kern_data[i] != 255) { - if (kern_data[i] == (ubyte)c1 && kern_data[i+1] == (ubyte)c2) { + if (kern_data[i] == (uint8_t)c1 && kern_data[i+1] == (uint8_t)c2) { kern_data[i+2] = (int8_t)dist; if (dist == 0) { // remove this kerning pair. @@ -147,18 +147,18 @@ void fonttool_set_kerning( int c1, int c2, int dist ) } // new entry. - ubyte *new_kern_data; + uint8_t *new_kern_data; int n_pairs = i/KERNINFO_PAIR_SIZE; - new_kern_data = (ubyte *)mem_malloc((n_pairs+2)*sizeof(ubyte)*KERNINFO_PAIR_SIZE); + new_kern_data = (uint8_t *)mem_malloc((n_pairs+2)*sizeof(uint8_t)*KERNINFO_PAIR_SIZE); for (i = 0; i < n_pairs; i++) { new_kern_data[i*KERNINFO_PAIR_SIZE] = kern_data[i*3]; new_kern_data[i*KERNINFO_PAIR_SIZE+1] = kern_data[i*3+1]; new_kern_data[i*KERNINFO_PAIR_SIZE+2] = kern_data[i*3+2]; } - new_kern_data[i*KERNINFO_PAIR_SIZE] = (ubyte)c1; - new_kern_data[i*KERNINFO_PAIR_SIZE+1] = (ubyte)c2; + new_kern_data[i*KERNINFO_PAIR_SIZE] = (uint8_t)c1; + new_kern_data[i*KERNINFO_PAIR_SIZE+1] = (uint8_t)c2; new_kern_data[i*KERNINFO_PAIR_SIZE+2] = (int8_t)dist; i++; new_kern_data[i*KERNINFO_PAIR_SIZE] = 255; @@ -340,7 +340,7 @@ void FontKern(const char *fnt_file_name) } if (current_pair >= 0) { - ubyte *kern_data = &Font_template.kern_data[current_pair*3]; + uint8_t *kern_data = &Font_template.kern_data[current_pair*3]; if (kern_data[3] != 255) { current_pair++; kern_data = &Font_template.kern_data[current_pair*3]; @@ -356,7 +356,7 @@ void FontKern(const char *fnt_file_name) } if (current_pair >= 0) { - ubyte *kern_data = &Font_template.kern_data[current_pair*3]; + uint8_t *kern_data = &Font_template.kern_data[current_pair*3]; if (kern_data != Font_template.kern_data) { // gosh, comparing pointers like this may not be the best method...this is shitty code... current_pair--; @@ -385,7 +385,7 @@ void FontKern(const char *fnt_file_name) grtext_SetParameters(0,0,FIXED_SCREEN_WIDTH,FIXED_SCREEN_HEIGHT); grtext_SetFont(font_handle); grtext_SetColor(text_color); - grtext_SetAlpha((ubyte)text_alpha); + grtext_SetAlpha((uint8_t)text_alpha); rend_ClearScreen(GR_BLACK); rend_DrawChunkedBitmap(&Editor_bkg, 0, 0, 255); @@ -449,7 +449,7 @@ void FontKern(const char *fnt_file_name) { int tw,th; ASSERT(Font_template.kern_data); - ubyte *kern_data = &Font_template.kern_data[i*3]; + uint8_t *kern_data = &Font_template.kern_data[i*3]; if (i==current_pair) { rend_SetFlatColor(GR_RGB(255,0,0)); rend_DrawLine(x,y,x+6,y+5); @@ -503,11 +503,11 @@ void FontKernDump(const char *fnt_file_name) sprintf(filename, "%s.kern", fnt_file_name); fp = fopen(filename, "wt"); if (fp) { - ubyte *kern_data = Font_template.kern_data; + uint8_t *kern_data = Font_template.kern_data; while (kern_data[0] != 255) { - ubyte c1 = kern_data[0]; - ubyte c2 = kern_data[1]; + uint8_t c1 = kern_data[0]; + uint8_t c2 = kern_data[1]; int8_t delta = (int8_t)kern_data[2]; fprintf(fp, "%c %c => %d spacing\n", c1,c2,(int)delta); diff --git a/legacy/editor/BriefEdit.cpp b/legacy/editor/BriefEdit.cpp index d44d3e58..e7b9384d 100644 --- a/legacy/editor/BriefEdit.cpp +++ b/legacy/editor/BriefEdit.cpp @@ -238,7 +238,7 @@ void BriefEditFreeEffect(tBriefEffect *efx) efx->type = BE_NONE; } -void BuildMissionFlagMask(uint32_t mask,char *string,ubyte isset) +void BuildMissionFlagMask(uint32_t mask,char *string,uint8_t isset) { int counter = 0; int index = 0; @@ -262,7 +262,7 @@ void BuildMissionFlagMask(uint32_t mask,char *string,ubyte isset) // BriefEditSaveScreens // // Saves out the screens to a briefing file -ubyte BriefEditSaveScreens(char *filename,CComboBox *screen_combo,BriefGlobalValues *glob) +uint8_t BriefEditSaveScreens(char *filename,CComboBox *screen_combo,BriefGlobalValues *glob) { CFILE *file = cfopen(filename,"wt"); if(!file) @@ -361,7 +361,7 @@ ubyte BriefEditSaveScreens(char *filename,CComboBox *screen_combo,BriefGlobalVal strcpy(tempbuffer,"None"); } - ubyte red,green,blue; + uint8_t red,green,blue; red = GR_COLOR_RED(desc->color); green = GR_COLOR_GREEN(desc->color); blue = GR_COLOR_BLUE(desc->color); @@ -1094,7 +1094,7 @@ void BEAddVoice(char *filename,int flags,char *description) // BriefEditLoadScreens // // Loads in screens from a briefing file -ubyte BriefEditLoadScreens(char *filename,CComboBox *screen_combo,CComboBox *effect_combo,BriefGlobalValues *glob) +uint8_t BriefEditLoadScreens(char *filename,CComboBox *screen_combo,CComboBox *effect_combo,BriefGlobalValues *glob) { BEParseInfo.current_screen = 0; BEParseInfo.title[0] = '\0'; diff --git a/legacy/editor/BriefEdit.h b/legacy/editor/BriefEdit.h index aaa23dcc..9f9a17c0 100644 --- a/legacy/editor/BriefEdit.h +++ b/legacy/editor/BriefEdit.h @@ -56,7 +56,7 @@ typedef struct{ // // struct for a briefing effect typedef struct{ - ubyte type; //type of effect (for union) + uint8_t type; //type of effect (for union) bool used; //is the effect being used int id; //ID# used char *text; //buffer of text @@ -116,12 +116,12 @@ void BriefEditFreeEffect(tBriefEffect *efx); // BriefEditSaveScreens // // Saves out the screens to a briefing file -ubyte BriefEditSaveScreens(char *filename,CComboBox *screen_combo,BriefGlobalValues *glob); +uint8_t BriefEditSaveScreens(char *filename,CComboBox *screen_combo,BriefGlobalValues *glob); // BriefEditLoadScreens // // Loads in screens from a briefing file -ubyte BriefEditLoadScreens(char *filename,CComboBox *screen_combo,CComboBox *effect_combo,BriefGlobalValues *glob); +uint8_t BriefEditLoadScreens(char *filename,CComboBox *screen_combo,CComboBox *effect_combo,BriefGlobalValues *glob); #define MAX_LAYOUT_PREDEFS 10 diff --git a/legacy/editor/DallasMainDlg.cpp b/legacy/editor/DallasMainDlg.cpp index ce2c3a93..060f2217 100644 --- a/legacy/editor/DallasMainDlg.cpp +++ b/legacy/editor/DallasMainDlg.cpp @@ -9645,13 +9645,13 @@ int CDallasMainDlg::CreateScriptFile(char *filename) O(("#endif")); O(("char STDCALL InitializeDLL(tOSIRISModuleInit *func_list);")); O(("void STDCALL ShutdownDLL(void);")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte is_door);")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t is_door);")); O(("void STDCALLPTR CreateInstance(int id);")); O(("void STDCALL DestroyInstance(int id,void *ptr);")); O(("short STDCALL CallInstanceEvent(int id,void *ptr,int event,tOSIRISEventInfo *data);")); O(("int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face );")); O(("int STDCALL GetCOScriptList( int **list, int **id_list );")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state );")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state );")); O(("#ifdef __cplusplus")); O(("}")); O(("#endif")); @@ -10060,7 +10060,7 @@ int CDallasMainDlg::CreateScriptFile(char *filename) O(("// ===============")); O(("// GetGOScriptID()")); O(("// ===============")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte isdoor)")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t isdoor)")); O(("{")); O((" return -1;")); O(("}")); @@ -10173,7 +10173,7 @@ int CDallasMainDlg::CreateScriptFile(char *filename) O(("// ==================")); O(("// SaveRestoreState()")); O(("// ==================")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state )")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state )")); O(("{")); O((" return 0;")); O(("}")); diff --git a/legacy/editor/EPath.cpp b/legacy/editor/EPath.cpp index 243f7d38..b7dc8fd9 100644 --- a/legacy/editor/EPath.cpp +++ b/legacy/editor/EPath.cpp @@ -82,7 +82,7 @@ #include "object.h" #include "findintersection.h" -ubyte Show_paths = 1; +uint8_t Show_paths = 1; // Allocs a gamepath that a robot will follow. Returns an index into the GamePaths // array diff --git a/legacy/editor/EPath.h b/legacy/editor/EPath.h index d64ae712..d2cb00e9 100644 --- a/legacy/editor/EPath.h +++ b/legacy/editor/EPath.h @@ -39,7 +39,7 @@ #include "vecmat.h" #include "gamepath.h" -extern ubyte Show_paths; +extern uint8_t Show_paths; // Allocs a gamepath that a robot will follow. Returns an index into the GamePaths // array diff --git a/legacy/editor/Erooms.cpp b/legacy/editor/Erooms.cpp index bae8f56f..fdf89d01 100644 --- a/legacy/editor/Erooms.cpp +++ b/legacy/editor/Erooms.cpp @@ -1043,7 +1043,7 @@ int AllocLoadRoom (char *filename,bool bCenter,bool palette_room) for (i=0;inum_faces;i++) { - ubyte light_multiple=4; + uint8_t light_multiple=4; if (room_version>=4) light_multiple=cf_ReadByte(infile); @@ -3203,7 +3203,7 @@ int FindConnectedFace(room *rp,int facenum,int edgenum,int startface) //Writes errors to the error buffer int ComputeRoomShell(room *rp) { - ubyte shell_flags[MAX_FACES_PER_ROOM]; + uint8_t shell_flags[MAX_FACES_PER_ROOM]; bool done=0; int errors=0; int f; diff --git a/legacy/editor/GrFontDialog.cpp b/legacy/editor/GrFontDialog.cpp index 65d12bf1..4cd431a3 100644 --- a/legacy/editor/GrFontDialog.cpp +++ b/legacy/editor/GrFontDialog.cpp @@ -113,7 +113,7 @@ inline int WRITE_FONT_SHORT(FONTFILE ffile, short s) { return fwrite(&s, sizeof(s), 1, (FILE *)ffile); } -inline int WRITE_FONT_BYTE(FONTFILE ffile, ubyte c) { +inline int WRITE_FONT_BYTE(FONTFILE ffile, uint8_t c) { return fwrite(&c, sizeof(c), 1, (FILE *)ffile); } @@ -488,7 +488,7 @@ BOOL CGrFontDialog::extract_font(gr_font_file_record *ft) ft->baseline = m_CharHeight; ft->min_ascii = 0; ft->max_ascii = cur_char-1; - ft->raw_data = (ubyte *)m_DataBuffer; + ft->raw_data = (uint8_t *)m_DataBuffer; ft->char_data = NULL; ft->char_widths = m_CharWidths; ft->kern_data= NULL; @@ -619,9 +619,9 @@ int CGrFontDialog::read_font_char(int cur_char, int& bmx, int& bmy) BOOL CGrFontDialog::save_font_file(gr_font_file_record *ft) { - ubyte *tmp_data; + uint8_t *tmp_data; short *tmp_widths; - ubyte **tmp_cdata; + uint8_t **tmp_cdata; FONTFILE ffile; uint32_t id = 0xfeedbaba; int num_char; @@ -681,21 +681,21 @@ BOOL CGrFontDialog::save_font_file(gr_font_file_record *ft) if (ft->flags & FT_COLOR) { WRITE_FONT_INT(ffile, (int)(m_DataPtr-m_DataBuffer)*sizeof(ushort)); - WRITE_FONT_DATA(ffile, (ubyte *)m_DataBuffer, (m_DataPtr-m_DataBuffer)*sizeof(ushort), 1); + WRITE_FONT_DATA(ffile, (uint8_t *)m_DataBuffer, (m_DataPtr-m_DataBuffer)*sizeof(ushort), 1); } else { // bitpack for mono font storage:: 16bpp -> 8 bits/1 byte int i,x,y,w,cnt=0; ushort *p = m_DataBuffer; - ubyte *bits; + uint8_t *bits; - bits = (ubyte *)mem_malloc(256 * MAX_FONT_CHARS); + bits = (uint8_t *)mem_malloc(256 * MAX_FONT_CHARS); for (i = 0; i < num_char; i++) { for (y = 0; y < ft->height; y++) { - ubyte mask, datum; + uint8_t mask, datum; w = (ft->flags & FT_PROPORTIONAL) ? tmp_widths[i] : ft->width; diff --git a/legacy/editor/GrFontDialog.h b/legacy/editor/GrFontDialog.h index d532682b..17dffa1a 100644 --- a/legacy/editor/GrFontDialog.h +++ b/legacy/editor/GrFontDialog.h @@ -118,5 +118,5 @@ private: ushort m_BgColor, m_BoxColor; ushort m_FgColor; BOOL m_FontProp; // Proportional font. - ubyte m_Brightness; // brightness * 10 + uint8_t m_Brightness; // brightness * 10 }; diff --git a/legacy/editor/Group.cpp b/legacy/editor/Group.cpp index 1a07865e..6134f9a4 100644 --- a/legacy/editor/Group.cpp +++ b/legacy/editor/Group.cpp @@ -675,7 +675,7 @@ void SaveGroup(char *filename,group *g) return; //Write tag & version number - cf_WriteBytes((ubyte *) GROUP_FILE_TAG,4,ifile); + cf_WriteBytes((uint8_t *) GROUP_FILE_TAG,4,ifile); cf_WriteInt(ifile,GROUP_FILE_VERSION); cf_WriteInt(ifile,LEVEL_FILE_VERSION); @@ -750,7 +750,7 @@ group *LoadGroup(char *filename) return NULL; //Read & check tag - cf_ReadBytes((ubyte *) tag,4,ifile); + cf_ReadBytes((uint8_t *) tag,4,ifile); if (strncmp(tag,GROUP_FILE_TAG,4)) { cfclose(ifile); return NULL; diff --git a/legacy/editor/HFile.cpp b/legacy/editor/HFile.cpp index 7db31dbb..da2ceee3 100644 --- a/legacy/editor/HFile.cpp +++ b/legacy/editor/HFile.cpp @@ -690,7 +690,7 @@ void ShowLevelStats() int num_redgoals=0,num_bluegoals=0,num_greengoals=0,num_yellowgoals=0; int num_sp1=0,num_sp2=0,num_sp3=0,num_sp4=0,num_sp5=0,num_sp6=0; - ubyte lightmaps_used[MAX_LIGHTMAPS]; + uint8_t lightmaps_used[MAX_LIGHTMAPS]; object *objp; #define BUF_LEN 5000 diff --git a/legacy/editor/HRoom.cpp b/legacy/editor/HRoom.cpp index 828add3e..04f38d21 100644 --- a/legacy/editor/HRoom.cpp +++ b/legacy/editor/HRoom.cpp @@ -2096,7 +2096,7 @@ int FindNeighbor(room *rp,int facenum,int edgenum) return -1; } -void PropagateFromFace(room *rp,int facenum,ubyte *face_flags,bool matching_faces_only) +void PropagateFromFace(room *rp,int facenum,uint8_t *face_flags,bool matching_faces_only) { face *fp = &rp->faces[facenum]; @@ -2119,7 +2119,7 @@ void PropagateFromFace(room *rp,int facenum,ubyte *face_flags,bool matching_face //If matching_faces_only is set, only propagate if the face has the same texture void PropagateToAllFaces(room *rp,int facenum,bool matching_faces_only) { - ubyte face_flags[MAX_FACES_PER_ROOM]; + uint8_t face_flags[MAX_FACES_PER_ROOM]; //Clear flags for (int i=0;inum_faces;i++) diff --git a/legacy/editor/LevelDialog.cpp b/legacy/editor/LevelDialog.cpp index 0ec5e42b..93a7bf8c 100644 --- a/legacy/editor/LevelDialog.cpp +++ b/legacy/editor/LevelDialog.cpp @@ -104,7 +104,7 @@ BOOL CLevelDialog::OnInitDialog() if (N_selected_rooms) { room *rp = &Rooms[Selected_rooms[0]]; int amb_sound = rp->ambient_sound; - ubyte env_preset = rp->env_reverb; + uint8_t env_preset = rp->env_reverb; for (i = 1; i < N_selected_rooms; i++) { @@ -156,7 +156,7 @@ void CLevelDialog::OnOK() if (cbox->GetCurSel() != CB_ERR) { - ubyte env_reverb=0; + uint8_t env_reverb=0; cbox->GetLBText(cbox->GetCurSel(), selection); for (i = 0; i < N_ENVAUDIO_PRESETS; i++) diff --git a/legacy/editor/LightingDialog.cpp b/legacy/editor/LightingDialog.cpp index 6628cce3..0a3fffdc 100644 --- a/legacy/editor/LightingDialog.cpp +++ b/legacy/editor/LightingDialog.cpp @@ -568,7 +568,7 @@ void CLightingDialog::UpdateDialog() sprintf (str,"%f",aval); ebox->SetWindowText (str); - ubyte pval=Curroomp->pulse_time; + uint8_t pval=Curroomp->pulse_time; ebox=(CEdit *) GetDlgItem (IDC_PULSE_TIME_EDIT); sprintf (str,"%d",pval); diff --git a/legacy/editor/MegacellDialog.cpp b/legacy/editor/MegacellDialog.cpp index 04e461ae..a3430cee 100644 --- a/legacy/editor/MegacellDialog.cpp +++ b/legacy/editor/MegacellDialog.cpp @@ -372,7 +372,7 @@ void CMegacellDialog::OnDeleteMegacell() // Now delete those textures if need be if (answer==IDYES) { - ubyte can_delete[MAX_MEGACELL_WIDTH*MAX_MEGACELL_HEIGHT]; + uint8_t can_delete[MAX_MEGACELL_WIDTH*MAX_MEGACELL_HEIGHT]; memset (can_delete,0,MAX_MEGACELL_WIDTH*MAX_MEGACELL_HEIGHT); diff --git a/legacy/editor/ObjectDialog.cpp b/legacy/editor/ObjectDialog.cpp index b234c82e..b87127aa 100644 --- a/legacy/editor/ObjectDialog.cpp +++ b/legacy/editor/ObjectDialog.cpp @@ -705,7 +705,7 @@ void CObjectDialog::OnObjmovePH() int CObjectDialog::GetFreePlayerIndex() { - ubyte slots[MAX_NET_PLAYERS]; + uint8_t slots[MAX_NET_PLAYERS]; memset (slots,0,MAX_NET_PLAYERS); diff --git a/legacy/editor/ProceduralDialog.cpp b/legacy/editor/ProceduralDialog.cpp index df83c57a..ac37c098 100644 --- a/legacy/editor/ProceduralDialog.cpp +++ b/legacy/editor/ProceduralDialog.cpp @@ -165,7 +165,7 @@ BOOL CProceduralDialog::OnInitDialog() // EXCEPTION: OCX Property Pages should return FALSE } -void CProceduralDialog::PrintValue (int whichbox,ubyte val) +void CProceduralDialog::PrintValue (int whichbox,uint8_t val) { CEdit *ebox; char str[255]; @@ -522,7 +522,7 @@ void CProceduralDialog::OnProceduralUpdate() } -void CProceduralDialog::HarvestValue(int whichbox,ubyte *val) +void CProceduralDialog::HarvestValue(int whichbox,uint8_t *val) { CEdit *ebox; char name[20]; @@ -546,7 +546,7 @@ void CProceduralDialog::OnImportPalette() { CFILE *infile; char filename[255]; - ubyte r[256],g[256],b[256]; + uint8_t r[256],g[256],b[256]; int n=D3EditState.texdlg_texture; CString filter = "PCX files (*.pcx)|*.pcx||"; diff --git a/legacy/editor/ProceduralDialog.h b/legacy/editor/ProceduralDialog.h index 370b580a..766713b7 100644 --- a/legacy/editor/ProceduralDialog.h +++ b/legacy/editor/ProceduralDialog.h @@ -81,8 +81,8 @@ private: void UpdateDialog(void); void UpdateProcView(void); void MakeCurColor (void); - void HarvestValue (int,ubyte *); - void PrintValue (int,ubyte); + void HarvestValue (int,uint8_t *); + void PrintValue (int,uint8_t); static_proc_element *CreateElement(int,int); private: @@ -93,9 +93,9 @@ private: int m_button_down; int m_proc_type; int m_save_x,m_save_y; - ubyte m_cur_color; - ubyte m_speed,m_saturate,m_frequency; - ubyte m_size; + uint8_t m_cur_color; + uint8_t m_speed,m_saturate,m_frequency; + uint8_t m_size; }; //{{AFX_INSERT_LOCATION}} diff --git a/legacy/editor/Read3ds.cpp b/legacy/editor/Read3ds.cpp index df99f11c..a05be295 100644 --- a/legacy/editor/Read3ds.cpp +++ b/legacy/editor/Read3ds.cpp @@ -151,9 +151,9 @@ material Materials[MAX_MATERIALS]; typedef struct reading_face { - ubyte flags; // flags for this face (see above) + uint8_t flags; // flags for this face (see above) short portal_num; // which portal this face is part of, or -1 if none - ubyte num_verts; // how many vertices in this face + uint8_t num_verts; // how many vertices in this face short face_verts[MAX_VERTS_PER_FACE]; // index into list of vertices for this face roomUVL face_uvls[MAX_VERTS_PER_FACE]; // index into list of uvls for this face vector normal; // the surface normal of this face diff --git a/legacy/editor/ScriptCompilerAPI.cpp b/legacy/editor/ScriptCompilerAPI.cpp index dbc69a85..e2f3f63b 100644 --- a/legacy/editor/ScriptCompilerAPI.cpp +++ b/legacy/editor/ScriptCompilerAPI.cpp @@ -303,7 +303,7 @@ int ScriptCompile(tCompilerInfo *ci) bool ScriptCreateEmptyLevelScript(char *filename); bool ScriptCreateEmptyGameScript(char *filename); -bool ScriptCreateEmptyScript(char *filename,ubyte script_type) +bool ScriptCreateEmptyScript(char *filename,uint8_t script_type) { if(cfexist(filename)){ char buffer[512]; @@ -369,13 +369,13 @@ bool ScriptCreateEmptyLevelScript(char *filename) O(("#endif")); O(("char STDCALL InitializeDLL(tOSIRISModuleInit *func_list);")); O(("void STDCALL ShutdownDLL(void);")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte is_door);")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t is_door);")); O(("void STDCALLPTR CreateInstance(int id);")); O(("void STDCALL DestroyInstance(int id,void *ptr);")); O(("short STDCALL CallInstanceEvent(int id,void *ptr,int event,tOSIRISEventInfo *data);")); O(("int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face );")); O(("int STDCALL GetCOScriptList( int **list, int **id_list );")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state );")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state );")); O(("#ifdef __cplusplus")); O(("}")); O(("#endif")); @@ -442,7 +442,7 @@ bool ScriptCreateEmptyLevelScript(char *filename) O(("// door, else it is a 0. The return value is the unique identifier, else -1 if the script")); O(("// does not exist in the DLL.")); O(("// The only reserved ID is 0, which must be used for the level script")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte isdoor)")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t isdoor)")); O(("{")); O((" return -1;")); O(("}")); @@ -527,7 +527,7 @@ bool ScriptCreateEmptyLevelScript(char *filename) O(("// able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE")); O(("// TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should")); O(("// write data to the file_ptr, 0 when you should read in the data.")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state )")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state )")); O(("{")); O((" return 0;")); O(("}")); @@ -568,11 +568,11 @@ bool ScriptCreateEmptyGameScript(char *filename) O(("#endif")); O(("char STDCALL InitializeDLL(tOSIRISModuleInit *func_list);")); O(("void STDCALL ShutdownDLL(void);")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte isdoor);")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t isdoor);")); O(("void STDCALLPTR CreateInstance(int id);")); O(("void STDCALL DestroyInstance(int id,void *ptr);")); O(("short STDCALL CallInstanceEvent(int id,void *ptr,int event,tOSIRISEventInfo *data);")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state );")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state );")); O(("#ifdef __cplusplus")); O(("}")); O(("#endif")); @@ -638,7 +638,7 @@ bool ScriptCreateEmptyGameScript(char *filename) O(("// or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a")); O(("// door, else it is a 0. The return value is the unique identifier, else -1 if the script")); O(("// does not exist in the DLL.")); - O(("int STDCALL GetGOScriptID(const char *name,ubyte isdoor)")); + O(("int STDCALL GetGOScriptID(const char *name,uint8_t isdoor)")); O(("{")); O((" return -1;")); O(("}")); @@ -694,7 +694,7 @@ bool ScriptCreateEmptyGameScript(char *filename) O(("// able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE")); O(("// TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should")); O(("// write data to the file_ptr, 0 when you should read in the data.")); - O(("int STDCALL SaveRestoreState( void *file_ptr, ubyte saving_state )")); + O(("int STDCALL SaveRestoreState( void *file_ptr, uint8_t saving_state )")); O(("{")); O((" return 0;")); O(("}")); diff --git a/legacy/editor/ScriptCompilerAPI.h b/legacy/editor/ScriptCompilerAPI.h index 8c3f3ffd..63376420 100644 --- a/legacy/editor/ScriptCompilerAPI.h +++ b/legacy/editor/ScriptCompilerAPI.h @@ -47,7 +47,7 @@ #define ST_GAME 1 typedef struct{ char source_filename[_MAX_PATH]; - ubyte script_type; + uint8_t script_type; void (*callback)(char *str); }tCompilerInfo; @@ -58,5 +58,5 @@ typedef struct{ int ScriptCompile(tCompilerInfo *ci); -bool ScriptCreateEmptyScript(char *filename,ubyte script_type); +bool ScriptCreateEmptyScript(char *filename,uint8_t script_type); #endif diff --git a/legacy/editor/ScriptLevelInterface.cpp b/legacy/editor/ScriptLevelInterface.cpp index c37f9a53..9d55a15c 100644 --- a/legacy/editor/ScriptLevelInterface.cpp +++ b/legacy/editor/ScriptLevelInterface.cpp @@ -475,7 +475,7 @@ void CScriptLevelInterface::OnCloseupSelectedScript() strcpy(LastScriptSelected,buffer); - ubyte type = DetermineScriptType(buffer); + uint8_t type = DetermineScriptType(buffer); switch(type){ case ST_GAME: diff --git a/legacy/editor/ScriptMassCompile.cpp b/legacy/editor/ScriptMassCompile.cpp index d158cb2f..306a9956 100644 --- a/legacy/editor/ScriptMassCompile.cpp +++ b/legacy/editor/ScriptMassCompile.cpp @@ -236,7 +236,7 @@ void writeline(char *format, ... ) } -ubyte DetermineScriptType(char *filename) +uint8_t DetermineScriptType(char *filename) { CFILE *file; file = cfopen(filename,"rt"); @@ -246,7 +246,7 @@ ubyte DetermineScriptType(char *filename) char buffer[4096]; bool done = false; - ubyte script_type = ST_GAME; + uint8_t script_type = ST_GAME; cf_ReadString(buffer,4096,file); while(!(cfeof(file) || done)){ diff --git a/legacy/editor/ScriptMassCompile.h b/legacy/editor/ScriptMassCompile.h index fdeb1e7e..5d605b47 100644 --- a/legacy/editor/ScriptMassCompile.h +++ b/legacy/editor/ScriptMassCompile.h @@ -68,7 +68,7 @@ // CScriptMassCompile dialog #include "pstypes.h" -ubyte DetermineScriptType(char *filename); +uint8_t DetermineScriptType(char *filename); class CScriptMassCompile : public CDialog { diff --git a/legacy/editor/ScriptSyncDialog.cpp b/legacy/editor/ScriptSyncDialog.cpp index d454e395..77d211f0 100644 --- a/legacy/editor/ScriptSyncDialog.cpp +++ b/legacy/editor/ScriptSyncDialog.cpp @@ -43,7 +43,7 @@ bool ManageFindFirst(char *buffer,char *wildcard); bool ManageFindNext(char *buffer); void ManageFindClose(void); -ubyte DetermineScriptType(char *filename); +uint8_t DetermineScriptType(char *filename); // returns true if the given .cpp file is has an out of date dll (or non-existant). Working // dir MUST be set to data\scripts before calling this function diff --git a/legacy/editor/TableFileFilterMng.cpp b/legacy/editor/TableFileFilterMng.cpp index 5c042836..bc42734b 100644 --- a/legacy/editor/TableFileFilterMng.cpp +++ b/legacy/editor/TableFileFilterMng.cpp @@ -236,7 +236,7 @@ bool PageDataNode::operator < (const PageDataNode &node) bool PageDataNode::Load(CFILE *infile) { cf_ReadString(name,PAGENAME_LEN,infile); - type=(ubyte)cf_ReadByte(infile); + type=(uint8_t)cf_ReadByte(infile); flags=cf_ReadInt(infile); tag_count=cf_ReadInt(infile); @@ -405,7 +405,7 @@ UpdateControls: // Creates a new node and adds it to the list (if not already in it) -bool PageDataList::AddToList(char *page_name, ubyte page_type, int page_flags) +bool PageDataList::AddToList(char *page_name, uint8_t page_type, int page_flags) { PageDataNode *new_node, *found_node; CWaitCursor wc; @@ -451,7 +451,7 @@ bool PageDataList::AddToList(char *page_name, ubyte page_type, int page_flags) // Searches for and removes matching node from the list -bool PageDataList::RemoveFromList(char *page_name, ubyte page_type) +bool PageDataList::RemoveFromList(char *page_name, uint8_t page_type) { int index; LVFINDINFO find_info; @@ -666,7 +666,7 @@ bool PageDataList::SaveList(char *list_filename) // Scans the list for a certain page, and returns a pointer to the // matching data node (or NULL if not found) -PageDataNode *PageDataList::FindNode(char *page_name, ubyte page_type) +PageDataNode *PageDataList::FindNode(char *page_name, uint8_t page_type) { PageDataNode *node, *found_node; @@ -820,7 +820,7 @@ bool PageDataList::ProcessPagesForLevel(char *level_filename, int process_type) // Either adds the given level page to the list, or removes it -bool PageDataList::ProcessPage(char *page_name, ubyte page_type, int process_type, int flags) +bool PageDataList::ProcessPage(char *page_name, uint8_t page_type, int process_type, int flags) { CWaitCursor wc; @@ -1469,7 +1469,7 @@ bool PageDataList::DetermineRequiredPages(int process_type) bool PageDataList::CreateNewTableFile(char *new_table_filename, char *src_table_filename) { CFILE *infile,*outfile; - ubyte pagetype,replaced=0; + uint8_t pagetype,replaced=0; int done=0,len; int pages_written; PageDataNode *node; @@ -1863,7 +1863,7 @@ void PageDataList::SetTitleString(void) // Adds a page specified by the "Add Page" button -bool PageDataList::AddPageFromUser(char *page_name, ubyte page_type) +bool PageDataList::AddPageFromUser(char *page_name, uint8_t page_type) { int id; switch(page_type) { @@ -1918,7 +1918,7 @@ bool PageDataList::AddPageFromUser(char *page_name, ubyte page_type) // Returns the pagetype for a given string (PAGETYPE_UNKNOWN if not valid) -ubyte PageDataList::GetPageTypeFromString(char *text) +uint8_t PageDataList::GetPageTypeFromString(char *text) { int type; @@ -1945,7 +1945,7 @@ ubyte PageDataList::GetPageTypeFromString(char *text) // Processes a page read in from text file -bool PageDataList::ProcessPageFromFile(char *page_name, ubyte page_type, int process_type) +bool PageDataList::ProcessPageFromFile(char *page_name, uint8_t page_type, int process_type) { char ext[12]; int id; @@ -2036,7 +2036,7 @@ bool PageDataList::ProcessPagesInTextFile(char *filename, int process_type) int linenum; char *pagename; - ubyte pagetype; + uint8_t pagetype; char *pagetype_text; CString pages_not_added; diff --git a/legacy/editor/TableFileFilterMng.h b/legacy/editor/TableFileFilterMng.h index 0a5f88d2..0be0d2ec 100644 --- a/legacy/editor/TableFileFilterMng.h +++ b/legacy/editor/TableFileFilterMng.h @@ -54,7 +54,7 @@ private: PageDataNode *next; // The page data - ubyte type; // stores the page type + uint8_t type; // stores the page type char name[PAGENAME_LEN]; // stores the page name int flags; // Stores whether file was added from level (or just added as extra) @@ -109,10 +109,10 @@ public: void ClearList(void); bool AddToList(PageDataNode *node); - bool AddToList(char *page_name, ubyte page_type, int page_flags); + bool AddToList(char *page_name, uint8_t page_type, int page_flags); bool RemoveFromList(PageDataNode *goner_node); - bool RemoveFromList(char *page_name, ubyte page_type); - PageDataNode *FindNode(char *page_name, ubyte page_type); + bool RemoveFromList(char *page_name, uint8_t page_type); + PageDataNode *FindNode(char *page_name, uint8_t page_type); bool LoadList(char *list_filename); bool SaveList(char *list_filename); @@ -122,7 +122,7 @@ public: bool ProcessPagesForLevel(char *level_filename, int process_type); bool DetermineRequiredPages(int process_type); - bool ProcessPage(char *page_name, ubyte page_type, int process_type, int flags=ADDED_FOR_LEVEL_FLAG); + bool ProcessPage(char *page_name, uint8_t page_type, int process_type, int flags=ADDED_FOR_LEVEL_FLAG); void AddTexturePage (int id,int process_type); void AddSoundPage (int id,int process_type); @@ -131,10 +131,10 @@ public: void AddDoorPage (int id,int process_type); void AddShipPage (int id,int process_type); - bool AddPageFromUser(char *page_name, ubyte page_type); + bool AddPageFromUser(char *page_name, uint8_t page_type); bool ProcessPagesInTextFile(char *filename, int process_type); - bool ProcessPageFromFile(char *page_name, ubyte page_type, int process_type); - ubyte GetPageTypeFromString(char *text); + bool ProcessPageFromFile(char *page_name, uint8_t page_type, int process_type); + uint8_t GetPageTypeFromString(char *text); bool CreateNewTableFile(char *new_table_filename, char *src_table_filename); diff --git a/legacy/editor/TableManage.cpp b/legacy/editor/TableManage.cpp index 113fc65e..4d34ddea 100644 --- a/legacy/editor/TableManage.cpp +++ b/legacy/editor/TableManage.cpp @@ -162,7 +162,7 @@ bool GenericPageList::AddToList(GenericPageNode *new_node) bool GenericPageList::LoadTable (char *table_filename) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done; uint32_t page_id; @@ -227,7 +227,7 @@ bool GenericPageList::LoadTable (char *table_filename) bool GenericPageList::SaveTable (char *table_filename) { CFILE *infile,*outfile; - ubyte pagetype,replaced=0; + uint8_t pagetype,replaced=0; int done=0; uint32_t page_id; GenericPageNode *new_generic_page; diff --git a/legacy/editor/TerrainDialog.cpp b/legacy/editor/TerrainDialog.cpp index 49b5a1c8..0d4ab572 100644 --- a/legacy/editor/TerrainDialog.cpp +++ b/legacy/editor/TerrainDialog.cpp @@ -658,7 +658,7 @@ void CTerrainDialog::OnTerrpadSelectNone() void CTerrainDialog::OnTerrpadRotTexture() { int i; - ubyte touched[TERRAIN_TEX_WIDTH*TERRAIN_TEX_DEPTH]; + uint8_t touched[TERRAIN_TEX_WIDTH*TERRAIN_TEX_DEPTH]; memset (touched,0,TERRAIN_TEX_WIDTH*TERRAIN_TEX_DEPTH); for (i=0;ib*3); - ubyte volume_color=r|g|b; + uint8_t volume_color=r|g|b; if (!UseVolumeLights) rp->volume_lights[(i*w*h)+(t*w)+j]=255; @@ -1007,7 +1007,7 @@ void DoRadiosityForRooms () Rooms[roomnum].volume_height=vh; Rooms[roomnum].volume_depth=vd; - Rooms[roomnum].volume_lights=(ubyte *)mem_malloc (vw*vh*vd); + Rooms[roomnum].volume_lights=(uint8_t *)mem_malloc (vw*vh*vd); ASSERT (Rooms[roomnum].volume_lights); Volume_elements[roomnum]=(volume_element *)mem_malloc ((vw*vh*vd)*sizeof(volume_element)); @@ -1678,9 +1678,9 @@ void SetRadClipLines (vector *tp,vector *rp,vector *bp,vector *lp) rad_ClipLeft=lp; } -ubyte CodeRadPoint (rad_point *rp) +uint8_t CodeRadPoint (rad_point *rp) { - ubyte code=0; + uint8_t code=0; if (rp->pos.xx) code |=CC_OFF_LEFT; if (rp->pos.x>rad_ClipRight->x) @@ -1699,8 +1699,8 @@ void ClipSurfaceElement (vector *surf_verts,rad_element *ep,vector *clip_verts,i rad_point src_verts[50]; rad_point dest_verts[50]; rad_point *slist,*dlist; - ubyte and=0xff; - ubyte or=0; + uint8_t and=0xff; + uint8_t or=0; int i; ASSERT (nv<50); @@ -2063,7 +2063,7 @@ void DoRadiosityForTerrain () for (i=0;inormal; vm_VectorToMatrix(&facematrix,&fvec,NULL,NULL); - sfp->normal_map=(ubyte *)mem_malloc (w*h*3); + sfp->normal_map=(uint8_t *)mem_malloc (w*h*3); ASSERT (sfp->normal_map); for (int i=0;i<(w*h);i++) @@ -3712,7 +3712,7 @@ void SetupSpecularLighting (int external) int t,k; int not_combined=0; - RoomsAlreadyCombined[roomnum]=(ubyte *)mem_malloc (Rooms[roomnum].num_faces); + RoomsAlreadyCombined[roomnum]=(uint8_t *)mem_malloc (Rooms[roomnum].num_faces); ASSERT (RoomsAlreadyCombined[roomnum]); for (k=0;knum_faces); + ObjectsAlreadyCombined[i]=(uint8_t *)mem_malloc (sm->num_faces); ASSERT (ObjectsAlreadyCombined[i]); for (k=0;knum_faces;k++) ObjectsAlreadyCombined[i][k]=0; diff --git a/legacy/editor/rad_cast.cpp b/legacy/editor/rad_cast.cpp index 2d05c7ad..74bfc651 100644 --- a/legacy/editor/rad_cast.cpp +++ b/legacy/editor/rad_cast.cpp @@ -860,7 +860,7 @@ void CalculateVolumeLightsForRay (float total_sphere_dist,vector *src_center) if (sphere_dist>.1) { fvi_face_room_list facelist[5000]; - ubyte check_room[MAX_VOLUME_ELEMENTS]; + uint8_t check_room[MAX_VOLUME_ELEMENTS]; memset (check_room,0,MAX_VOLUME_ELEMENTS); diff --git a/legacy/editor/rad_hemicube.cpp b/legacy/editor/rad_hemicube.cpp index ff85e165..2761d5b2 100644 --- a/legacy/editor/rad_hemicube.cpp +++ b/legacy/editor/rad_hemicube.cpp @@ -565,7 +565,7 @@ void DrawRadiosityPoly(int nv,g3Point **pointlist,int id) //Get codes for this polygon, and copy uvls into points for (i=0;ip3_codes; diff --git a/legacy/editor/radiosity.h b/legacy/editor/radiosity.h index 83675396..ca8f3e52 100644 --- a/legacy/editor/radiosity.h +++ b/legacy/editor/radiosity.h @@ -95,8 +95,8 @@ typedef struct vector *verts; spectra exitance; float area; - ubyte num_verts; - ubyte flags; // see above + uint8_t num_verts; + uint8_t flags; // see above } rad_element; #define VEF_REVERSE_SHOOT 1 @@ -105,7 +105,7 @@ typedef struct { spectra color; vector pos; - ubyte flags; + uint8_t flags; } volume_element; #define ST_ROOM 0 // This is a room surface @@ -125,28 +125,28 @@ typedef struct spectra emittance; spectra exitance; float reflectivity; // how much light bounces off - ubyte xresolution; // how many elements (resolution x resolution) for this face - ubyte yresolution; + uint8_t xresolution; // how many elements (resolution x resolution) for this face + uint8_t yresolution; rad_element *elements; // list of elements for this surface vector normal; // normal of this surface vector *verts; - ubyte surface_type; // See ST_ types above + uint8_t surface_type; // See ST_ types above int facenum; // facenumber of room int roomnum; // The roomnumber or terrain segment number - ubyte num_verts; - ubyte flags; + uint8_t num_verts; + uint8_t flags; float surface_area,element_area; - ubyte x1,y1,x2,y2; // Where in the lightmap our bounds are + uint8_t x1,y1,x2,y2; // Where in the lightmap our bounds are } rad_surface; typedef struct { vector pos; - ubyte code; + uint8_t code; } rad_point; diff --git a/legacy/editor/rotateroom.cpp b/legacy/editor/rotateroom.cpp index a423d189..4e1a29d6 100644 --- a/legacy/editor/rotateroom.cpp +++ b/legacy/editor/rotateroom.cpp @@ -212,7 +212,7 @@ void RotateRooms(angle p,angle h,angle b) //Parameters: dx,dy - how much to move the segment, releative to its right & up vectors void MoveFloatSegment(float dx,float dy) { - ubyte selected_vert[MAX_VERTICES]; + uint8_t selected_vert[MAX_VERTICES]; matrix segmat; vector deltav; int baseseg,baseside; diff --git a/legacy/hogedit/HogEditDoc.cpp b/legacy/hogedit/HogEditDoc.cpp index 5e7c1c4c..c52a46fe 100644 --- a/legacy/hogedit/HogEditDoc.cpp +++ b/legacy/hogedit/HogEditDoc.cpp @@ -823,7 +823,7 @@ int CHogEditDoc::CreateNewHogFromCurrentHog(char *src_hog_fname, char *target_ho } //write number of files - ubyte filler = 0xff; + uint8_t filler = 0xff; header.nfiles = (unsigned)nfiles; header.file_data_offset = strlen(HOG_TAG_STR) + HOG_HDR_SIZE + (sizeof(tHogFileEntry) * header.nfiles); @@ -842,7 +842,7 @@ int CHogEditDoc::CreateNewHogFromCurrentHog(char *src_hog_fname, char *target_ho // write out filler for(i=0; i < HOG_HDR_SIZE-sizeof(tHogHeader); i++) - if (!fwrite(&filler,sizeof(ubyte),1,hog_fp)) { + if (!fwrite(&filler,sizeof(uint8_t),1,hog_fp)) { delete[] table; fclose(hog_fp); strcpy(hogerr_filename,dest_hog_fname); diff --git a/legacy/hogmaker/hog.cpp b/legacy/hogmaker/hog.cpp index fbf13b02..1f00c381 100644 --- a/legacy/hogmaker/hog.cpp +++ b/legacy/hogmaker/hog.cpp @@ -186,7 +186,7 @@ int NewHogFile(const char *hogname, int nfiles, const char **filenames) } //write number of files - ubyte filler = 0xff; + uint8_t filler = 0xff; header.nfiles = (unsigned)nfiles; header.file_data_offset = strlen(HOG_TAG_STR) + HOG_HDR_SIZE + (sizeof(tHogFileEntry) * header.nfiles); @@ -200,7 +200,7 @@ int NewHogFile(const char *hogname, int nfiles, const char **filenames) fclose(hog_fp); return HOGMAKER_OUTFILE; } - if (!fwrite(&filler,sizeof(ubyte),HOG_HDR_SIZE-sizeof(tHogHeader),hog_fp)) { + if (!fwrite(&filler,sizeof(uint8_t),HOG_HDR_SIZE-sizeof(tHogHeader),hog_fp)) { delete[] table; fclose(hog_fp); return HOGMAKER_OUTFILE; diff --git a/legacy/mtclient/mt_net.cpp b/legacy/mtclient/mt_net.cpp index c5aa2300..376496b0 100644 --- a/legacy/mtclient/mt_net.cpp +++ b/legacy/mtclient/mt_net.cpp @@ -146,7 +146,7 @@ extern Debug_ConsolePrintf_fp DLLDebug_ConsolePrintf; typedef int (*nw_Asyncgethostbyname_fp) (uint32_t *ip,int command, char *hostname); extern nw_Asyncgethostbyname_fp DLLnw_Asyncgethostbyname; -typedef int (*nw_SendWithID_fp) (ubyte id,ubyte *data,int len,network_address *who_to); +typedef int (*nw_SendWithID_fp) (uint8_t id,uint8_t *data,int len,network_address *who_to); extern nw_SendWithID_fp DLLnw_SendWithID; typedef int (*PollUI_fp) (void); extern PollUI_fp DLLPollUI; @@ -163,7 +163,7 @@ int SendGameTrackerPacker(void *packet) send_address.port = htons(inaddr->sin_port); send_address.connection_type = NP_TCP; - return DLLnw_SendWithID(PXO_NETID_GAME_TRACKER,(ubyte *)g_pack,INTEL_INT(g_pack->len),&send_address); + return DLLnw_SendWithID(PXO_NETID_GAME_TRACKER,(uint8_t *)g_pack,INTEL_INT(g_pack->len),&send_address); } @@ -290,6 +290,6 @@ int SendPilotTrackerPacket(void *packet) memcpy(send_address.address,&inaddr->sin_addr, 4); send_address.port = htons(inaddr->sin_port); send_address.connection_type = NP_TCP; - return DLLnw_SendWithID(PXO_NETID_USER_TRACKER,(ubyte *)p_pack,INTEL_SHORT(p_pack->len),&send_address); + return DLLnw_SendWithID(PXO_NETID_USER_TRACKER,(uint8_t *)p_pack,INTEL_SHORT(p_pack->len),&send_address); } diff --git a/legacy/mtclient/mtclient.cpp b/legacy/mtclient/mtclient.cpp index 28ce8932..338d55d4 100644 --- a/legacy/mtclient/mtclient.cpp +++ b/legacy/mtclient/mtclient.cpp @@ -1194,7 +1194,7 @@ int MainMultiplayerMenu () for(i=0;imtype.phys_info.rotvel,3*sizeof(float)); size+=(sizeof(float)*3); @@ -1207,7 +1207,7 @@ void SendCollideInfo(object *pobj,object *wobj,int towho,vector *point,vector *n PBall.SendPacket(maxsize,towho); } -void GetCollideInfo(ubyte *data) +void GetCollideInfo(uint8_t *data) { int size = 0; vector rotvel,velocity,pos,point,normal; diff --git a/legacy/powerball/powerball.h b/legacy/powerball/powerball.h index 2d8d5263..73840bb8 100644 --- a/legacy/powerball/powerball.h +++ b/legacy/powerball/powerball.h @@ -103,15 +103,15 @@ DMFCApp PBall; // from a CPP file. extern "C" { - DLLEXPORT void DLLFUNCCALL DLLGameInit (int *api_func,ubyte *all_ok); + DLLEXPORT void DLLFUNCCALL DLLGameInit (int *api_func,uint8_t *all_ok); DLLEXPORT void DLLFUNCCALL DLLGameCall (int eventnum,dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose (); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo (tDLLOptions *options); - DLLEXPORT int DLLFUNCCALL GetGOScriptID(char *name,ubyte isdoor); + DLLEXPORT int DLLFUNCCALL GetGOScriptID(char *name,uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id,void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id,void *ptr,int event,tOSIRISEventInfo *data); - DLLEXPORT int DLLFUNCCALL SaveRestoreState( void *file_ptr, ubyte saving_state ); + DLLEXPORT int DLLFUNCCALL SaveRestoreState( void *file_ptr, uint8_t saving_state ); } // The main entry point where the game calls the dll @@ -135,7 +135,7 @@ void DLLFUNCCALL DLLGameCall (int eventnum,dllinfo *data) // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(char *name,ubyte isdoor) +int DLLFUNCCALL GetGOScriptID(char *name,uint8_t isdoor) { return -1; } @@ -187,7 +187,7 @@ short DLLFUNCCALL CallInstanceEvent(int id,void *ptr,int event,tOSIRISEventInfo // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState( void *file_ptr, ubyte saving_state ) +int DLLFUNCCALL SaveRestoreState( void *file_ptr, uint8_t saving_state ) { return 0; } diff --git a/legacy/renderer/Direct3D.cpp b/legacy/renderer/Direct3D.cpp index 96ebaf75..32316cdf 100644 --- a/legacy/renderer/Direct3D.cpp +++ b/legacy/renderer/Direct3D.cpp @@ -114,7 +114,7 @@ DDPIXELFORMAT TextureFormats[MAX_TEXTURE_FORMATS]; bool D3D_multitexture_state = false; bool D3D_bumpmap_state = false; -ubyte D3D_frame_started = 0; +uint8_t D3D_frame_started = 0; float d3d_FogDiff = 0; // For verifying the texture/alpha types before rendering @@ -1300,7 +1300,7 @@ bool d3d_UsingDX6() { DWORD dwType, dwLen; dwLen = 32; - lResult = RegQueryValueEx(hKey, "Version", NULL, &dwType, (ubyte *)version, &dwLen); + lResult = RegQueryValueEx(hKey, "Version", NULL, &dwType, (uint8_t *)version, &dwLen); if (lResult == ERROR_SUCCESS) { dx_version = atoi(strstr(version, ".") + 1); @@ -1309,7 +1309,7 @@ bool d3d_UsingDX6() { DWORD dwType, dwLen; dwLen = 4; - lResult = RegQueryValueEx(hKey, "InstalledVersion", NULL, &dwType, (ubyte *)&val, &dwLen); + lResult = RegQueryValueEx(hKey, "InstalledVersion", NULL, &dwType, (uint8_t *)&val, &dwLen); if (lResult == ERROR_SUCCESS) { @@ -2628,7 +2628,7 @@ void d3d_FillRect(ddgr_color color, int x1, int y1, int x2, int y2) { void d3d_SetPixel(ddgr_color color, int x, int y) {} // Sets the alpha value -void d3d_SetAlphaValue(ubyte val) { +void d3d_SetAlphaValue(uint8_t val) { D3D_state.cur_alpha = val; d3d_SetAlphaMultiplier(); } @@ -3112,7 +3112,7 @@ void d3d_ReleaseLFBLock(renderer_lfb *lfb) { d3d_lfb_locked = 0; } -ubyte d3d_Framebuffer_ready = 0; +uint8_t d3d_Framebuffer_ready = 0; ushort *d3d_Framebuffer_translate = NULL; // Gets a renderer ready for a framebuffer copy, or stops a framebuffer copy diff --git a/legacy/renderer/opengl.cpp b/legacy/renderer/opengl.cpp index 1b25d5f5..534f4b52 100644 --- a/legacy/renderer/opengl.cpp +++ b/legacy/renderer/opengl.cpp @@ -65,7 +65,7 @@ extern int WindowGL; /* #ifndef NDEBUG GLenum GL_error_code; - const ubyte *GL_error_string; + const uint8_t *GL_error_string; #define CHECK_ERROR(x) { GL_error_code=dglGetError ();\ if (GL_error_code!=GL_NO_ERROR)\ {\ @@ -144,13 +144,13 @@ static float OpenGL_Alpha_factor = 1.0f; // This is for the Microsoft OpenGL reference driver // Setting this will turn off bilinear filtering and zbuffer so we can get decent // framerates to discern driver problems -static ubyte Fast_test_render = 0; +static uint8_t Fast_test_render = 0; #endif ushort *OpenGL_bitmap_remap; ushort *OpenGL_lightmap_remap; -ubyte *OpenGL_bitmap_states; -ubyte *OpenGL_lightmap_states; +uint8_t *OpenGL_bitmap_states; +uint8_t *OpenGL_lightmap_states; uint32_t *opengl_Upload_data = NULL; uint32_t *opengl_Translate_table = NULL; @@ -243,7 +243,7 @@ void opengl_GetInformation() { /* #ifndef RELEASE // If this is the microsoft driver, then make stuff go faster - const ubyte *renderer=dglGetString(GL_RENDERER); + const uint8_t *renderer=dglGetString(GL_RENDERER); if (!(strnicmp ((const char *)renderer,"GDI",3))) Fast_test_render=1; else @@ -285,9 +285,9 @@ int opengl_InitCache() { OpenGL_lightmap_remap = (ushort *)mem_malloc(MAX_LIGHTMAPS * 2); ASSERT(OpenGL_lightmap_remap); - OpenGL_bitmap_states = (ubyte *)mem_malloc(MAX_BITMAPS); + OpenGL_bitmap_states = (uint8_t *)mem_malloc(MAX_BITMAPS); ASSERT(OpenGL_bitmap_states); - OpenGL_lightmap_states = (ubyte *)mem_malloc(MAX_LIGHTMAPS); + OpenGL_lightmap_states = (uint8_t *)mem_malloc(MAX_LIGHTMAPS); ASSERT(OpenGL_lightmap_states); Cur_texture_object_num = 1; @@ -2242,7 +2242,7 @@ void opengl_SetZBufferWriteMask(int state) { void opengl_SetFlatColor(ddgr_color color) { OpenGL_state.cur_color = color; } // Sets the constant alpha value -void opengl_SetAlphaValue(ubyte val) { +void opengl_SetAlphaValue(uint8_t val) { OpenGL_state.cur_alpha = val; opengl_SetAlphaMultiplier(); } @@ -2431,7 +2431,7 @@ void opengl_ResetCache() { opengl_InitCache(); } -ubyte opengl_Framebuffer_ready = 0; +uint8_t opengl_Framebuffer_ready = 0; chunked_bitmap opengl_Chunked_bitmap; void opengl_ChangeChunkedBitmap(int bm_handle, chunked_bitmap *chunk) { diff --git a/legacy/renderer/renderer.cpp b/legacy/renderer/renderer.cpp index 45efdcaf..39795a11 100644 --- a/legacy/renderer/renderer.cpp +++ b/legacy/renderer/renderer.cpp @@ -474,9 +474,9 @@ bool UseMultitexture = 0; bool UseWBuffer = 0; int Overlay_map = -1; int Bump_map = 0, Bumpmap_ready = 0; -ubyte Overlay_type = OT_NONE; +uint8_t Overlay_type = OT_NONE; float Z_bias = 0.0; -ubyte Renderer_close_flag = 0, Renderer_initted = 0; +uint8_t Renderer_close_flag = 0, Renderer_initted = 0; // Is this hardware or software rendered? renderer_type Renderer_type = RENDERER_SOFTWARE_16BIT; // Tells the software renderer whether or not to use mipping @@ -1006,7 +1006,7 @@ void rend_DrawScaledBitmap(int x1, int y1, int x2, int y2, int bm, float u0, flo } } // Sets where the software renderer should write to -void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, ubyte *framebuffer) { +void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, uint8_t *framebuffer) { switch (Renderer_type) { case RENDERER_SOFTWARE_16BIT: case RENDERER_SOFTWARE_8BIT: @@ -1103,7 +1103,7 @@ void rend_SetZValues(float nearz, float farz) { // Sets a bitmap as a overlay map to rendered on top of the next texture map // a -1 value indicates no overlay map void rend_SetOverlayMap(int handle) { Overlay_map = handle; } -void rend_SetOverlayType(ubyte type) { Overlay_type = type; } +void rend_SetOverlayType(uint8_t type) { Overlay_type = type; } // Clears the display to a specified color void rend_ClearScreen(ddgr_color color) { switch (Renderer_type) { @@ -1424,7 +1424,7 @@ void rend_SetAlphaType(int8_t atype) { } } // Sets the alpha value for constant alpha -void rend_SetAlphaValue(ubyte val) { +void rend_SetAlphaValue(uint8_t val) { switch (Renderer_type) { case RENDERER_SOFTWARE_16BIT: case RENDERER_SOFTWARE_8BIT: @@ -1778,7 +1778,7 @@ void rend_DrawLFBBitmap(int sx, int sy, int w, int h, int dx, int dy, ushort *da rend_ReleaseLFBLock(&lfb); } // given a chunked bitmap, renders it. -void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, ubyte alpha) { +void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, uint8_t alpha) { int *bm_array = chunk->bm_array; int w = chunk->w; int h = chunk->h; @@ -1810,7 +1810,7 @@ void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, ubyte alpha) { rend_SetZBufferState(1); } // given a chunked bitmap, renders it.scaled -void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, ubyte alpha) { +void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, uint8_t alpha) { int *bm_array = chunk->bm_array; int w = chunk->w; int h = chunk->h; diff --git a/lib/3d.h b/lib/3d.h index 8a62d26e..34574ca6 100644 --- a/lib/3d.h +++ b/lib/3d.h @@ -207,7 +207,7 @@ typedef struct g3UVL { // Structure to store clipping codes in a word typedef struct g3Codes { - ubyte cc_or, cc_and; + uint8_t cc_or, cc_and; } g3Codes; // flags for point structure @@ -233,8 +233,8 @@ typedef struct g3Codes { // if rotated, and flag to indicate if projected. typedef struct g3Point { float p3_sx, p3_sy; // screen x&y - ubyte p3_codes; // clipping codes - ubyte p3_flags; // projected? + uint8_t p3_codes; // clipping codes + uint8_t p3_flags; // projected? short p3_pad; // keep structure longword aligned vector p3_vec; // x,y,z of rotated point vector p3_vecPreRot; // original XYZ of the point @@ -317,7 +317,7 @@ bool g3_CheckNormalFacing(vector *v, vector *norm); g3Codes g3_CheckCodes(int nv, g3Point **pointlist); // rotates a point. returns codes. does not check if already rotated -ubyte g3_RotatePoint(g3Point *dest, vector *src); +uint8_t g3_RotatePoint(g3Point *dest, vector *src); // projects a point void g3_ProjectPoint(g3Point *point); @@ -329,14 +329,14 @@ float g3_CalcPointDepth(vector *pnt); void g3_Point2Vec(vector *v, short sx, short sy); // code a point. fills in the p3_codes field of the point, and returns the codes -ubyte g3_CodePoint(g3Point *point); +uint8_t g3_CodePoint(g3Point *point); // delta rotation functions vector *g3_RotateDeltaX(vector *dest, float dx); vector *g3_RotateDeltaY(vector *dest, float dy); vector *g3_RotateDeltaZ(vector *dest, float dz); vector *g3_RotateDeltaVec(vector *dest, vector *src); -ubyte g3_AddDeltaVec(g3Point *dest, g3Point *src, vector *deltav); +uint8_t g3_AddDeltaVec(g3Point *dest, g3Point *src, vector *deltav); // Drawing functions: // draw a polygon @@ -392,7 +392,7 @@ void g3_RemapInterpColors(void); void g3_DrawBox(ddgr_color color, g3Point *pnt, float rad); // Sets up a custom clipping plane - g3_StartFrame must be called before this is called -void g3_SetCustomClipPlane(ubyte state, vector *pnt, vector *normal); +void g3_SetCustomClipPlane(uint8_t state, vector *pnt, vector *normal); // sets the z distance of the far clipping plane void g3_SetFarClipZ(float z); diff --git a/lib/CZip.h b/lib/CZip.h index 46de0512..e0d0ebd4 100644 --- a/lib/CZip.h +++ b/lib/CZip.h @@ -67,18 +67,18 @@ * */ -#define ubyte uint8_t +#define uint8_t uint8_t #define uint32_t uint32_t #define ushort uint16_t typedef struct { - ubyte type; + uint8_t type; int count; int size; // only used for memory...size allocated for buffer int file_size; // max count we reached union { FILE *file; - ubyte *memory; + uint8_t *memory; }; } tVirtualFile; @@ -87,7 +87,7 @@ typedef struct { //////////////////////// typedef struct tBitFile { tVirtualFile *file; - ubyte mask; + uint8_t mask; int rack; } BITFILE; @@ -178,11 +178,11 @@ public: // Raw type compressed files operations only int ReadBytes(char *data, int count); void WriteBytes(char *data, int count); - ubyte ReadRawByte(void); + uint8_t ReadRawByte(void); ushort ReadRawShort(void); uint32_t ReadRawInt(void); float ReadRawFloat(void); - void WriteRawByte(ubyte value); + void WriteRawByte(uint8_t value); void WriteRawShort(ushort value); void WriteRawInt(uint32_t value); void WriteRawFloat(float value); @@ -198,16 +198,16 @@ private: tFileInfo current_file; // Reads in a Raw type file header // returns true on succes, if so, compr_type contains the compression type - bool ReadRawHeader(tVirtualFile *file, ubyte *compr_type); + bool ReadRawHeader(tVirtualFile *file, uint8_t *compr_type); // Writes out a Raw type file header // returns true on succes - bool WriteRawHeader(tVirtualFile *file, ubyte compr_type); + bool WriteRawHeader(tVirtualFile *file, uint8_t compr_type); // Reads in an OCF header // returns true on success, info is filled in the appropriate values,compr_type is compression type - bool ReadOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte *compr_type); + bool ReadOCFHeader(tVirtualFile *file, tFileInfo *info, uint8_t *compr_type); // Writes out an OCF header // returns true on success - bool WriteOCFHeader(tVirtualFile *file, tFileInfo *info, ubyte compr_type, int header_pos); + bool WriteOCFHeader(tVirtualFile *file, tFileInfo *info, uint8_t compr_type, int header_pos); // Writes out a 'dummy' OCF header, just give what the final filename is // you must call this before you compress data, then when done, call the read WriteOCFHeader bool WriteDummyOCFHeader(tVirtualFile *file, char *filename); @@ -271,10 +271,10 @@ private: void ha_swap_nodes(tHATree *tree, int i, int j); void ha_add_new_node(tHATree *tree, int c); void ha_CloseRawDecompress(void); - bool ha_ReadRawByte(ubyte *data, BITFILE *input); + bool ha_ReadRawByte(uint8_t *data, BITFILE *input); void ha_PrepareDecompress(void); void ha_CloseRawCompress(BITFILE *output); - void ha_WriteRawByte(ubyte data, BITFILE *output); + void ha_WriteRawByte(uint8_t data, BITFILE *output); void ha_PrepareCompress(void); }; diff --git a/lib/Controller.h b/lib/Controller.h index f144f001..f3cf24a7 100644 --- a/lib/Controller.h +++ b/lib/Controller.h @@ -146,8 +146,8 @@ typedef struct ct_function { int id; // identifier for the function (like forward thrust) ct_format format; // what format should the return value be for this function ct_type ctype[2]; // type of controller requested for this id. (1 for each value packed.) - ubyte value[2]; // corresponding value to ctype - ubyte flags[2]; // flags. + uint8_t value[2]; // corresponding value to ctype + uint8_t flags[2]; // flags. } ct_function; typedef struct ct_packet { @@ -163,7 +163,7 @@ typedef unsigned ct_config_data; // passed by controller system to the outside, #define CTPK_MOUSE 0x2 // this is coming from a mouse device. default is joystick/keyboard. // element values -const ubyte CT_X_AXIS = 1, // AXIS constants for ctAxis +const uint8_t CT_X_AXIS = 1, // AXIS constants for ctAxis CT_Y_AXIS = 2, CT_Z_AXIS = 3, CT_R_AXIS = 4, CT_U_AXIS = 5, CT_V_AXIS = 6, CT_NUM_AXES = 6; // number of axes @@ -214,10 +214,10 @@ public: virtual ct_config_data get_controller_value(ct_type type_req) = 0; // sets the configuration of a function (type must be of an array == CTLBINDS_PER_FUNC) - virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const ubyte *flags) = 0; + virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const uint8_t *flags) = 0; // returns information about a requested function (type must be of an array == CTLBINDS_PER_FUNC) - virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, ubyte *flags) = 0; + virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, uint8_t *flags) = 0; // temporarily enables or disables a function virtual void enable_function(int id, bool enable) = 0; @@ -226,10 +226,10 @@ public: virtual bool get_packet(int id, ct_packet *packet, ct_format alt_format = ctNoFormat) = 0; // gets sensitivity of axis item - virtual float get_axis_sensitivity(ct_type axis_type, ubyte axis) = 0; + virtual float get_axis_sensitivity(ct_type axis_type, uint8_t axis) = 0; // sets sensitivity of axis item - virtual void set_axis_sensitivity(ct_type axis_type, ubyte axis, float val) = 0; + virtual void set_axis_sensitivity(ct_type axis_type, uint8_t axis, float val) = 0; // assigns an individual function virtual int assign_function(ct_function *fn) = 0; @@ -238,7 +238,7 @@ public: virtual void mask_controllers(bool joystick, bool mouse) = 0; // retrieves binding text for desired function, binding, etc. - virtual const char *get_binding_text(ct_type type, ubyte ctrl, ubyte bind) = 0; + virtual const char *get_binding_text(ct_type type, uint8_t ctrl, uint8_t bind) = 0; // get raw values for the controllers virtual int get_mouse_raw_values(int *x, int *y) = 0; diff --git a/lib/Ddgr.h b/lib/Ddgr.h index a266183a..7ed5e716 100644 --- a/lib/Ddgr.h +++ b/lib/Ddgr.h @@ -236,8 +236,8 @@ bool ddgr_surf_Blt(ddgr_surface *dsf, int dx, int dy, ddgr_surface *ssf, int sx, 8-bit palette surface structures */ typedef struct ddgr_rgb { - ubyte r, g, b; // RGB triplet - ubyte x; // reserved... + uint8_t r, g, b; // RGB triplet + uint8_t x; // reserved... } ddgr_rgb; typedef struct ddgr_palette { diff --git a/lib/PHYSICS.H b/lib/PHYSICS.H index 400acc24..e1031205 100644 --- a/lib/PHYSICS.H +++ b/lib/PHYSICS.H @@ -28,7 +28,7 @@ * * 9 8/27/98 6:23p Jeff * changed autoleveling in config so it is a slider...had to convert - * global from bool->ubyte. Added fast headlight and mirrored surfaces to + * global from bool->uint8_t. Added fast headlight and mirrored surfaces to * config menu * * 8 6/15/98 7:01a Chris @@ -84,8 +84,8 @@ extern float Gravity_strength; extern int Physics_player_verbose; #endif -extern ubyte Default_player_terrain_leveling; -extern ubyte Default_player_room_leveling; +extern uint8_t Default_player_terrain_leveling; +extern uint8_t Default_player_room_leveling; bool PhysicsDoSimRot(object *obj, float frame_time, matrix *orient, vector *rotforce, vector *rotvel, angle *turn_roll); void PhysicsDoSimLinear(const object &obj, const vector &pos, const vector &force, vector &velocity, diff --git a/lib/bitmap.h b/lib/bitmap.h index 92262ef6..ea45469e 100644 --- a/lib/bitmap.h +++ b/lib/bitmap.h @@ -61,10 +61,10 @@ typedef struct { ushort used; // Is this bitmap free to be allocated? short cache_slot; // For use by the rendering lib - ubyte mip_levels; - ubyte flags; + uint8_t mip_levels; + uint8_t flags; - ubyte format; // See bitmap format types above + uint8_t format; // See bitmap format types above char name[BITMAP_NAME_LEN]; // Whats the name of this bitmap? (ie SteelWall) } bms_bitmap; diff --git a/lib/bumpmap.h b/lib/bumpmap.h index a398f93d..62b3d5ba 100644 --- a/lib/bumpmap.h +++ b/lib/bumpmap.h @@ -30,8 +30,8 @@ typedef struct { ushort *data; // 8bit data short cache_slot; // for the renderers use - ubyte width, height; - ubyte flags, pad; + uint8_t width, height; + uint8_t flags, pad; } bms_bumpmap; extern bms_bumpmap GameBumpmaps[MAX_BUMPMAPS]; @@ -52,7 +52,7 @@ void bump_FreeBumpmap(int handle); ushort *bump_data(int handle); // returns width or height of the passed in bumpmap -ubyte bump_w(int handle); -ubyte bump_h(int handle); +uint8_t bump_w(int handle); +uint8_t bump_h(int handle); #endif diff --git a/lib/collide.h b/lib/collide.h index 6278abe5..e69260a7 100644 --- a/lib/collide.h +++ b/lib/collide.h @@ -87,8 +87,8 @@ #include "vecmat.h" #include "findintersection.h" -extern ubyte CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES]; -extern ubyte CollisionRayResult[MAX_OBJECT_TYPES]; +extern uint8_t CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES]; +extern uint8_t CollisionRayResult[MAX_OBJECT_TYPES]; void CollideInit(); void collide_two_objects(object *A, object *B, vector *collision_point, vector *collision_normal, diff --git a/lib/d3music.h b/lib/d3music.h index 50374748..f9c44e09 100644 --- a/lib/d3music.h +++ b/lib/d3music.h @@ -97,10 +97,10 @@ typedef struct tMusicSeqInfo { bool player_damaged; // was player hit by enemy fire? bool player_invulnerable; // is player invulnerable? bool player_terrain; // is player in terrain (if not, in mine) - ubyte player_shield_level; // what shield level the player is at? (0-10) - ubyte n_hostiles; // number of hostiles - ubyte n_hostiles_player_killed; // number hostiles killed by player this frame. - ubyte pad; + uint8_t player_shield_level; // what shield level the player is at? (0-10) + uint8_t n_hostiles; // number of hostiles + uint8_t n_hostiles_player_killed; // number hostiles killed by player this frame. + uint8_t pad; float frametime; // frame time. diff --git a/lib/ddio.h b/lib/ddio.h index b3bd2852..46776cb3 100644 --- a/lib/ddio.h +++ b/lib/ddio.h @@ -220,13 +220,13 @@ void ddio_InternalKeySuspend(); void ddio_InternalKeyResume(); // returns if key is up or down -bool ddio_InternalKeyState(ubyte key); +bool ddio_InternalKeyState(uint8_t key); // returns internal key down time -float ddio_InternalKeyDownTime(ubyte key); +float ddio_InternalKeyDownTime(uint8_t key); // flush a key internally -void ddio_InternalResetKey(ubyte key); +void ddio_InternalResetKey(uint8_t key); // ---------------------------------------------------------------------------- // Device Dependent Timer Interface diff --git a/lib/ddio_common.h b/lib/ddio_common.h index f7716983..1764014b 100644 --- a/lib/ddio_common.h +++ b/lib/ddio_common.h @@ -201,7 +201,7 @@ void ddio_SetKeyboardLanguage(int language); // array of key states. extern volatile short DDIO_key_down_count[]; -extern volatile ubyte DDIO_key_state[]; +extern volatile uint8_t DDIO_key_state[]; #define KEY_STATE(_c) DDIO_key_state[_c] #define DDIO_MAX_KEYS 256 diff --git a/lib/demofile.h b/lib/demofile.h index 4b529484..6065cc1e 100644 --- a/lib/demofile.h +++ b/lib/demofile.h @@ -167,7 +167,7 @@ void DemoWriteChangedObjects(); void DemoWriteWeaponFire(uint16_t objectnum, vector *pos, vector *dir, uint16_t weaponnum, uint16_t weapobjnum, short gunnum); -void DemoWriteObjCreate(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, +void DemoWriteObjCreate(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, object *obj); void DemoWriteTurretChanged(uint16_t objnum); @@ -226,17 +226,17 @@ void DemoReadPlayerInfo(void); void DemoPlayAutoDemo(void); -void DemoWriteMSafe(ubyte *data, uint16_t len); +void DemoWriteMSafe(uint8_t *data, uint16_t len); void DemoReadMSafe(); -void DemoWritePowerup(ubyte *data, uint16_t len); +void DemoWritePowerup(uint8_t *data, uint16_t len); void DemoReadPowerups(); void DemoReadCinematics(); -void DemoWriteCinematics(ubyte *data, uint16_t len); +void DemoWriteCinematics(uint8_t *data, uint16_t len); void DemoWritePersistantHUDMessage(ddgr_color color, int x, int y, float time, int flags, int sound_index, char *msg); diff --git a/lib/directplay.h b/lib/directplay.h index f3c30527..f44867bd 100644 --- a/lib/directplay.h +++ b/lib/directplay.h @@ -74,7 +74,7 @@ void dp_EndGame(); int dp_ListDirectPlayGames(); // Send a packet to a direct play user -int dp_DirectPlaySend(network_address *who_to, ubyte *data, int len, bool reliable); +int dp_DirectPlaySend(network_address *who_to, uint8_t *data, int len, bool reliable); // This function will look for incoming messages, and dispatch them accordingly void dp_DirectPlayDispatch(); diff --git a/lib/game2dll.h b/lib/game2dll.h index 4ff2fdde..b464a5af 100644 --- a/lib/game2dll.h +++ b/lib/game2dll.h @@ -39,7 +39,7 @@ typedef struct { typedef struct { int me_handle; int it_handle; - ubyte *special_data; + uint8_t *special_data; char *input_string; int input_key; union { diff --git a/lib/gameos.h b/lib/gameos.h index 21a3be65..c0d20c35 100644 --- a/lib/gameos.h +++ b/lib/gameos.h @@ -143,12 +143,12 @@ public: // Data structures typedef struct os_date { ushort year; // 1-65535 A.D. (or C.E.) - ubyte month; - ubyte day; - ubyte hour; - ubyte min; - ubyte sec; - ubyte pad; // to keep dword aligned + uint8_t month; + uint8_t day; + uint8_t hour; + uint8_t min; + uint8_t sec; + uint8_t pad; // to keep dword aligned } os_date; // --------------------------------------------------------------------------- // Debug system functions diff --git a/lib/gr.h b/lib/gr.h index ef0f73d0..f140ebfe 100644 --- a/lib/gr.h +++ b/lib/gr.h @@ -132,7 +132,7 @@ typedef enum grTextAlign { // used to align text along viewport } grTextAlign; typedef struct tCharProperties { - ubyte alpha; + uint8_t alpha; ddgr_color col[4]; } tCharProperties; @@ -154,11 +154,11 @@ typedef struct gr_font_file_record { short width, height; // width of widest character and height of longest char short flags; // flags used by the character renderer short baseline; // pixels given to lowercase below script line start at baseline - ubyte min_ascii; // minimum ascii value used by font - ubyte max_ascii; // max ascii value used by the font + uint8_t min_ascii; // minimum ascii value used by font + uint8_t max_ascii; // max ascii value used by the font short byte_width; // width of a character in the font in bytes - ubyte *raw_data; // pixel, map data. - ubyte **char_data; // pointers to each character + uint8_t *raw_data; // pixel, map data. + uint8_t **char_data; // pointers to each character short *char_widths; // individual pixel widths of each character uint8_t *kern_data; // kerning information for specific letter combos } gr_font_file_record; @@ -169,7 +169,7 @@ typedef struct gr_font_record { int references; // number of references of that font int bmps[MAX_FONT_BITMAPS]; // font bitmap handles grMemorySurface *surfs[MAX_FONT_BITMAPS]; - ubyte *ch_u, *ch_v, *ch_w, *ch_h, *ch_surf; + uint8_t *ch_u, *ch_v, *ch_w, *ch_h, *ch_surf; float *ch_uf, *ch_vf, *ch_wf, *ch_hf; gr_font_file_record font; @@ -210,7 +210,7 @@ private: static void translate_to_surfaces(int slot); static void translate_mono_char(grSurface *sf, int x, int y, int index, gr_font_file_record *ft, int width); - ubyte *get_kern_info(ubyte c1, ubyte c2); + uint8_t *get_kern_info(uint8_t c1, uint8_t c2); void charblt16(grSurface *dsf, ddgr_color col, int dx, int dy, grSurface *ssf, int sx, int sy, int sw, int sh); public: // Accessor functions diff --git a/lib/grtext.h b/lib/grtext.h index c72e985f..0eb57641 100644 --- a/lib/grtext.h +++ b/lib/grtext.h @@ -141,10 +141,10 @@ ddgr_color grtext_GetColor(); void grtext_SetFancyColor(ddgr_color col1, ddgr_color col2, ddgr_color col3, ddgr_color col4); // sets the alpha value for text -void grtext_SetAlpha(ubyte alpha); +void grtext_SetAlpha(uint8_t alpha); // gets font alpha -ubyte grtext_GetAlpha(); +uint8_t grtext_GetAlpha(); // toggles text saturation void grtext_SetFlags(int flags); @@ -216,10 +216,10 @@ const char *grtext_GetChar(const char *str, tGetCharInfo *ci); // we can load a font template into this structure. call grfont_FreeTemplate(tFontTemplate) to free memory here. typedef struct tFontTemplate { ushort min_ascii, max_ascii; - ubyte *ch_widths; - ubyte *kern_data; - ubyte ch_height; - ubyte ch_maxwidth; // max width of character in font. + uint8_t *ch_widths; + uint8_t *kern_data; + uint8_t ch_height; + uint8_t ch_maxwidth; // max width of character in font. bool proportional; // is this font proportional? if so use array of widths, else use maxwidth bool uppercase; // uppercase font? bool monochromatic; // font is monochromatic? @@ -273,7 +273,7 @@ ushort *grfont_GetRawCharacterData(int font, int ch, int *w, int *h, bool *mono) bool grfont_SetTemplate(const char *pathname, const tFontTemplate *ft); // sets a font's template without saving... -bool grfont_SetKerning(int font, ubyte *kern_data); +bool grfont_SetKerning(int font, uint8_t *kern_data); // sets a font's tracking bool grfont_SetTracking(int font, int tracking); @@ -299,13 +299,13 @@ typedef struct tFontFileInfo { short width, height; // width of widest character and height of longest char short flags; // flags used by the character renderer short baseline; // pixels given to lowercase below script line start at baseline - ubyte min_ascii; // minimum ascii value used by font - ubyte max_ascii; // max ascii value used by the font + uint8_t min_ascii; // minimum ascii value used by font + uint8_t max_ascii; // max ascii value used by the font short byte_width; // width of a character in the font in bytes - ubyte *raw_data; // pixel, map data. - ubyte **char_data; // pointers to each character - ubyte *char_widths; // individual pixel widths of each character - ubyte *kern_data; // kerning information for specific letter combos + uint8_t *raw_data; // pixel, map data. + uint8_t **char_data; // pointers to each character + uint8_t *char_widths; // individual pixel widths of each character + uint8_t *kern_data; // kerning information for specific letter combos // FFI2 (newstyle) data tFontFileInfo2 ffi2; diff --git a/lib/lightmap.h b/lib/lightmap.h index 15cb4cc5..b2f024d6 100644 --- a/lib/lightmap.h +++ b/lib/lightmap.h @@ -31,14 +31,14 @@ #define LF_BRAND_NEW 8 // This lightmap is brand new and hasn't been to the video card yet typedef struct { - ubyte width, height; // Width and height in pixels + uint8_t width, height; // Width and height in pixels ushort *data; // 16bit data ushort used; - ubyte flags; + uint8_t flags; short cache_slot; // for the renderers use - ubyte square_res; // for renderers use - ubyte cx1, cy1, cx2, cy2; // Change x and y coords + uint8_t square_res; // for renderers use + uint8_t cx1, cy1, cx2, cy2; // Change x and y coords } bms_lightmap; extern bms_lightmap GameLightmaps[MAX_LIGHTMAPS]; diff --git a/lib/manage.h b/lib/manage.h index 05284020..a10b4d5f 100644 --- a/lib/manage.h +++ b/lib/manage.h @@ -57,16 +57,16 @@ #define PAGETYPE_GENERIC 10 typedef struct { - ubyte pagetype; // of type PAGETYPE above + uint8_t pagetype; // of type PAGETYPE above char name[PAGENAME_LEN]; char holder[PAGENAME_LEN]; } mngs_Pagelock; typedef struct { - ubyte used; - ubyte overlay; - ubyte pagetype; - ubyte __pad; + uint8_t used; + uint8_t overlay; + uint8_t pagetype; + uint8_t __pad; int stack_filepos; // file position of this page in the tablefile (the value we are // pushing, for addon tables) char name[PAGENAME_LEN]; @@ -160,8 +160,8 @@ void mng_CheckToCreateNetTables(); void mng_InitLocalDirectories(); void mng_InitNetDirectories(); -void mng_ReadDummyPage(CFILE *infile, ubyte pagetype); -void mng_ReadWriteDummyPage(CFILE *infile, CFILE *outfile, ubyte pagetype); +void mng_ReadDummyPage(CFILE *infile, uint8_t pagetype); +void mng_ReadWriteDummyPage(CFILE *infile, CFILE *outfile, uint8_t pagetype); // Function for writing out "undefined" page...useful for placeholding void mng_WriteUnknownPage(CFILE *outfile); @@ -253,7 +253,7 @@ bool IsPrimitiveOld(char *name); void UpdatePrimitive(char *localname, char *netname, char *primname, int pagetype, char *pagename); // Writes a chunk header. Writes chunk id & placeholder length. Returns chunk start pos -int StartManagePage(CFILE *ofile, ubyte pagetype); +int StartManagePage(CFILE *ofile, uint8_t pagetype); // Fill in page length when done writing void EndManagePage(CFILE *ofile, int chunk_start_pos); diff --git a/lib/megacell.h b/lib/megacell.h index 9aff2836..844054a8 100644 --- a/lib/megacell.h +++ b/lib/megacell.h @@ -38,7 +38,7 @@ typedef struct { short texture_handles[MAX_MEGACELL_WIDTH * MAX_MEGACELL_HEIGHT]; int flags; - ubyte used; + uint8_t used; } megacell; extern int Num_megacells; diff --git a/lib/networking.h b/lib/networking.h index 61f339dd..097f412b 100644 --- a/lib/networking.h +++ b/lib/networking.h @@ -334,9 +334,9 @@ enum network_protocol : uint32_t }; typedef struct { - ubyte address[6]; + uint8_t address[6]; ushort port; - ubyte net_id[4]; + uint8_t net_id[4]; network_protocol connection_type; // IPX, IP, modem, etc. } network_address; @@ -399,12 +399,12 @@ void nw_FreePacket(int id); int nw_Receive(void *data, network_address *from_addr); // nw_SendReliable sends the given data through the given reliable socket. -int nw_SendReliable(uint32_t socketid, ubyte *data, int length, bool urgent = false); +int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent = false); // function which reads data off of a reliable socket. recv() should read the totaly amount of data // available I believe. (i.e. we shouldn't read only part of a message with one call....I may be wrong // and this may be a source of bugs). -int nw_ReceiveReliable(SOCKET socket, ubyte *buffer, int max_len); +int nw_ReceiveReliable(SOCKET socket, uint8_t *buffer, int max_len); // Returns the current protocol in use int nw_GetProtocolType(); @@ -430,13 +430,13 @@ int nw_PingCompare(const void *arg1, const void *arg2); void nw_psnet_buffer_init(); // buffer a packet (maintain order!) -void nw_psnet_buffer_packet(ubyte *data, int length, network_address *from); +void nw_psnet_buffer_packet(uint8_t *data, int length, network_address *from); // get the index of the next packet in order! -int nw_psnet_buffer_get_next(ubyte *data, int *length, network_address *from); +int nw_psnet_buffer_get_next(uint8_t *data, int *length, network_address *from); // get the index of the next packet in order! -int nw_psnet_buffer_get_next_by_packet_id(ubyte *data, int *length, uint32_t packet_id); +int nw_psnet_buffer_get_next_by_packet_id(uint8_t *data, int *length, uint32_t packet_id); // This is all the reliable UDP stuff... #define MAXNETBUFFERS \ @@ -467,7 +467,7 @@ int nw_psnet_buffer_get_next_by_packet_id(ubyte *data, int *length, uint32_t pac #define RNF_LIMBO 5 // between connecting and connected void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_type, float time_sent); -void nw_WorkReliable(ubyte *data, int len, network_address *naddr); +void nw_WorkReliable(uint8_t *data, int len, network_address *naddr); int nw_Compress(void *srcdata, void *destdata, int count); int nw_Uncompress(void *compdata, void *uncompdata, int count); @@ -504,14 +504,14 @@ int nw_Asyncgethostbyname(uint32_t *ip, int command, char *hostname); int nw_ReccomendPPS(); void nw_DoNetworkIdle(void); -typedef void *(*NetworkReceiveCallback)(ubyte *data, int len, network_address *from); -int nw_RegisterCallback(NetworkReceiveCallback nfp, ubyte id); -NetworkReceiveCallback nw_UnRegisterCallback(ubyte id); -int nw_SendWithID(ubyte id, ubyte *data, int len, network_address *who_to); +typedef void *(*NetworkReceiveCallback)(uint8_t *data, int len, network_address *from); +int nw_RegisterCallback(NetworkReceiveCallback nfp, uint8_t id); +NetworkReceiveCallback nw_UnRegisterCallback(uint8_t id); +int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to); int nw_DoReceiveCallbacks(void); -void nw_HandleConnectResponse(ubyte *data, int len, network_address *server_addr); -int nw_RegisterCallback(NetworkReceiveCallback nfp, ubyte id); -void nw_HandleUnreliableData(ubyte *data, int len, network_address *from_addr); +void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_addr); +int nw_RegisterCallback(NetworkReceiveCallback nfp, uint8_t id); +void nw_HandleUnreliableData(uint8_t *data, int len, network_address *from_addr); void nw_ReliableResend(void); int nw_CheckReliableSocket(int socknum); diff --git a/lib/polymodel.h b/lib/polymodel.h index ecc48faa..0203437c 100644 --- a/lib/polymodel.h +++ b/lib/polymodel.h @@ -319,7 +319,7 @@ extern polymodel_light_type Polymodel_light_type; extern float Polylighting_static_red; extern float Polylighting_static_green; extern float Polylighting_static_blue; -extern ubyte *Polylighting_gouraud; +extern uint8_t *Polylighting_gouraud; extern vector *Polymodel_light_direction, Polymodel_fog_portal_vert, Polymodel_fog_plane, Polymodel_specular_pos, Polymodel_bump_pos; extern lightmap_object *Polylighting_lightmap_object; @@ -354,17 +354,17 @@ int FindPolyModelName(const char *name); // This one is for static lighting - ie 1 light value for the entire model void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, float r, float g, - float b, uint32_t f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0, ubyte overlay = 0); + float b, uint32_t f_render_sub = 0xFFFFFFFF, uint8_t use_effect = 0, uint8_t overlay = 0); // This one is for gouraud shading - the lightdir is the normalized light direction, and lightscalar is a 0-1 scalar to // apply void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, vector *lightdir, - float r, float g, float b, uint32_t f_render_sub = 0xFFFFFFFF, ubyte use_effect = 0, - ubyte overlay = 0); + float r, float g, float b, uint32_t f_render_sub = 0xFFFFFFFF, uint8_t use_effect = 0, + uint8_t overlay = 0); // This one is for lightmap rendering void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, - lightmap_object *lm_object, uint32_t f_render_sub, ubyte use_effect = 0, ubyte overlay = 0); + lightmap_object *lm_object, uint32_t f_render_sub, uint8_t use_effect = 0, uint8_t overlay = 0); // gives the interpreter an array of points to use void g3_SetInterpPoints(g3Point *pointlist); @@ -387,7 +387,7 @@ float GetNormalizedKeyframe(int handle, float num); void RemapPolyModels(); // For macintosh, we must swap the interpreted model code -void SwapPolymodelData(ubyte *data); +void SwapPolymodelData(uint8_t *data); // Sets a positional instance void StartPolyModelPosInstance(vector *posvec); diff --git a/lib/polymodel_external.h b/lib/polymodel_external.h index 0b2afe81..d64bdbe2 100644 --- a/lib/polymodel_external.h +++ b/lib/polymodel_external.h @@ -114,18 +114,18 @@ typedef struct a_bank { } a_bank; typedef struct { - ubyte num_verts; + uint8_t num_verts; ushort lmi_handle; vector rvec, uvec; float *u2, *v2; } lightmap_object_face; typedef struct { - ubyte num_models; + uint8_t num_models; short num_faces[MAX_SUBOBJECTS]; lightmap_object_face *lightmap_faces[MAX_SUBOBJECTS]; - ubyte used; + uint8_t used; } lightmap_object; @@ -180,7 +180,7 @@ typedef struct bsp_info { int8_t children[MAX_SUBOBJECTS]; // children of this submodel int parent; // what is parent for each submodel - ubyte num_children; + uint8_t num_children; vector min; vector max; @@ -228,14 +228,14 @@ typedef struct poly_model { uint16_t used; int flags; // PMF_flags, see above - ubyte new_style; // if 1, then this polymodel is in the new outrage format (oof) + uint8_t new_style; // if 1, then this polymodel is in the new outrage format (oof) int id; // what the polygon model number is. (Index in Poly_models) int version; char name[PAGENAME_LEN]; int n_models; int model_data_size; - ubyte *model_data; + uint8_t *model_data; vector mins, maxs; // min,max for whole model vector view_pos; // viewing position. Default to {0,0,0}. diff --git a/lib/pstypes.h b/lib/pstypes.h index 1cd46ead..2306d277 100644 --- a/lib/pstypes.h +++ b/lib/pstypes.h @@ -22,7 +22,7 @@ #include // define unsigned types; -typedef uint8_t ubyte; +typedef uint8_t uint8_t; typedef int8_t int8_t; typedef uint16_t ushort; typedef uint32_t uint32_t; diff --git a/lib/rend_d3d.h b/lib/rend_d3d.h index bd4faf8f..4c7c01d3 100644 --- a/lib/rend_d3d.h +++ b/lib/rend_d3d.h @@ -91,7 +91,7 @@ void d3d_SetFogColor(ddgr_color fogcolor); void d3d_SetAlphaType(int8_t); // Sets the constant alpha value -void d3d_SetAlphaValue(ubyte val); +void d3d_SetAlphaValue(uint8_t val); // Sets the overall alpha scale factor (all alpha values are scaled by this value) // usefull for motion blur effect diff --git a/lib/rend_opengl.h b/lib/rend_opengl.h index 8969cd26..5ebeb18d 100644 --- a/lib/rend_opengl.h +++ b/lib/rend_opengl.h @@ -93,7 +93,7 @@ float opengl_GetAspectRatio(); void opengl_SetWrapType(wrap_type val); // Sets the constant alpha value -void opengl_SetAlphaValue(ubyte val); +void opengl_SetAlphaValue(uint8_t val); // Sets the overall alpha scale factor (all alpha values are scaled by this value) // usefull for motion blur effect diff --git a/lib/renderer.h b/lib/renderer.h index e28fb43e..e82d32a2 100644 --- a/lib/renderer.h +++ b/lib/renderer.h @@ -338,7 +338,7 @@ extern renderer_type Renderer_type; #define OT_BUMPMAP 5 // Draw a saturated bumpmap afterwards #define OT_BLEND_SATURATE 6 // Add a lightmap in -extern ubyte Overlay_type; +extern uint8_t Overlay_type; extern int Overlay_map; extern int Bumpmap_ready, Bump_map; extern float Z_bias; @@ -456,12 +456,12 @@ typedef struct { } rendering_state; typedef struct { - ubyte mipping; - ubyte filtering; + uint8_t mipping; + uint8_t filtering; float gamma; - ubyte bit_depth; + uint8_t bit_depth; int width, height; - ubyte vsync_on; + uint8_t vsync_on; } renderer_preferred_state; typedef struct { @@ -530,7 +530,7 @@ void rend_SetZValues(float nearz, float farz); void rend_SetOverlayMap(int handle); // Sets the type of overlay operation -void rend_SetOverlayType(ubyte type); +void rend_SetOverlayType(uint8_t type); // Clears the display to a specified color void rend_ClearScreen(ddgr_color color); @@ -569,7 +569,7 @@ void rend_SetFogColor(ddgr_color fogcolor); void rend_SetAlphaType(int8_t); // Sets the constant alpha value -void rend_SetAlphaValue(ubyte val); +void rend_SetAlphaValue(uint8_t val); // Sets the overall alpha scale factor (all alpha values are scaled by this value) // usefull for motion blur effect @@ -595,7 +595,7 @@ void rend_SetZBias(float z_bias); void rend_SetZBufferWriteMask(int state); // Sets where the software renderer should write to -void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, ubyte *framebuffer); +void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, uint8_t *framebuffer); // Fills in some variables so the 3d math routines know how to project void rend_GetProjectionParameters(int *width, int *height); @@ -614,10 +614,10 @@ void rend_ReleaseLFBLock(renderer_lfb *lfb); void rend_DrawLFBBitmap(int sx, int sy, int w, int h, int dx, int dy, ushort *data, int rowsize); // given a chunked bitmap, renders it. -void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, ubyte alpha); +void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, uint8_t alpha); // given a chunked bitmap, renders it.scaled -void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, ubyte alpha); +void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, uint8_t alpha); // Draws a line using the states of the renderer void rend_DrawSpecialLine(g3Point *p0, g3Point *p1); diff --git a/lib/texture.h b/lib/texture.h index cb0c2787..dbe6832e 100644 --- a/lib/texture.h +++ b/lib/texture.h @@ -122,9 +122,9 @@ typedef struct { extern void (*Texture_functions[])(g3Point *, int); // Our shade tables -extern ubyte TexShadeTable8[MAX_TEXTURE_SHADES][256]; +extern uint8_t TexShadeTable8[MAX_TEXTURE_SHADES][256]; extern uint32_t TexShadeTable16[MAX_TEXTURE_SHADES][256]; -extern ubyte TexRevShadeTable8[MAX_TEXTURE_SHADES][256]; +extern uint8_t TexRevShadeTable8[MAX_TEXTURE_SHADES][256]; extern uint32_t TexRevShadeTable16[MAX_TEXTURE_SHADES][256]; int tex_Init(); @@ -197,7 +197,7 @@ void tex_StartFrame(int x1, int y1, int x2, int y2); void tex_EndFrame(); // Sets the software renderer to render to a particular place -void tex_SetSoftwareParameters(float, int, int, int, ubyte *); +void tex_SetSoftwareParameters(float, int, int, int, uint8_t *); // Fills in projection variables void tex_GetProjectionParameters(int *width, int *height); diff --git a/lib/ui.h b/lib/ui.h index a48e6f0b..0f99a22e 100644 --- a/lib/ui.h +++ b/lib/ui.h @@ -884,7 +884,7 @@ class UIListBox : public UIGadget { ddgr_color m_SelectColor; // selected text color ddgr_color m_HiliteColor; // color of hilite bar int m_LastMseX, m_LastMseY; // used for double clicking. - ubyte m_Alpha; // alpha value of listbox. + uint8_t m_Alpha; // alpha value of listbox. bool MseCheckSelect(int x, int y); // check if x and y selection hits a selected item. void SetInternalSelectedIndex(int index); // call by listbox system. diff --git a/lib/uidraw.h b/lib/uidraw.h index 5c0ef940..b69bf384 100644 --- a/lib/uidraw.h +++ b/lib/uidraw.h @@ -30,14 +30,14 @@ void ui_SetTextClip(int left, int top, int right, int bottom); void ui_ResetTextClip(); // draw primatives -void ui_DrawSetAlpha(ubyte alpha); +void ui_DrawSetAlpha(uint8_t alpha); void ui_DrawLine(ddgr_color color, int x1, int y1, int x2, int y2); void ui_DrawBox(ddgr_color, int l, int t, int r, int b); void ui_DrawLTBox(ddgr_color lt_col, ddgr_color rb_col, int l, int t, int r, int b); void ui_DrawRect(ddgr_color, int l, int t, int r, int b); // draws all textures derived from ui_bm_handle. -void ui_DrawBitmap(UIBitmapItem *bi, int x, int y, ubyte alpha); +void ui_DrawBitmap(UIBitmapItem *bi, int x, int y, uint8_t alpha); int ui_GetBitmapWidth(UIBitmapItem *bi); int ui_GetBitmapHeight(UIBitmapItem *bi); @@ -45,7 +45,7 @@ int ui_GetBitmapHeight(UIBitmapItem *bi); void ui_DrawSetFont(int handle); int ui_DrawGetFont(); int ui_GetFontHeight(); -void ui_SetCharAlpha(ubyte alpha); +void ui_SetCharAlpha(uint8_t alpha); int ui_GetTextWidth(const char *text); int ui_GetTextHeight(const char *text); diff --git a/lib/uires.h b/lib/uires.h index 863ea681..a2ac0079 100644 --- a/lib/uires.h +++ b/lib/uires.h @@ -108,8 +108,8 @@ public: virtual int width() { return 0; }; virtual int height() { return 0; }; virtual tUIResClass class_type() { return uiItem; }; - virtual void set_alpha(ubyte alpha){}; - virtual ubyte get_alpha() const { return 0; }; + virtual void set_alpha(uint8_t alpha){}; + virtual uint8_t get_alpha() const { return 0; }; virtual void set_color(ddgr_color col){}; virtual ddgr_color get_color() const { return GR_BLACK; }; virtual UIItem *CopyUIItem() { return NULL; }; @@ -122,7 +122,7 @@ public: class UITextItem : public UIItem { friend void SetUITextItemText(UITextItem *uit, char *newtext, uint32_t color); - ubyte m_Alpha; // alpha value of text. + uint8_t m_Alpha; // alpha value of text. ddgr_color m_Color; // color of text. int m_Font; @@ -144,8 +144,8 @@ public: m_Color = GR_WHITE; m_Font = m_DefaultFont; }; - UITextItem(const char *text, ddgr_color color = GR_WHITE, ubyte alpha = 255); - UITextItem(int font, const char *text, ddgr_color color = GR_WHITE, ubyte alpha = 255); + UITextItem(const char *text, ddgr_color color = GR_WHITE, uint8_t alpha = 255); + UITextItem(int font, const char *text, ddgr_color color = GR_WHITE, uint8_t alpha = 255); virtual ~UITextItem(); // if returns false, then it didn't draw. @@ -157,13 +157,13 @@ public: virtual UIItem *CopyUIItem(); // set visual characteristics of text item - virtual void set_alpha(ubyte alpha) { m_Alpha = alpha; }; + virtual void set_alpha(uint8_t alpha) { m_Alpha = alpha; }; virtual void set_color(ddgr_color col) { m_Color = col; }; void set_font(int font) { m_Font = font; }; // get visual characteristics of text item - virtual ubyte get_alpha() const { return m_Alpha; }; + virtual uint8_t get_alpha() const { return m_Alpha; }; virtual ddgr_color get_color() const { return m_Color; }; int get_font() const { return m_Font; }; @@ -195,8 +195,8 @@ class UISnazzyTextItem : public UITextItem { public: UISnazzyTextItem() { m_flags = m_data.i = m_internaldata.i = 0; }; - UISnazzyTextItem(unsigned flags, const char *text, ddgr_color color = GR_WHITE, ubyte alpha = 255); - UISnazzyTextItem(unsigned flags, int font, const char *text, ddgr_color color = GR_WHITE, ubyte alpha = 255); + UISnazzyTextItem(unsigned flags, const char *text, ddgr_color color = GR_WHITE, uint8_t alpha = 255); + UISnazzyTextItem(unsigned flags, int font, const char *text, ddgr_color color = GR_WHITE, uint8_t alpha = 255); void set_data(int data) { m_data.i = data; }; void set_data(float data) { m_data.f = data; }; @@ -222,20 +222,20 @@ class UIBitmapItem : public UIItem { int handle; // a simple bitmap } m_Bitmap; // a bitmap. - ubyte m_Alpha; // alpha value of text. + uint8_t m_Alpha; // alpha value of text. public: UIBitmapItem() { m_IsValid = false; m_Alpha = 255; }; - UIBitmapItem(chunked_bitmap *chunk, ubyte alpha = 255) { + UIBitmapItem(chunked_bitmap *chunk, uint8_t alpha = 255) { m_IsValid = true; m_Bitmap.chunk = chunk; m_Alpha = alpha; m_IsChunked = true; }; - UIBitmapItem(int bm_handle, ubyte alpha = 255) { + UIBitmapItem(int bm_handle, uint8_t alpha = 255) { m_IsValid = true; m_Alpha = alpha; m_IsChunked = false; @@ -266,14 +266,14 @@ public: m_IsChunked = false; m_Bitmap.handle = bm_handle; }; - virtual void set_alpha(ubyte alpha) { // sets the alpha + virtual void set_alpha(uint8_t alpha) { // sets the alpha m_Alpha = alpha; }; // get visual characteristics chunked_bitmap *get_chunked_bitmap() const { return (chunked_bitmap *)m_Bitmap.chunk; }; int get_bitmap() const { return m_Bitmap.handle; }; - virtual ubyte get_alpha() const { // gets alpha. + virtual uint8_t get_alpha() const { // gets alpha. return m_Alpha; }; @@ -286,10 +286,10 @@ public: class UIPrimativeItem : public UIItem { ddgr_color color; - ubyte alpha; + uint8_t alpha; public: - UIPrimativeItem(ddgr_color col, ubyte alph = 255) { + UIPrimativeItem(ddgr_color col, uint8_t alph = 255) { color = col; alpha = alph; }; @@ -298,8 +298,8 @@ public: virtual void set_color(ddgr_color col) { color = col; }; virtual ddgr_color get_color() const { return color; }; - virtual void set_alpha(ubyte alph) { alpha = alph; }; - virtual ubyte get_alpha() const { return alpha; }; + virtual void set_alpha(uint8_t alph) { alpha = alph; }; + virtual uint8_t get_alpha() const { return alpha; }; // const UIPrimativeItem& UIPrimativeItem::operator =(const UIPrimativeItem& item) // JCA made Mac compatible const UIPrimativeItem &operator=(const UIPrimativeItem &item) { diff --git a/lib/unzip.h b/lib/unzip.h index 9898eaa5..88ff3017 100644 --- a/lib/unzip.h +++ b/lib/unzip.h @@ -44,10 +44,10 @@ typedef struct { uint32_t cent_file_header_sig; - ubyte version_made_by; - ubyte host_os; - ubyte version_needed_to_extract; - ubyte os_needed_to_extract; + uint8_t version_made_by; + uint8_t host_os; + uint8_t version_needed_to_extract; + uint8_t os_needed_to_extract; ushort general_purpose_bit_flag; ushort compression_method; ushort last_mod_file_time; @@ -114,7 +114,7 @@ private: int ReadZipData(zipentry *ent, char *data); int ReadZipDataToFile(zipentry *ent, FILE *file); int SeekToCompressedData(zipentry *ent); - int InflateFile(FILE *in_file, unsigned in_size, ubyte *out_data, unsigned out_size); + int InflateFile(FILE *in_file, unsigned in_size, uint8_t *out_data, unsigned out_size); int InflateFileToFile(FILE *in_file, unsigned in_size, FILE *file, unsigned out_size); private: diff --git a/lib/win/wincontroller.h b/lib/win/wincontroller.h index 558f150e..f8f51d16 100644 --- a/lib/win/wincontroller.h +++ b/lib/win/wincontroller.h @@ -182,10 +182,10 @@ public: virtual ct_config_data get_controller_value(ct_type type_req); // sets the configuration of a function - virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const ubyte *flags); + virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const uint8_t *flags); // returns information about a requested function - virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, ubyte *flags); + virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, uint8_t *flags); // temporarily enables or disables a function virtual void enable_function(int id, bool enable); @@ -193,10 +193,10 @@ public: virtual bool get_packet(int id, ct_packet *packet, ct_format alt_format = ctNoFormat); // gets sensitivity of axis item - virtual float get_axis_sensitivity(ct_type axis_type, ubyte axis); + virtual float get_axis_sensitivity(ct_type axis_type, uint8_t axis); // sets sensitivity of axis item - virtual void set_axis_sensitivity(ct_type axis_type, ubyte axis, float val); + virtual void set_axis_sensitivity(ct_type axis_type, uint8_t axis, float val); // assigns an individual function virtual int assign_function(ct_function *fn); @@ -205,7 +205,7 @@ public: virtual void mask_controllers(bool joystick, bool mouse); // retrieves binding text for desired function, binding, etc. - virtual const char *get_binding_text(ct_type type, ubyte ctrl, ubyte bind); + virtual const char *get_binding_text(ct_type type, uint8_t ctrl, uint8_t bind); // get raw values for the controllers virtual int get_mouse_raw_values(int *x, int *y); @@ -234,9 +234,9 @@ private: struct ct_element { ct_format format; int8_t ctl[CTLBINDS_PER_FUNC]; - ubyte value[CTLBINDS_PER_FUNC]; + uint8_t value[CTLBINDS_PER_FUNC]; ct_type ctype[CTLBINDS_PER_FUNC]; - ubyte flags[2]; + uint8_t flags[2]; bool enabled; } m_ElementList[CT_MAX_ELEMENTS]; @@ -246,22 +246,22 @@ private: void assign_element(int id, ct_element *elem); // this returns an index into the control list. - int8_t get_axis_controller(ubyte axis); + int8_t get_axis_controller(uint8_t axis); // returns controller with specified button - int8_t get_button_controller(ubyte btn); + int8_t get_button_controller(uint8_t btn); // returns the controller with a pov hat - int8_t get_pov_controller(ubyte pov); + int8_t get_pov_controller(uint8_t pov); // note controller is index into ControlList. - float get_axis_value(int8_t controller, ubyte axis, ct_format format, bool invert = false); + float get_axis_value(int8_t controller, uint8_t axis, ct_format format, bool invert = false); // get value of button in seconds, presses, etc. - float get_button_value(int8_t controller, ct_format format, ubyte button); + float get_button_value(int8_t controller, ct_format format, uint8_t button); // get value of pov (using JOYPOV values) - float get_pov_value(int8_t controller, ct_format format, ubyte pov_number, ubyte pov); + float get_pov_value(int8_t controller, ct_format format, uint8_t pov_number, uint8_t pov); // get keyboard info float get_key_value(int key, ct_format format); @@ -282,9 +282,9 @@ private: int last_pov[JOYPOV_NUM]; float povstarts[JOYPOV_NUM][JOYPOV_DIR]; float povtimes[JOYPOV_NUM][JOYPOV_DIR]; - ubyte povpresses[JOYPOV_NUM][JOYPOV_DIR]; + uint8_t povpresses[JOYPOV_NUM][JOYPOV_DIR]; unsigned buttons; - ubyte btnpresses[CT_MAX_BUTTONS]; + uint8_t btnpresses[CT_MAX_BUTTONS]; float btnstarts[CT_MAX_BUTTONS]; float btntimes[CT_MAX_BUTTONS]; } m_ExtCtlStates[CT_MAX_EXTCTLS]; diff --git a/linux/lnxcontroller.cpp b/linux/lnxcontroller.cpp index 9450f3ff..9e8c320a 100644 --- a/linux/lnxcontroller.cpp +++ b/linux/lnxcontroller.cpp @@ -160,7 +160,7 @@ char Ctltext_PovBindings[][16] = {"", "pov-U", "pov-R", "pov-D", "pov-L"}; #define NUM_BTNBINDSTRINGS (sizeof(Ctltext_BtnBindings) / sizeof(Ctltext_AxisBindings[0])) // retrieves binding text for desired function, binding, etc. -const char *lnxgameController::get_binding_text(ct_type type, ubyte ctrl, ubyte bind) { +const char *lnxgameController::get_binding_text(ct_type type, uint8_t ctrl, uint8_t bind) { static char binding_text[32]; const char *str; @@ -439,7 +439,7 @@ ct_config_data lnxgameController::get_controller_value(ct_type type_req) { } // sets the configuration of a function (type must be of an array == CTLBINDS_PER_FUNC) -void lnxgameController::set_controller_function(int id, const ct_type *type, ct_config_data value, const ubyte *flags) { +void lnxgameController::set_controller_function(int id, const ct_type *type, ct_config_data value, const uint8_t *flags) { ct_element elem; if (id >= CT_MAX_ELEMENTS) @@ -475,7 +475,7 @@ void lnxgameController::set_controller_function(int id, const ct_type *type, ct_ } // returns information about a requested function (type must be of an array == CTLBINDS_PER_FUNC) -void lnxgameController::get_controller_function(int id, ct_type *type, ct_config_data *value, ubyte *flags) { +void lnxgameController::get_controller_function(int id, ct_type *type, ct_config_data *value, uint8_t *flags) { type[0] = m_ElementList[id].ctype[0]; type[1] = m_ElementList[id].ctype[1]; *value = makeword(CONTROLLER_CTL_INFO(m_ElementList[id].ctl[0], m_ElementList[id].ctl[1]), @@ -507,7 +507,7 @@ bool lnxgameController::get_packet(int id, ct_packet *packet, ct_format alt_form // check if the element's controller is valid. for (i = 0; i < CTLBINDS_PER_FUNC; i++) { - ubyte value = m_ElementList[id].value[i]; + uint8_t value = m_ElementList[id].value[i]; int8_t controller = m_ElementList[id].ctl[i]; if (controller == -1 || m_ControlList[controller].id == CTID_INVALID) { @@ -569,7 +569,7 @@ skip_packet_read: } // gets sensitivity of axis item -float lnxgameController::get_axis_sensitivity(ct_type axis_type, ubyte axis) { +float lnxgameController::get_axis_sensitivity(ct_type axis_type, uint8_t axis) { axis--; ASSERT(axis < CT_NUM_AXES); @@ -588,7 +588,7 @@ float lnxgameController::get_axis_sensitivity(ct_type axis_type, ubyte axis) { } // sets sensitivity of axis item -void lnxgameController::set_axis_sensitivity(ct_type axis_type, ubyte axis, float val) { +void lnxgameController::set_axis_sensitivity(ct_type axis_type, uint8_t axis, float val) { int i; axis--; @@ -939,7 +939,7 @@ bool lnxgameController::enum_controllers() { } // returns the controller with a pov hat -int8_t lnxgameController::get_pov_controller(ubyte pov) { +int8_t lnxgameController::get_pov_controller(uint8_t pov) { // start from controller 2 because 0, and 1 are reserved for keyboard and mouse ushort pov_flag = CTF_POV << (pov); @@ -950,7 +950,7 @@ int8_t lnxgameController::get_pov_controller(ubyte pov) { return NULL_LNXCONTROLLER; } -int8_t lnxgameController::get_button_controller(ubyte btn) { +int8_t lnxgameController::get_button_controller(uint8_t btn) { unsigned mask; // buttons range from 1-CT_MAX_BUTTONS @@ -973,7 +973,7 @@ int8_t lnxgameController::get_button_controller(ubyte btn) { return NULL_LNXCONTROLLER; } -int8_t lnxgameController::get_axis_controller(ubyte axis) { +int8_t lnxgameController::get_axis_controller(uint8_t axis) { // start from controller 2 because 0, and 1 are reserved for keyboard and mouse if (axis == NULL_BINDING) return NULL_LNXCONTROLLER; @@ -1035,7 +1035,7 @@ void lnxgameController::assign_element(int id, ct_element *elem) { } } -float lnxgameController::get_button_value(int8_t controller, ct_format format, ubyte button) { +float lnxgameController::get_button_value(int8_t controller, ct_format format, uint8_t button) { float val = (float)0.0; if (controller <= NULL_LNXCONTROLLER || controller >= CT_MAX_CONTROLLERS) { @@ -1108,7 +1108,7 @@ float lnxgameController::get_button_value(int8_t controller, ct_format format, u } // note controller is index into ControlList. -float lnxgameController::get_axis_value(int8_t controller, ubyte axis, ct_format format, bool invert) { +float lnxgameController::get_axis_value(int8_t controller, uint8_t axis, ct_format format, bool invert) { struct lnxgameController::t_controller *ctldev; float val = (float)0.0; float normalizer, axisval = 0, nullzone; //, senszone; @@ -1278,7 +1278,7 @@ float lnxgameController::get_axis_value(int8_t controller, ubyte axis, ct_format } // do some pov stuff -float lnxgameController::get_pov_value(int8_t controller, ct_format format, ubyte pov_number, ubyte pov) { +float lnxgameController::get_pov_value(int8_t controller, ct_format format, uint8_t pov_number, uint8_t pov) { float val = (float)0.0; if (controller <= NULL_LNXCONTROLLER || controller >= CT_MAX_CONTROLLERS) { diff --git a/linux/lnxcontroller.h b/linux/lnxcontroller.h index 28b89c19..474d2152 100644 --- a/linux/lnxcontroller.h +++ b/linux/lnxcontroller.h @@ -71,10 +71,10 @@ public: virtual ct_config_data get_controller_value(ct_type type_req); // sets the configuration of a function (type must be of an array == CTLBINDS_PER_FUNC) - virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const ubyte *flags); + virtual void set_controller_function(int id, const ct_type *type, ct_config_data value, const uint8_t *flags); // returns information about a requested function (type must be of an array == CTLBINDS_PER_FUNC) - virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, ubyte *flags); + virtual void get_controller_function(int id, ct_type *type, ct_config_data *value, uint8_t *flags); // temporarily enables or disables a function virtual void enable_function(int id, bool enable); @@ -83,10 +83,10 @@ public: virtual bool get_packet(int id, ct_packet *packet, ct_format alt_format = ctNoFormat); // gets sensitivity of axis item - virtual float get_axis_sensitivity(ct_type axis_type, ubyte axis); + virtual float get_axis_sensitivity(ct_type axis_type, uint8_t axis); // sets sensitivity of axis item - virtual void set_axis_sensitivity(ct_type axis_type, ubyte axis, float val); + virtual void set_axis_sensitivity(ct_type axis_type, uint8_t axis, float val); // assigns an individual function virtual int assign_function(ct_function *fn); @@ -99,7 +99,7 @@ public: virtual unsigned get_joy_raw_values(int *x, int *y); // retrieves binding text for desired function, binding, etc. - virtual const char *get_binding_text(ct_type type, ubyte ctrl, ubyte bind); + virtual const char *get_binding_text(ct_type type, uint8_t ctrl, uint8_t bind); // toggles use of deadzone for controllers void set_controller_deadzone(int ctl, float deadzone); @@ -123,9 +123,9 @@ private: struct ct_element { ct_format format; int8_t ctl[CTLBINDS_PER_FUNC]; - ubyte value[CTLBINDS_PER_FUNC]; + uint8_t value[CTLBINDS_PER_FUNC]; ct_type ctype[CTLBINDS_PER_FUNC]; - ubyte flags[2]; + uint8_t flags[2]; bool enabled; } m_ElementList[CT_MAX_ELEMENTS]; @@ -135,22 +135,22 @@ private: void assign_element(int id, ct_element *elem); // this returns an index into the control list. - int8_t get_axis_controller(ubyte axis); + int8_t get_axis_controller(uint8_t axis); // returns controller with specified button - int8_t get_button_controller(ubyte btn); + int8_t get_button_controller(uint8_t btn); // returns the controller with a pov hat - int8_t get_pov_controller(ubyte pov); + int8_t get_pov_controller(uint8_t pov); // note controller is index into ControlList. - float get_axis_value(int8_t controller, ubyte axis, ct_format format, bool invert = false); + float get_axis_value(int8_t controller, uint8_t axis, ct_format format, bool invert = false); // get value of button in seconds, presses, etc. - float get_button_value(int8_t controller, ct_format format, ubyte button); + float get_button_value(int8_t controller, ct_format format, uint8_t button); // get value of pov (using JOYPOV values) - float get_pov_value(int8_t controller, ct_format format, ubyte pov_number, ubyte pov); + float get_pov_value(int8_t controller, ct_format format, uint8_t pov_number, uint8_t pov); // get keyboard info float get_key_value(int key, ct_format format); @@ -170,9 +170,9 @@ private: int last_pov[JOYPOV_NUM]; float povstarts[JOYPOV_NUM][JOYPOV_DIR]; float povtimes[JOYPOV_NUM][JOYPOV_DIR]; - ubyte povpresses[JOYPOV_NUM][JOYPOV_DIR]; + uint8_t povpresses[JOYPOV_NUM][JOYPOV_DIR]; unsigned buttons; - ubyte btnpresses[CT_MAX_BUTTONS]; + uint8_t btnpresses[CT_MAX_BUTTONS]; float btnstarts[CT_MAX_BUTTONS]; float btntimes[CT_MAX_BUTTONS]; } m_ExtCtlStates[CT_MAX_EXTCTLS]; diff --git a/manage/doorpage.cpp b/manage/doorpage.cpp index 477f523e..8090a286 100644 --- a/manage/doorpage.cpp +++ b/manage/doorpage.cpp @@ -294,7 +294,7 @@ int mng_ReadNewDoorPage(CFILE *infile, mngs_door_page *doorpage) { int mng_ReadDoorPage(CFILE *infile, mngs_door_page *doorpage) { int done = 0; char command; - ubyte len; + uint8_t len; int i; if (!Old_table_method) @@ -364,7 +364,7 @@ int mng_ReadDoorPage(CFILE *infile, mngs_door_page *doorpage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificDoorPage(char *name, mngs_door_page *doorpage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; char tablename[TABLE_NAME_LEN]; diff --git a/manage/gamefilepage.cpp b/manage/gamefilepage.cpp index 166421cf..347beb50 100644 --- a/manage/gamefilepage.cpp +++ b/manage/gamefilepage.cpp @@ -134,7 +134,7 @@ int mng_ReadGamefilePage(CFILE *infile, mngs_gamefile_page *gamefilepage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificGamefilePage(char *name, mngs_gamefile_page *gamefilepage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; char tablename[TABLE_NAME_LEN]; diff --git a/manage/generic.cpp b/manage/generic.cpp index 83afa752..9bb0aaff 100644 --- a/manage/generic.cpp +++ b/manage/generic.cpp @@ -1752,7 +1752,7 @@ int mng_ReadGenericPage(CFILE *infile, mngs_generic_page *genericpage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificGenericPage(char *name, mngs_generic_page *genericpage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; int first_try = 1; char tablename[TABLE_NAME_LEN]; diff --git a/manage/manage.cpp b/manage/manage.cpp index cd75a431..b84e3576 100644 --- a/manage/manage.cpp +++ b/manage/manage.cpp @@ -514,7 +514,7 @@ FILETIME TableTimeThreshold; void BuildOldFileList(FILETIME threshold); #endif typedef struct { - ubyte type; + uint8_t type; char name[PAGENAME_LEN]; } old_file; #define MAX_OLDFILE_ELEMENTS 10000 @@ -1020,7 +1020,7 @@ static mngs_gamefile_page gamefilepage; // TO DEAL WITH YOUR PAGE TYPE. IF YOU FORGET, YOU CAN CORRUPT THE PAGEFILE!!!!! //------------------------------------------------------------------------------ // Given a pagetype, reads it in but discards it. Useful for parsing. -void mng_ReadDummyPage(CFILE *infile, ubyte pagetype) { +void mng_ReadDummyPage(CFILE *infile, uint8_t pagetype) { switch (pagetype) { case PAGETYPE_TEXTURE: mng_ReadNewTexturePage(infile, &texpage); @@ -1063,7 +1063,7 @@ void mng_ReadDummyPage(CFILE *infile, ubyte pagetype) { } // Reads a page in that we don't care about, and writes it right back out // This is useful for replacing a specific page in a file but ignoring others -void mng_ReadWriteDummyPage(CFILE *infile, CFILE *outfile, ubyte pagetype) { +void mng_ReadWriteDummyPage(CFILE *infile, CFILE *outfile, uint8_t pagetype) { switch (pagetype) { case PAGETYPE_TEXTURE: // Read it in, write it out. @@ -1233,7 +1233,7 @@ int mng_RenamePage(char *oldname, char *newname, int pagetype) { // If you want your data to be in the game, it must hook into this function int mng_LoadNetPages(int show_progress) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; char tablename[TABLE_NAME_LEN]; float start_time; int n_pages = 0; @@ -1422,7 +1422,7 @@ int mng_LoadNetPages(int show_progress) { // Loads and allocs all pages found locally int mng_LoadLocalPages() { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int len; mprintf((0, "Overlaying local pages...")); @@ -1667,7 +1667,7 @@ void ReorderPagelocks() { // This helps in the load time of a table file. void ReorderPages(int local) { CFILE *infile, *outfile; - ubyte pagetype; + uint8_t pagetype; int done = 0; int len; #ifdef CLEANING_PAGELOCKS @@ -2034,7 +2034,7 @@ void UpdatePrimitive(char *localname, char *netname, char *primname, int pagetyp } } // Writes a chunk header. Writes chunk id & placeholder length. Returns chunk start pos -int StartManagePage(CFILE *ofile, ubyte pagetype) { +int StartManagePage(CFILE *ofile, uint8_t pagetype) { int chunk_start_pos; // Write pagetype cf_WriteByte(ofile, pagetype); @@ -2098,7 +2098,7 @@ void mng_AssignAndWritePage(int handle, int pagetype, CFILE *outfile) { // Returns 0 on error, else 1 if all is good int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype, int local) { CFILE *infile, *outfile; - ubyte pagetype, replaced = 0; + uint8_t pagetype, replaced = 0; int done = 0, len; mprintf((0, "Replacing '%s' with '%s' (%s).\n", srcname, destname, local ? "locally" : "to network")); @@ -2122,7 +2122,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype return 0; } // Allocate memory for copying - ubyte *copybuffer = (ubyte *)mem_malloc(COPYBUFFER_SIZE); + uint8_t *copybuffer = (uint8_t *)mem_malloc(COPYBUFFER_SIZE); if (!copybuffer) { mprintf((0, "Couldn't allocate memory to replace page %s!\n", srcname)); cfclose(infile); @@ -2266,7 +2266,7 @@ int mng_ReplacePage(char *srcname, char *destname, int handle, int dest_pagetype // If local is 1, deletes from the local table file int mng_DeletePage(char *name, int dest_pagetype, int local) { CFILE *infile, *outfile; - ubyte pagetype, replaced = 0; + uint8_t pagetype, replaced = 0; int done = 0; int deleted = 0; @@ -2292,7 +2292,7 @@ int mng_DeletePage(char *name, int dest_pagetype, int local) { return 0; } // Allocate memory for copying - ubyte *copybuffer = (ubyte *)mem_malloc(COPYBUFFER_SIZE); + uint8_t *copybuffer = (uint8_t *)mem_malloc(COPYBUFFER_SIZE); if (!copybuffer) { mprintf((0, "Couldn't allocate memory to delete page!\n")); cfclose(infile); @@ -2954,7 +2954,7 @@ char *Addon_filename; // Loads and allocs all pages found locally void mng_LoadAddonPages() { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int len; // Set flag & Clear error count diff --git a/manage/megapage.cpp b/manage/megapage.cpp index a6723bf4..e19cdfa4 100644 --- a/manage/megapage.cpp +++ b/manage/megapage.cpp @@ -194,7 +194,7 @@ int mng_ReadNewMegacellPage(CFILE *infile, mngs_megacell_page *megacellpage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificMegacellPage(char *name, mngs_megacell_page *megacellpage, int local) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; if (local) diff --git a/manage/pagelock.cpp b/manage/pagelock.cpp index 2299a29f..b2b3e687 100644 --- a/manage/pagelock.cpp +++ b/manage/pagelock.cpp @@ -723,7 +723,7 @@ int mng_DeleteDuplicatePagelocks() { int mng_UnlockPagelockSeries(const char *names[], int *pagetypes, int num) { ASSERT(num < 500); - ubyte already_done[500]; + uint8_t already_done[500]; memset(already_done, 0, 500); CFILE *infile, *outfile; diff --git a/manage/shippage.cpp b/manage/shippage.cpp index dc2415df..da30c6a2 100644 --- a/manage/shippage.cpp +++ b/manage/shippage.cpp @@ -613,7 +613,7 @@ int mng_ReadNewShipPage(CFILE *infile, mngs_ship_page *shippage) { int mng_ReadShipPage(CFILE *infile, mngs_ship_page *shippage) { int done = 0; char command; - ubyte len; + uint8_t len; int i; int version = 0; @@ -786,21 +786,21 @@ int mng_ReadShipPage(CFILE *infile, mngs_ship_page *shippage) { break; } case SHIPPAGE_COMMAND_FIRE_FLAGS: { - ubyte slot; + uint8_t slot; slot = cf_ReadByte(infile); shippage->ship_struct.fire_flags[slot] = cf_ReadByte(infile); break; } case SHIPPAGE_COMMAND_MAX_AMMO: { - ubyte slot; + uint8_t slot; slot = cf_ReadByte(infile); shippage->ship_struct.max_ammo[slot] = cf_ReadInt(infile); break; } case SHIPPAGE_COMMAND_RESOURCE_USAGE: { - ubyte slot; + uint8_t slot; slot = cf_ReadByte(infile); shippage->ship_struct.static_wb[slot].energy_usage = cf_ReadFloat(infile); @@ -834,7 +834,7 @@ int mng_ReadShipPage(CFILE *infile, mngs_ship_page *shippage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificShipPage(char *name, mngs_ship_page *shippage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; int first_try = 1; char tablename[TABLE_NAME_LEN]; diff --git a/manage/soundpage.cpp b/manage/soundpage.cpp index 6cf0227b..c434b8fb 100644 --- a/manage/soundpage.cpp +++ b/manage/soundpage.cpp @@ -254,7 +254,7 @@ int mng_ReadNewSoundPage(CFILE *infile, mngs_sound_page *soundpage) { int mng_ReadSoundPage(CFILE *infile, mngs_sound_page *soundpage) { int done = 0; char command; - ubyte len; + uint8_t len; int i; if (!Old_table_method) return mng_ReadNewSoundPage(infile, soundpage); @@ -319,7 +319,7 @@ int mng_ReadSoundPage(CFILE *infile, mngs_sound_page *soundpage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificSoundPage(char *name, mngs_sound_page *soundpage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; char tablename[TABLE_NAME_LEN]; if (Loading_locals) { diff --git a/manage/texpage.cpp b/manage/texpage.cpp index e029027e..c79884a6 100644 --- a/manage/texpage.cpp +++ b/manage/texpage.cpp @@ -373,7 +373,7 @@ void mng_WriteTexturePage(CFILE *outfile, mngs_texture_page *texpage) { if (texpage->tex_struct.flags & TF_PROCEDURAL) { // Write out the palette in two halves cf_WriteByte(outfile, TEXPAGE_COMMAND_FIRST_PROC_PAL); - cf_WriteByte(outfile, (ubyte)255); + cf_WriteByte(outfile, (uint8_t)255); for (i = 0; i < 255; i++) { ushort val = texpage->proc_palette[i]; val >>= 8; @@ -382,7 +382,7 @@ void mng_WriteTexturePage(CFILE *outfile, mngs_texture_page *texpage) { } cf_WriteByte(outfile, TEXPAGE_COMMAND_SECOND_PROC_PAL); - cf_WriteByte(outfile, (ubyte)255); + cf_WriteByte(outfile, (uint8_t)255); for (i = 0; i < 255; i++) { ushort val = texpage->proc_palette[i]; val &= 0xFF; @@ -532,7 +532,7 @@ void mng_InitTexturePage(mngs_texture_page *texpage) { int mng_ReadTexturePage(CFILE *infile, mngs_texture_page *texpage) { int done = 0; char command; - ubyte len; + uint8_t len; int i; int proc_index = 0; @@ -611,7 +611,7 @@ int mng_ReadTexturePage(CFILE *infile, mngs_texture_page *texpage) { break; case TEXPAGE_COMMAND_SECOND_PROC_PAL: for (i = 0; i < 255; i++) { - ubyte val = cf_ReadByte(infile); + uint8_t val = cf_ReadByte(infile); texpage->proc_palette[i] &= 0xFF00; texpage->proc_palette[i] |= val; } @@ -760,7 +760,7 @@ int mng_ReadNewTexturePage(CFILE *infile, mngs_texture_page *texpage) { // If local is 1, deletes from the local table file int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { CFILE *infile, *outfile; - ubyte pagetype, replaced = 0; + uint8_t pagetype, replaced = 0; int done = 0; int deleted = 0; memset(&texpage1, 0, sizeof(mngs_texture_page)); @@ -838,7 +838,7 @@ int mng_DeleteTexPageSeries(char *names[], int num_textures, int local) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificTexPage(char *name, mngs_texture_page *texpage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; int first_try = 1; char tablename[TABLE_NAME_LEN]; @@ -955,8 +955,8 @@ int mng_AssignTexPageToTexture(mngs_texture_page *texpage, int n, CFILE *infile) #endif // Try and load our textures bitmaps from the disk - ubyte pageable; - ubyte mipped = 1; + uint8_t pageable; + uint8_t mipped = 1; if (Network_up) pageable = 0; diff --git a/manage/texpage.h b/manage/texpage.h index 3a08480d..33045ba3 100644 --- a/manage/texpage.h +++ b/manage/texpage.h @@ -32,21 +32,21 @@ typedef struct { int num_proc_elements; - ubyte proc_heat, proc_light, proc_thickness, osc_value; + uint8_t proc_heat, proc_light, proc_thickness, osc_value; float proc_evaluation_time, osc_time; - ubyte proc_type[MAX_PROC_ELEMENTS]; + uint8_t proc_type[MAX_PROC_ELEMENTS]; - ubyte proc_frequency[MAX_PROC_ELEMENTS]; - ubyte proc_speed[MAX_PROC_ELEMENTS]; + uint8_t proc_frequency[MAX_PROC_ELEMENTS]; + uint8_t proc_speed[MAX_PROC_ELEMENTS]; - ubyte proc_size[MAX_PROC_ELEMENTS]; + uint8_t proc_size[MAX_PROC_ELEMENTS]; - ubyte proc_x1[MAX_PROC_ELEMENTS]; - ubyte proc_y1[MAX_PROC_ELEMENTS]; - ubyte proc_x2[MAX_PROC_ELEMENTS]; - ubyte proc_y2[MAX_PROC_ELEMENTS]; + uint8_t proc_x1[MAX_PROC_ELEMENTS]; + uint8_t proc_y1[MAX_PROC_ELEMENTS]; + uint8_t proc_x2[MAX_PROC_ELEMENTS]; + uint8_t proc_y2[MAX_PROC_ELEMENTS]; ushort proc_palette[256]; } mngs_texture_page; diff --git a/manage/weaponpage.cpp b/manage/weaponpage.cpp index f7b5af33..c3c52e8b 100644 --- a/manage/weaponpage.cpp +++ b/manage/weaponpage.cpp @@ -902,7 +902,7 @@ int mng_ReadNewWeaponPage(CFILE *infile, mngs_weapon_page *weaponpage) { int mng_ReadWeaponPage(CFILE *infile, mngs_weapon_page *weaponpage) { int done = 0; char command; - ubyte len; + uint8_t len; int i, t; int version = 0; @@ -1159,7 +1159,7 @@ int mng_ReadWeaponPage(CFILE *infile, mngs_weapon_page *weaponpage) { // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificWeaponPage(char *name, mngs_weapon_page *weaponpage) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; int first_try = 1; char tablename[TABLE_NAME_LEN]; @@ -1237,7 +1237,7 @@ try_again:; // Returns 0 on error or couldn't find, else 1 if all is good int mng_FindSpecificWeaponPage(char *name, mngs_weapon_page *weaponpage, int offset) { CFILE *infile; - ubyte pagetype; + uint8_t pagetype; int done = 0, found = 0; if (Loading_locals) { diff --git a/model/newstyle.cpp b/model/newstyle.cpp index 945ca846..49c23b5b 100644 --- a/model/newstyle.cpp +++ b/model/newstyle.cpp @@ -102,9 +102,9 @@ #include "psrand.h" static float face_depth[MAX_POLYGON_VECS]; -static ubyte triangulated_faces[MAX_FACES_PER_ROOM]; +static uint8_t triangulated_faces[MAX_FACES_PER_ROOM]; -static ubyte FacingPass = 0; +static uint8_t FacingPass = 0; static int Multicolor_texture = -1; static vector Fog_plane; @@ -460,7 +460,7 @@ inline void RenderSubmodelFace(poly_model *pm, bsp_info *sm, int facenum) { } // Draw red cross where upper left is - ubyte c0; + uint8_t c0; g3Point p0; p0.p3_flags=0; c0 = g3_RotatePoint(&p0,&LightmapInfo[lmi_handle].upper_left); diff --git a/model/polymodel.cpp b/model/polymodel.cpp index e0a1a67c..63b5d2cc 100644 --- a/model/polymodel.cpp +++ b/model/polymodel.cpp @@ -653,7 +653,7 @@ polymodel_light_type Polymodel_light_type = POLYMODEL_LIGHTING_STATIC; float Polylighting_static_red; float Polylighting_static_green; float Polylighting_static_blue; -ubyte *Polylighting_gouraud; +uint8_t *Polylighting_gouraud; lightmap_object *Polylighting_lightmap_object; vector *Polymodel_light_direction, Polymodel_fog_plane, Polymodel_specular_pos, Polymodel_fog_portal_vert, @@ -1508,7 +1508,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { } else start_index = NULL; - ubyte tempbuf[2000]; + uint8_t tempbuf[2000]; for (i = 0; i < nfaces; i++) { ReadModelVector(&tvec, infile); @@ -1572,7 +1572,7 @@ int ReadNewModelFile(int polynum, CFILE *infile) { } else { pm->submodel[n].faces[i].texnum = -1; - ubyte r, g, b; + uint8_t r, g, b; r = cf_ReadByte(infile); g = cf_ReadByte(infile); b = cf_ReadByte(infile); @@ -2843,7 +2843,7 @@ void DoneLightInstance() { // This is the static light version void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, float r, float g, - float b, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) { + float b, uint32_t f_render_sub, uint8_t use_effect, uint8_t overlay) { poly_model *po; ASSERT(Poly_models[model_num].used); @@ -2921,7 +2921,7 @@ void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normali // This draws a gouraud shaded version void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, vector *lightdir, - float r, float g, float b, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) { + float r, float g, float b, uint32_t f_render_sub, uint8_t use_effect, uint8_t overlay) { poly_model *po; vector light_vec = *lightdir; @@ -3001,7 +3001,7 @@ void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normali // This draws a lightmap shaded version void DrawPolygonModel(vector *pos, matrix *orient, int model_num, float *normalized_time, int flags, - lightmap_object *lm_object, uint32_t f_render_sub, ubyte use_effect, ubyte overlay) { + lightmap_object *lm_object, uint32_t f_render_sub, uint8_t use_effect, uint8_t overlay) { poly_model *po; ASSERT(Poly_models[model_num].used); diff --git a/music/music.h b/music/music.h index dca7dde2..f7fdb96b 100644 --- a/music/music.h +++ b/music/music.h @@ -135,7 +135,7 @@ // //////////////////////////////////////////////////////////////////////////// // generic event item for the queues. struct oms_q_evt { - ubyte cmd; + uint8_t cmd; union { float f; int i; @@ -168,15 +168,15 @@ class oms_stream { } m_data2; // data for internal ops. private: - inline void STREAM_COMMANDP(ubyte cmd, void *p = NULL) { + inline void STREAM_COMMANDP(uint8_t cmd, void *p = NULL) { m_status.cmd = cmd; m_status.parm.p = p; } - inline void STREAM_COMMANDF(ubyte cmd, float cmdparm = 0) { + inline void STREAM_COMMANDF(uint8_t cmd, float cmdparm = 0) { m_status.cmd = cmd; m_status.parm.f = cmdparm; }; - inline void STREAM_COMMANDI(ubyte cmd, int cmdparm = 0) { + inline void STREAM_COMMANDI(uint8_t cmd, int cmdparm = 0) { m_status.cmd = cmd; m_status.parm.f = cmdparm; }; @@ -207,10 +207,10 @@ public: void SEND_STRM_FADEOUT(float time); void SEND_STRM_FADEIN(float time); void SEND_STRM_STOP(); - void SEND_STRM_PLAY(float vol, ubyte count); + void SEND_STRM_PLAY(float vol, uint8_t count); void SEND_STRM_FREE(); void SEND_STRM_SWITCH(bool *switch_flag); // when stream is done, changes value of flag. - void SEND_STRM_NEXT(const char *fname, float vol, ubyte count, + void SEND_STRM_NEXT(const char *fname, float vol, uint8_t count, bool *switch_flag); // specifies next stream to play in current stream. // return values (after process is called, this is updated.) @@ -267,7 +267,7 @@ class OutrageMusicSeq { // music scripting system. struct music_ins { - ubyte cmd; // OMFCMD_ + uint8_t cmd; // OMFCMD_ union { tMusicVal num; char *str; @@ -294,7 +294,7 @@ class OutrageMusicSeq { bool immediate_switch; // immediate switch to new song. bool stream_idle; // are we in a next switch? bool error; - ubyte pad[3]; + uint8_t pad[3]; }; // data diff --git a/music/sequencer.cpp b/music/sequencer.cpp index 7fbd3408..04444911 100644 --- a/music/sequencer.cpp +++ b/music/sequencer.cpp @@ -352,7 +352,7 @@ void OutrageMusicSeq::ExecScript(music_stream *strm) { // get command next_ins: music_ins *cur_ins = &strm->ins[strm->ip]; - ubyte cmd = cur_ins->cmd; + uint8_t cmd = cur_ins->cmd; tMusicVal val = cur_ins->opr.num; char *str = cur_ins->opr.str; const char *name; diff --git a/music/streamer.cpp b/music/streamer.cpp index 33724794..ed5d0bdd 100644 --- a/music/streamer.cpp +++ b/music/streamer.cpp @@ -285,7 +285,7 @@ void oms_stream::SEND_STRM_STOP() { m_q.send(evt); } -void oms_stream::SEND_STRM_PLAY(float vol, ubyte count) { +void oms_stream::SEND_STRM_PLAY(float vol, uint8_t count) { oms_q_evt evt; evt.cmd = OMS_STRM_PLAY; @@ -310,7 +310,7 @@ void oms_stream::SEND_STRM_SWITCH(bool *switch_flag) { m_q.send(evt); } -void oms_stream::SEND_STRM_NEXT(const char *fname, float vol, ubyte count, bool *switch_flag) { +void oms_stream::SEND_STRM_NEXT(const char *fname, float vol, uint8_t count, bool *switch_flag) { oms_q_evt evt; evt.cmd = OMS_STRM_NEXT; diff --git a/netcon/includes/con_dll.h b/netcon/includes/con_dll.h index 3a883597..ed547a4a 100644 --- a/netcon/includes/con_dll.h +++ b/netcon/includes/con_dll.h @@ -304,7 +304,7 @@ const char *GetString(int d) { typedef struct { int me_handle; int it_handle; - ubyte *special_data; + uint8_t *special_data; char *input_string; int input_key; union { @@ -638,15 +638,15 @@ MultiDoConfigLoad_fp DLLMultiDoConfigLoad; typedef int (*MultiLoadSettings_fp)(const char *filename); MultiLoadSettings_fp DLLMultiLoadSettings; -typedef void *(*NetworkReceiveCallback)(ubyte *data, int len, network_address *from); +typedef void *(*NetworkReceiveCallback)(uint8_t *data, int len, network_address *from); -typedef int (*nw_RegisterCallback_fp)(void *nfp, ubyte id); +typedef int (*nw_RegisterCallback_fp)(void *nfp, uint8_t id); nw_RegisterCallback_fp DLLnw_RegisterCallback; -typedef NetworkReceiveCallback (*nw_UnRegisterCallback_fp)(ubyte id); +typedef NetworkReceiveCallback (*nw_UnRegisterCallback_fp)(uint8_t id); nw_UnRegisterCallback_fp DLLnw_UnRegisterCallback; -typedef int (*nw_SendWithID_fp)(ubyte id, ubyte *data, int len, network_address *who_to); +typedef int (*nw_SendWithID_fp)(uint8_t id, uint8_t *data, int len, network_address *who_to); nw_SendWithID_fp DLLnw_SendWithID; typedef int (*nw_DoReceiveCallbacks_fp)(void); @@ -781,7 +781,7 @@ int *DLLNum_network_games_known; bool *DLLDedicated_server; network_game *DLLNetwork_games; int MT_Initialized = 0; -ubyte *DLLNewUIWindow_alpha; +uint8_t *DLLNewUIWindow_alpha; float LastTrackerDataUpdate; void *pconsole = NULL; bool *DLLDP_active; diff --git a/netcon/includes/mdllinit.h b/netcon/includes/mdllinit.h index 3e6afcdc..02e14098 100644 --- a/netcon/includes/mdllinit.h +++ b/netcon/includes/mdllinit.h @@ -287,7 +287,7 @@ DLLMultiGameStarting = (int *)API.vp[6]; DLLMTPilotinfo = (vmt_descent3_struct *)API.vp[7]; DLLNum_network_games_known = API.vp[8]; DLLNetwork_games = (network_game *)API.vp[9]; -DLLNewUIWindow_alpha = (ubyte *)API.vp[10]; +DLLNewUIWindow_alpha = (uint8_t *)API.vp[10]; DLLHelpText1 = (char *)API.vp[11]; DLLHelpText2 = (char *)API.vp[12]; DLLHelpText3 = (char *)API.vp[13]; diff --git a/netcon/lanclient/lanclient.cpp b/netcon/lanclient/lanclient.cpp index 1b5d221d..8241254d 100644 --- a/netcon/lanclient/lanclient.cpp +++ b/netcon/lanclient/lanclient.cpp @@ -426,7 +426,7 @@ int MainMultiplayerMenu() { for (a = 0; a < MAX_NET_GAMES; a++) net_game_txt_items[a] = NULL; int ret = 0; - ubyte oldalpha = *DLLNewUIWindow_alpha; + uint8_t oldalpha = *DLLNewUIWindow_alpha; int cury = 40; DLLSetScreenMode(SM_MENU); diff --git a/netcon/lanclient/lanclient.h b/netcon/lanclient/lanclient.h index 768720bc..faa78cd5 100644 --- a/netcon/lanclient/lanclient.h +++ b/netcon/lanclient/lanclient.h @@ -39,7 +39,7 @@ * * * 14 6/23/99 3:36p Samir - * took out #define ubyte + * took out #define uint8_t * * 13 3/02/99 5:50p Kevin * Ouch. Duplicate structures existed and were conflicting. @@ -83,7 +83,7 @@ #include "ui.h" -// #define ubyte uint8_t +// #define uint8_t uint8_t #define TRACKER_MENU_W 256 #define TRACKER_MENU_H 256 diff --git a/netgames/anarchy/Anarchy.h b/netgames/anarchy/Anarchy.h index 678ce790..b9b7ac90 100644 --- a/netgames/anarchy/Anarchy.h +++ b/netgames/anarchy/Anarchy.h @@ -76,15 +76,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -110,7 +110,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -153,7 +153,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/anarchy/anarchy.cpp b/netgames/anarchy/anarchy.cpp index 4c2af694..280bf083 100644 --- a/netgames/anarchy/anarchy.cpp +++ b/netgames/anarchy/anarchy.cpp @@ -71,8 +71,8 @@ static int Highlight_bmp = -1; #define AHD_EFFICIENCY 2 #define ACM_PLAYERCOLOR 0 #define ACM_NORMAL 1 -static ubyte Anarchy_hud_display = AHD_SCORE; -static ubyte HUD_color_model = ACM_PLAYERCOLOR; +static uint8_t Anarchy_hud_display = AHD_SCORE; +static uint8_t HUD_color_model = ACM_PLAYERCOLOR; static bool display_my_welcome = false; static void DisplayHUDScores(struct tHUDItem *hitem); @@ -127,7 +127,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -823,7 +823,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { return; int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); int x = 520; ddgr_color color = 0; diff --git a/netgames/coop/coop.cpp b/netgames/coop/coop.cpp index 6f8c15e3..4322461b 100644 --- a/netgames/coop/coop.cpp +++ b/netgames/coop/coop.cpp @@ -116,17 +116,17 @@ typedef struct { int Score[2]; } tPlayerStat; -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -179,7 +179,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -238,8 +238,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) } DMFCBase->AddHUDItemCallback(HI_TEXT, DisplayHUDScores); - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); DMFCBase->SetNumberOfTeams(1); netgame_info *netgameinfo = DMFCBase->GetNetgameInfo(); @@ -590,7 +590,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int name_x = DMFCBase->GetGameWindowW() - name_width - 10; int pnum, index = 0; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); DLLgrtext_SetAlpha(alpha); char name[64]; @@ -832,7 +832,7 @@ void OnPLRInterval(void) { DLLgrtext_CenteredPrintf(0, y - height - 1, TXT_LEVELCOMPLETE); if (li) { - DLLgrtext_SetAlpha((ubyte)(alpha * 255.0f)); + DLLgrtext_SetAlpha((uint8_t)(alpha * 255.0f)); DLLgrtext_SetColor(GR_RGB(255, 255, 255)); DLLgrtext_CenteredPrintf(0, y + 1, li->name); } diff --git a/netgames/coop/coop.h b/netgames/coop/coop.h index 72fc7208..552954d0 100644 --- a/netgames/coop/coop.h +++ b/netgames/coop/coop.h @@ -85,15 +85,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -119,7 +119,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -162,7 +162,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/ctf/ctf.cpp b/netgames/ctf/ctf.cpp index 67c83887..224bc6bc 100644 --- a/netgames/ctf/ctf.cpp +++ b/netgames/ctf/ctf.cpp @@ -153,16 +153,16 @@ static int snd_hattrick_reg = -1; typedef struct { int Score[2]; } tPlayerStat; // Overall scores (throughout the game) -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -205,7 +205,7 @@ static void DisplayWelcomeMessage(int player_num); // displays a welcome static void SortTeamScores(int *sortedindex, int *scores); // sorts an array of team scores, filling in the sorted index // numbers static void DisplayHUDScores(struct tHUDItem *hitem); // callback when the HUD info is to be drawn -static void ReceiveGameState(ubyte *data); // callback when a gamestate packet is received from the server +static void ReceiveGameState(uint8_t *data); // callback when a gamestate packet is received from the server static void SendGameState(int playernum); // called when the server is to send gamestate packet to a client static void SetColoredBalls( int playernum, @@ -214,18 +214,18 @@ static void ChangeNumberOfTeams(int newsize); // called when the number of teams static void DoFlagReturnedHome(int team); // called to handle any events when a flag is returned home for a team static void DoLoseFlag(int team); // called to handle any events when a team loses their flag static void TellClientsToAddorDelFlag(int pnum, int team, int objnum, bool add); -static void ServerIsTellingMeToAddorDelAFlag(ubyte *data); +static void ServerIsTellingMeToAddorDelAFlag(uint8_t *data); static void OnGetTokenString(char *src, char *dest, int dest_size); // returns the number of flags a player has, 0 if none, or an invalid pnum static int GetFlagCountForPlayer(int pnum); // returns the mask of which flags this player currently has -static ubyte GetFlagMaskForPlayer(int pnum); +static uint8_t GetFlagMaskForPlayer(int pnum); // adds a flag to a player, as a precaution, it will go through all the players and makes sure that no one // has the flag that is being added. If they are adding the flag, than remove that flag from whoever we thought // had it it will return false if it had to remove a flag from a player -static bool GivePlayerFlag(int pnum, ubyte team); +static bool GivePlayerFlag(int pnum, uint8_t team); // this function takes a flag away from the player, useful for when he scores, spews, disconnects, or observer modes -static void LoseFlagForPlayer(int pnum, ubyte team, bool remove_from_inven = true); +static void LoseFlagForPlayer(int pnum, uint8_t team, bool remove_from_inven = true); /////////////////////////////////////////////// // localization info/functions @@ -240,7 +240,7 @@ const char *GetString(int d) { } static void SaveStatsToFile(char *filename); static void DetermineScore(int precord_num, int column_num, char *buffer, int buffer_size); -static void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use); +static void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use); // This function gets called by the game when it wants to learn some info about the game void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { @@ -268,7 +268,7 @@ void TeamScoreCallback(int team, char *buffer, int buffer_size) { snprintf(buffer, buffer_size, " %d", TeamScores[team]); } -void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use) { +void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use) { player_record *pr = DMFCBase->GetPlayerRecord(precord_num); int flagcount, flagmask; @@ -299,7 +299,7 @@ void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, /////////////////////////////////////////////// // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -380,8 +380,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) DMFCBase->AddSuicideMessage(TXT_SUICIDE6); // setup the Playerstats struct so DMFC can handle it automatically when a new player enters the game - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); DMFCBase->AddHUDItemCallback(HI_TEXT, DisplayHUDScores); @@ -803,7 +803,7 @@ void OnServerCollide(object *me_obj, object *it_obj) { (it_obj->id == FlagIDs[GREEN_TEAM]) || (it_obj->id == FlagIDs[YELLOW_TEAM])) { // Start a packet for the collide - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; DMFCBase->StartPacket(data, SPID_COLLIDE, &count); int start = count; @@ -832,7 +832,7 @@ void OnServerCollide(object *me_obj, object *it_obj) { // 2.1) Add flag to inventory // 2.2) Set rotating balls // 2.3) Print out message -void OnClientCollide(ubyte *data) { +void OnClientCollide(uint8_t *data) { object *me_obj, *it_obj; int me_roomnum; int count = 0; @@ -1728,8 +1728,8 @@ void OnPrintScores(int level) { // and other various settings related to a flag spew void HandlePlayerSpew(int pnum) { // Handle dropping the flag if the player had one - ubyte flaginfo = GetFlagCountForPlayer(pnum); - ubyte flagmask = GetFlagMaskForPlayer(pnum); + uint8_t flaginfo = GetFlagCountForPlayer(pnum); + uint8_t flagmask = GetFlagMaskForPlayer(pnum); if (flaginfo == 0) { return; @@ -1800,7 +1800,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { if (!First_game_frame || DisplayScoreScreen) // interval hasn't been called yet or we are display the stats return; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; @@ -2217,7 +2217,7 @@ void TellClientsToAddorDelFlag(int pnum, int team, int objnum, bool add) { DLLMultiSendObject(&dObjects[objnum], false, true); } - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int size = 0; DMFCBase->StartPacket(data, SPID_ADDDELFLAG, &size); @@ -2233,7 +2233,7 @@ void TellClientsToAddorDelFlag(int pnum, int team, int objnum, bool add) { DMFCBase->SendPacket(data, size, SP_ALL); } -void ServerIsTellingMeToAddorDelAFlag(ubyte *data) { +void ServerIsTellingMeToAddorDelAFlag(uint8_t *data) { int size = 0; int pnum, team; bool add; @@ -2273,48 +2273,48 @@ void OnTimerScoreKill(void) { } /////////////////////////////////////////////////////////////////////////////////// -int PackByte(ubyte byte, ubyte *buffer, int pos) { +int PackByte(uint8_t byte, uint8_t *buffer, int pos) { buffer[pos] = byte; pos++; return pos; } -int UnPackByte(ubyte *byte, ubyte *buffer, int pos) { +int UnPackByte(uint8_t *byte, uint8_t *buffer, int pos) { *byte = buffer[pos]; pos++; return pos; } -int PackBytes(ubyte *bytes, int count, ubyte *buffer, int pos) { +int PackBytes(uint8_t *bytes, int count, uint8_t *buffer, int pos) { memcpy(&buffer[pos], bytes, count); pos += count; return pos; } -int UnPackBytes(ubyte *bytes, int count, ubyte *buffer, int pos) { +int UnPackBytes(uint8_t *bytes, int count, uint8_t *buffer, int pos) { memcpy(bytes, &buffer[pos], count); pos += count; return pos; } -int PackWord(ushort word, ubyte *buffer, int pos) { return PackBytes((ubyte *)&word, sizeof(ushort), buffer, pos); } +int PackWord(ushort word, uint8_t *buffer, int pos) { return PackBytes((uint8_t *)&word, sizeof(ushort), buffer, pos); } -int UnPackWord(ushort *word, ubyte *buffer, int pos) { return UnPackBytes((ubyte *)word, sizeof(ushort), buffer, pos); } +int UnPackWord(ushort *word, uint8_t *buffer, int pos) { return UnPackBytes((uint8_t *)word, sizeof(ushort), buffer, pos); } -int PackInt(int data, ubyte *buffer, int pos) { return PackBytes((ubyte *)&data, sizeof(int), buffer, pos); } +int PackInt(int data, uint8_t *buffer, int pos) { return PackBytes((uint8_t *)&data, sizeof(int), buffer, pos); } -int UnPackInt(int *data, ubyte *buffer, int pos) { return UnPackBytes((ubyte *)data, sizeof(int), buffer, pos); } +int UnPackInt(int *data, uint8_t *buffer, int pos) { return UnPackBytes((uint8_t *)data, sizeof(int), buffer, pos); } -int PackArray(ubyte *data, int size, int count, ubyte *buffer, int pos) { +int PackArray(uint8_t *data, int size, int count, uint8_t *buffer, int pos) { return PackBytes(data, size * count, buffer, pos); } -int UnPackArray(ubyte *data, int size, int count, ubyte *buffer, int pos) { +int UnPackArray(uint8_t *data, int size, int count, uint8_t *buffer, int pos) { return UnPackBytes(data, size * count, buffer, pos); } void SendGameState(int pnum) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; int i; @@ -2372,7 +2372,7 @@ void SendGameState(int pnum) { DMFCBase->SendPacket(data, count, pnum); } -void ReceiveGameState(ubyte *data) { +void ReceiveGameState(uint8_t *data) { int count = 0; int num_teams; int i; @@ -2482,7 +2482,7 @@ int GetFlagCountForPlayer(int pnum) { } // returns the mask of which flags this player currently has -ubyte GetFlagMaskForPlayer(int pnum) { +uint8_t GetFlagMaskForPlayer(int pnum) { // 1st check the pnum, make sure it is OK, if it isn't, return 0, meaning no flags if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { // invalid player number, return 0 flags @@ -2491,7 +2491,7 @@ ubyte GetFlagMaskForPlayer(int pnum) { } int flag_mask = 0; - ubyte mask = 0x01; + uint8_t mask = 0x01; // 2nd go through all the teams flags, and check the player's inventory, see if they have the ID, // if so, OR the current mask to the running flag_mask @@ -2510,7 +2510,7 @@ ubyte GetFlagMaskForPlayer(int pnum) { // adds a flag to a player, as a precaution, it will go through all the players and makes sure that no one // has the flag that is being added. If they are adding the flag, than remove that flag from whoever we thought // had it it will return false if it had to remove a flag from a player -bool GivePlayerFlag(int pnum, ubyte team) { +bool GivePlayerFlag(int pnum, uint8_t team) { // 1st check the player num, make sure it is valid if (!DMFCBase->CheckPlayerNum(pnum)) { // not a valid player @@ -2596,7 +2596,7 @@ bool GivePlayerFlag(int pnum, ubyte team) { } // this function takes a flag away from the player, useful for when he scores, spews, disconnects, or observer modes -void LoseFlagForPlayer(int pnum, ubyte team, bool remove_from_inven) { +void LoseFlagForPlayer(int pnum, uint8_t team, bool remove_from_inven) { // 1st check the player number if (pnum < 0 || pnum >= DLLMAX_PLAYERS) { mprintf((0, "CTF:Invalid pnum passed to LoseFlagForPlayer()\n")); diff --git a/netgames/ctf/ctf.h b/netgames/ctf/ctf.h index 7f8e10bd..47740d27 100644 --- a/netgames/ctf/ctf.h +++ b/netgames/ctf/ctf.h @@ -43,7 +43,7 @@ void OnGameStateRequest(int player_num); void OnPlayerConnect(int player_num); void OnClientPlayerKilled(object *killer_obj, int victim_pnum); void OnServerCollide(object *me_obj, object *it_obj); -void OnClientCollide(ubyte *data); +void OnClientCollide(uint8_t *data); void OnPLRInterval(void); void OnPLRInit(void); bool OnCanChangeTeam(int pnum, int newteam); @@ -62,15 +62,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -96,7 +96,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -139,7 +139,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/dmfc/dmfcbase.cpp b/netgames/dmfc/dmfcbase.cpp index 4d2b0f5c..2a5126c0 100644 --- a/netgames/dmfc/dmfcbase.cpp +++ b/netgames/dmfc/dmfcbase.cpp @@ -479,9 +479,9 @@ char **DMFCStringTable; int DMFCStringTableSize = 0; const char *_DMFCErrorString = "DMFC Missing String"; -ubyte seeds1[31] = {49, 73, 0, 44, 87, 253, 35, 74, 62, 250, 4, 247, 251, 72, 244, 30, +uint8_t seeds1[31] = {49, 73, 0, 44, 87, 253, 35, 74, 62, 250, 4, 247, 251, 72, 244, 30, 59, 61, 60, 52, 50, 237, 23, 48, 56, 55, 65, 232, 231, 230, 0}; -ubyte seeds2[6] = {70, 95, 103, 102, 112, 0}; +uint8_t seeds2[6] = {70, 95, 103, 102, 112, 0}; const char *DMFCGetString(int d) { if ((d < 0) || (d >= DMFCStringTableSize)) @@ -1829,13 +1829,13 @@ float DMFCBase::ConvertHUDAlpha(float normal) { return normal; return normal * 0.3f; } -ubyte DMFCBase::ConvertHUDAlpha(ubyte normal) { +uint8_t DMFCBase::ConvertHUDAlpha(uint8_t normal) { if (!IsMenuUp()) return normal; float conv = ((float)normal); conv = conv * 0.3f; - return (ubyte)conv; + return (uint8_t)conv; } bool DMFCBase::DMFC_compare_slots(int a, int b) { @@ -2024,7 +2024,7 @@ void DMFCBase::DisplayOutrageLogo(void) { // // // Sets the level for displaying of Player's Callsigns on the HUD -void DMFCBase::SwitchShowHudCallsignLevel(ubyte level, bool announce) { +void DMFCBase::SwitchShowHudCallsignLevel(uint8_t level, bool announce) { m_iMyPreferredHUDCallsignLevel = level; if (level > m_iServerHUDCallsignLevel) @@ -2062,7 +2062,7 @@ void DMFCBase::SwitchShowHudCallsignLevel(ubyte level, bool announce) { // // // Sets the max level of HUD callsign displayage...determined by the server -void DMFCBase::SwitchServerHudCallsignLevel(ubyte level) { +void DMFCBase::SwitchServerHudCallsignLevel(uint8_t level) { switch (level) { case HUD_CALLSIGN_LEVEL_FULL: m_iServerHUDCallsignLevel = level; @@ -2142,7 +2142,7 @@ int DMFCBase::GetCounterMeasureOwner(object *robot) { // DMFCBase::EncryptData // // Encrypts (weak) a buffer of data -void DMFCBase::EncryptData(ubyte *data, int size) { +void DMFCBase::EncryptData(uint8_t *data, int size) { if (!data) return; if (size <= 0) @@ -2159,7 +2159,7 @@ void DMFCBase::EncryptData(ubyte *data, int size) { // DMFCBase::DecryptData // // Decrypts a buffer of data -void DMFCBase::DecryptData(ubyte *data, int size) { +void DMFCBase::DecryptData(uint8_t *data, int size) { if (!data) return; if (size <= 0) @@ -2631,8 +2631,8 @@ void DMFCBase::AddWeaponHashArray(const char *parent, int count, char **array) { // returns: 1 if size given was <=0 (if so all previous user stats will be removed) // 0 all went ok // -1 out of memory (all user stats memory will be freed) -int DMFCBase::SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)) { +int DMFCBase::SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)) { return PRec_SetupUserPRec(sizeof_individual_data, pack_callback, unpack_callback); } @@ -4240,7 +4240,7 @@ void DMFCBase::RespawnPlayer(int pnum, bool spew_energy_and_shields, bool spew_e // If you are going to create submenus you MUST use this function. along with: // void SetState(int state); // bool SetStateItemList(int count, ... ); for MIT_STATE items -MenuItem *DMFCBase::CreateMenuItem(const char *title, char type, ubyte flags, void (*fp)(int), ...) { +MenuItem *DMFCBase::CreateMenuItem(const char *title, char type, uint8_t flags, void (*fp)(int), ...) { MenuItem *p; if (type != MIT_CUSTOM && type != MIT_STATE) { diff --git a/netgames/dmfc/dmfcclient.cpp b/netgames/dmfc/dmfcclient.cpp index 8ee47b08..3f91ea79 100644 --- a/netgames/dmfc/dmfcclient.cpp +++ b/netgames/dmfc/dmfcclient.cpp @@ -692,7 +692,7 @@ void DMFCBase::OnSpecialPacket(void) { return; // see if we have a handler for the ID, if so, call the handler, else do nothing - ubyte *data = Data->special_data; + uint8_t *data = Data->special_data; int id = data[0]; tSPHandler *current; @@ -948,7 +948,7 @@ void DMFCBase::OnPlayerConnect(int player_num) { // // // There is a control message sent from someone -void DMFCBase::OnControlMessage(ubyte msg, int from_pnum) { +void DMFCBase::OnControlMessage(uint8_t msg, int from_pnum) { switch (msg) { case CM_KICKED: { DLLAddHUDMessage(DTXT_KICKEDMSG); @@ -999,7 +999,7 @@ void DMFCBase::OnClientShowUI(int id, void *user_data) { case UIID_TEAMPLACEMENT: { bool clients_wait; bool call_from_game; - ubyte d = *(ubyte *)user_data; + uint8_t d = *(uint8_t *)user_data; clients_wait = (d & 0x01) ? true : false; call_from_game = (d & 0x02) ? false : true; diff --git a/netgames/dmfc/dmfcdllinit.h b/netgames/dmfc/dmfcdllinit.h index 5f883099..5e9056d2 100644 --- a/netgames/dmfc/dmfcdllinit.h +++ b/netgames/dmfc/dmfcdllinit.h @@ -30,7 +30,7 @@ * * * 64 9/28/99 10:55a Jeff - * changed size of pointer for mastertracker game from ubyte* to int* + * changed size of pointer for mastertracker game from uint8_t* to int* * * 63 8/15/99 4:36p Jeff * finished exporting all inventory class functions. export object_info diff --git a/netgames/dmfc/dmfcfunctions.cpp b/netgames/dmfc/dmfcfunctions.cpp index 5cabc61d..cbf012bf 100644 --- a/netgames/dmfc/dmfcfunctions.cpp +++ b/netgames/dmfc/dmfcfunctions.cpp @@ -134,12 +134,12 @@ DMFCFUNCTION void (*DLLGetGameAPI)(game_api *); DMFCFUNCTION bool (*DLLAddHUDMessage)(const char *format, ...); DMFCFUNCTION void (*DLLDebug_ConsolePrintf)(int n, const char *format, ...); DMFCFUNCTION void (*DLLMultiSendClientExecuteDLL)(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info); -DMFCFUNCTION void (*DLLMultiSendObject)(object *obj, ubyte announce, ubyte demo_record); +DMFCFUNCTION void (*DLLMultiSendObject)(object *obj, uint8_t announce, uint8_t demo_record); DMFCFUNCTION void (*DLLMultiPaintGoalRooms)(int *texcolors); -DMFCFUNCTION void (*DLLMultiSendSpecialPacket)(int slot, ubyte *outdata, int size); +DMFCFUNCTION void (*DLLMultiSendSpecialPacket)(int slot, uint8_t *outdata, int size); DMFCFUNCTION void (*DLLComputeRoomCenter)(vector *vp, room *rp); DMFCFUNCTION int (*DLLGetGoalRoomForTeam)(int teamnum); -DMFCFUNCTION int (*DLLObjCreate)(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, +DMFCFUNCTION int (*DLLObjCreate)(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle); DMFCFUNCTION int (*DLLFindObjectIDName)(const char *name); DMFCFUNCTION void (*DLLObjSetPosNoMark)(object *objp, vector *newpos, int roomnum, matrix *orient, @@ -168,8 +168,8 @@ DMFCFUNCTION void (*DLLgrtext_Printf)(int x, int y, const char *fmt, ...); DMFCFUNCTION void (*DLLgrtext_Flush)(void); DMFCFUNCTION void (*DLLgrtext_SetColor)(ddgr_color col); DMFCFUNCTION void (*DLLgrtext_SetFancyColor)(ddgr_color col1, ddgr_color col2, ddgr_color col3, ddgr_color col4); -DMFCFUNCTION void (*DLLgrtext_SetAlpha)(ubyte alpha); -DMFCFUNCTION ubyte (*DLLgrtext_GetAlpha)(void); +DMFCFUNCTION void (*DLLgrtext_SetAlpha)(uint8_t alpha); +DMFCFUNCTION uint8_t (*DLLgrtext_GetAlpha)(void); DMFCFUNCTION void (*DLLgrtext_SetFont)(int font_handle); DMFCFUNCTION int (*DLLgrtext_GetFont)(void); DMFCFUNCTION int (*DLLgrtext_GetTextLineWidth)(const char *str); @@ -179,34 +179,34 @@ DMFCFUNCTION bool (*DLLAddColoredHUDMessage)(ddgr_color color, const char *forma DMFCFUNCTION int (*DLLbm_h)(int handle, int miplevel); DMFCFUNCTION int (*DLLbm_w)(int handle, int miplevel); DMFCFUNCTION void (*DLLrend_DrawSimpleBitmap)(int bm_handle, int x, int y); -DMFCFUNCTION void (*DLLMultiClientSendSpecialPacket)(ubyte *outdate, int size); +DMFCFUNCTION void (*DLLMultiClientSendSpecialPacket)(uint8_t *outdate, int size); DMFCFUNCTION bool (*DLLAddBlinkingHUDMessage)(char *format, ...); DMFCFUNCTION void (*DLLInvReset)(int playernum, bool reset_all); DMFCFUNCTION void (*DLLAddHUDItem)(tHUDItem *item); DMFCFUNCTION void (*DLLRenderHUDQuad)(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, - ubyte alpha, int sat_count); -DMFCFUNCTION void (*DLLRenderHUDText)(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); + uint8_t alpha, int sat_count); +DMFCFUNCTION void (*DLLRenderHUDText)(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); DMFCFUNCTION void (*DLLMultiEndLevel)(void); DMFCFUNCTION ushort *(*DLLbm_data)(int handle, int miplevel); DMFCFUNCTION int (*DLLbm_AllocBitmap)(int w, int h, int add_mem); DMFCFUNCTION void (*DLLrend_FillRect)(ddgr_color color, int x1, int y1, int x2, int y2); DMFCFUNCTION bool (*DLLbm_CreateChunkedBitmap)(int bm_handle, chunked_bitmap *chunk); DMFCFUNCTION void (*DLLbm_DestroyChunkedBitmap)(chunked_bitmap *chunk); -DMFCFUNCTION void (*DLLrend_DrawChunkedBitmap)(chunked_bitmap *chunk, int x, int y, ubyte alpha); +DMFCFUNCTION void (*DLLrend_DrawChunkedBitmap)(chunked_bitmap *chunk, int x, int y, uint8_t alpha); DMFCFUNCTION void (*DLLrend_DrawScaledChunkedBitmap)(chunked_bitmap *chunk, int x, int y, int neww, int newh, - ubyte alpha); + uint8_t alpha); DMFCFUNCTION void (*DLLOpenCFILE)(CFILE **handle, const char *filename, const char *mode); DMFCFUNCTION void (*DLLcfclose)(CFILE *cfp); DMFCFUNCTION int (*DLLcfeof)(CFILE *cfp); DMFCFUNCTION int (*DLLcfexist)(const char *filename); -DMFCFUNCTION int (*DLLcf_ReadBytes)(ubyte *buf, int count, CFILE *cfp); +DMFCFUNCTION int (*DLLcf_ReadBytes)(uint8_t *buf, int count, CFILE *cfp); DMFCFUNCTION int (*DLLcf_ReadInt)(CFILE *cfp); DMFCFUNCTION short (*DLLcf_ReadShort)(CFILE *cfp); DMFCFUNCTION int8_t (*DLLcf_ReadByte)(CFILE *cfp); DMFCFUNCTION float (*DLLcf_ReadFloat)(CFILE *cfp); DMFCFUNCTION double (*DLLcf_ReadDouble)(CFILE *cfp); DMFCFUNCTION int (*DLLcf_ReadString)(char *buf, size_t n, CFILE *cfp); -DMFCFUNCTION int (*DLLcf_WriteBytes)(const ubyte *buf, int count, CFILE *cfp); +DMFCFUNCTION int (*DLLcf_WriteBytes)(const uint8_t *buf, int count, CFILE *cfp); DMFCFUNCTION int (*DLLcf_WriteString)(CFILE *cfp, const char *buf); DMFCFUNCTION void (*DLLcf_WriteInt)(CFILE *cfp, int i); DMFCFUNCTION void (*DLLcf_WriteShort)(CFILE *cfp, short s); @@ -220,7 +220,7 @@ DMFCFUNCTION void (*DLLnw_GetNumbersFromHostAddress)(network_address *address, c DMFCFUNCTION int (*DLLnw_GetThisIP)(void); DMFCFUNCTION bool (*DLLCreateStringTable)(const char *filename, char ***table, int *size); DMFCFUNCTION void (*DLLDestroyStringTable)(char **table, int size); -DMFCFUNCTION void (*DLLRenderHUDTextFlags)(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); +DMFCFUNCTION void (*DLLRenderHUDTextFlags)(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); DMFCFUNCTION void (*DLLPlayerSetHUDNameFOV)(int fov); DMFCFUNCTION void (*DLLGetUltimateParentForObject)(object **parent, object *child); DMFCFUNCTION void (*DLLSetObjectDeadFlagRaw)(object *obj, bool tell_clients_to_remove, bool tell_clients_to_play_sound); @@ -268,7 +268,7 @@ DMFCFUNCTION int (*DLLPollUI)(void); DMFCFUNCTION void (*DLLRemoveUITextItem)(void *item); DMFCFUNCTION void *(*DLLCreateNewUITextItem)(const char *newtext, uint32_t color, int font); DMFCFUNCTION void (*DLLRemoveUIBmpItem)(void *item); -DMFCFUNCTION void *(*DLLCreateNewUIBmpItem)(int handle, ubyte alpha); +DMFCFUNCTION void *(*DLLCreateNewUIBmpItem)(int handle, uint8_t alpha); DMFCFUNCTION void *(*DLLUIConsoleGadgetCreate)(void *parentid, int id, int x, int y, int font, int cols, int rows, int flags); DMFCFUNCTION void (*DLLUIConsoleGadgetputs)(void *item, const char *str); @@ -406,14 +406,14 @@ DMFCFUNCTION void (*DLLrend_SetMipState)(int8_t); DMFCFUNCTION void (*DLLrend_SetFogState)(int8_t on); DMFCFUNCTION void (*DLLrend_SetFiltering)(int8_t state); DMFCFUNCTION void (*DLLrend_SetOverlayMap)(int handle); -DMFCFUNCTION void (*DLLrend_SetOverlayType)(ubyte type); +DMFCFUNCTION void (*DLLrend_SetOverlayType)(uint8_t type); DMFCFUNCTION void (*DLLrend_ClearScreen)(ddgr_color color); DMFCFUNCTION void (*DLLrend_SetPixel)(ddgr_color color, int x, int y); DMFCFUNCTION ddgr_color (*DLLrend_GetPixel)(int x, int y); DMFCFUNCTION void (*DLLrend_FillCircle)(ddgr_color col, int x, int y, int rad); DMFCFUNCTION void (*DLLrend_DrawCircle)(int x, int y, int rad); DMFCFUNCTION void (*DLLrend_SetAlphaType)(int8_t); -DMFCFUNCTION void (*DLLrend_SetAlphaValue)(ubyte val); +DMFCFUNCTION void (*DLLrend_SetAlphaValue)(uint8_t val); DMFCFUNCTION void (*DLLrend_SetWrapType)(wrap_type val); DMFCFUNCTION void (*DLLrend_SetZBias)(float z_bias); DMFCFUNCTION void (*DLLrend_SetZBufferWriteMask)(int state); @@ -436,7 +436,7 @@ DMFCFUNCTION int (*GetPlayerRankIndex)(int pnum, char *rankbuf); DMFCFUNCTION int (*DLLVisEffectAllocate)(void); DMFCFUNCTION int (*DLLVisEffectFree)(int visnum); DMFCFUNCTION int (*DLLVisEffectInitType)(vis_effect *vis); -DMFCFUNCTION int (*DLLVisEffectCreate)(ubyte type, ubyte id, int roomnum, vector *pos); +DMFCFUNCTION int (*DLLVisEffectCreate)(uint8_t type, uint8_t id, int roomnum, vector *pos); DMFCFUNCTION void (*DLLVisEffectLink)(int visnum, int roomnum); DMFCFUNCTION void (*DLLVisEffectUnlink)(int visnum); DMFCFUNCTION void (*DLLVisEffectRelink)(int visnum, int newroomnum); @@ -445,7 +445,7 @@ DMFCFUNCTION void (*DLLCreateRandomSparks)(int num_sparks, vector *pos, int room float force_scalar); DMFCFUNCTION void (*DLLCreateRandomLineSparks)(int num_sparks, vector *pos, int roomnum, ushort color, float force_scalar); -DMFCFUNCTION int (*DLLVisEffectCreateControlled)(ubyte type, object *parent, ubyte id, int roomnum, vector *pos, +DMFCFUNCTION int (*DLLVisEffectCreateControlled)(uint8_t type, object *parent, uint8_t id, int roomnum, vector *pos, float lifetime, vector *velocity, int phys_flags, float size, float mass, float drag, bool isreal); DMFCFUNCTION void (*DLLCreateRandomParticles)(int num_sparks, vector *pos, int roomnum, int bm_handle, float size, @@ -461,16 +461,16 @@ DMFCFUNCTION void (*DLLg3_StartInstanceMatrix)(vector *pos, matrix *orient); DMFCFUNCTION void (*DLLg3_StartInstanceAngles)(vector *pos, angvec *angles); DMFCFUNCTION void (*DLLg3_DoneInstance)(); DMFCFUNCTION bool (*DLLg3_CheckNormalFacing)(vector *v, vector *norm); -DMFCFUNCTION ubyte (*DLLg3_RotatePoint)(g3Point *dest, vector *src); +DMFCFUNCTION uint8_t (*DLLg3_RotatePoint)(g3Point *dest, vector *src); DMFCFUNCTION void (*DLLg3_ProjectPoint)(g3Point *point); DMFCFUNCTION float (*DLLg3_CalcPointDepth)(vector *pnt); DMFCFUNCTION void (*DLLg3_Point2Vec)(vector *v, short sx, short sy); -DMFCFUNCTION ubyte (*DLLg3_CodePoint)(g3Point *point); +DMFCFUNCTION uint8_t (*DLLg3_CodePoint)(g3Point *point); DMFCFUNCTION vector *(*DLLg3_RotateDeltaX)(vector *dest, float dx); DMFCFUNCTION vector *(*DLLg3_RotateDeltaY)(vector *dest, float dy); DMFCFUNCTION vector *(*DLLg3_RotateDeltaZ)(vector *dest, float dz); DMFCFUNCTION vector *(*DLLg3_RotateDeltaVec)(vector *dest, vector *src); -DMFCFUNCTION ubyte (*DLLg3_AddDeltaVec)(g3Point *dest, g3Point *src, vector *deltav); +DMFCFUNCTION uint8_t (*DLLg3_AddDeltaVec)(g3Point *dest, g3Point *src, vector *deltav); DMFCFUNCTION int (*DLLg3_DrawPoly)(int nv, g3Point **pointlist, int bm, int map_type, g3Codes *clip_codes); DMFCFUNCTION void (*DLLg3_DrawSphere)(ddgr_color color, g3Point *pnt, float rad); DMFCFUNCTION void (*DLLg3_CheckAndDrawPoly)(int nv, g3Point **pointlist, int bm, vector *norm, vector *pnt); @@ -479,7 +479,7 @@ DMFCFUNCTION void (*DLLg3_DrawBitmap)(vector *pos, float width, float height, in DMFCFUNCTION void (*DLLg3_DrawRotatedBitmap)(vector *pos, angle rot_angle, float width, float height, int bm, int color); DMFCFUNCTION void (*DLLg3_DrawBox)(ddgr_color color, g3Point *pnt, float rad); -DMFCFUNCTION void (*DLLg3_SetCustomClipPlane)(ubyte state, vector *pnt, vector *normal); +DMFCFUNCTION void (*DLLg3_SetCustomClipPlane)(uint8_t state, vector *pnt, vector *normal); DMFCFUNCTION void (*DLLg3_SetFarClipZ)(float z); DMFCFUNCTION g3Point **(*DLLg3_ClipPolygon)(g3Point **pointlist, int *nv, g3Codes *cc); DMFCFUNCTION void (*DLLg3_FreeTempPoints)(g3Point **pointlist, int nv); diff --git a/netgames/dmfc/dmfcinputcommand.cpp b/netgames/dmfc/dmfcinputcommand.cpp index 1ad0245c..747a1f72 100644 --- a/netgames/dmfc/dmfcinputcommand.cpp +++ b/netgames/dmfc/dmfcinputcommand.cpp @@ -444,7 +444,7 @@ void DMFCInputCommand_HudCallsigns(const char *input_string) { return; } - ubyte level = HUD_CALLSIGN_LEVEL_NONE; + uint8_t level = HUD_CALLSIGN_LEVEL_NONE; if (!stricmp(s, DTXT_OSM_FULL)) level = HUD_CALLSIGN_LEVEL_FULL; else if (!stricmp(s, DTXT_IC_TEAM)) @@ -473,7 +473,7 @@ void DMFCInputCommand_ServerHudCallsigns(const char *input_string) { return; } - ubyte level = HUD_CALLSIGN_LEVEL_NONE; + uint8_t level = HUD_CALLSIGN_LEVEL_NONE; if (!stricmp(s, DTXT_OSM_FULL)) level = HUD_CALLSIGN_LEVEL_FULL; else if (!stricmp(s, DTXT_IC_TEAM)) @@ -807,7 +807,7 @@ void DMFCInputCommand_KillMsgFilter(const char *input_string) { return; } - ubyte level = DM_FILTER_FULL; + uint8_t level = DM_FILTER_FULL; if (!stricmp(s, DTXT_PLAIN_NONE)) level = DM_FILTER_NONE; else if (!stricmp(s, DTXT_OSM_SIMPLE)) diff --git a/netgames/dmfc/dmfcinterface.cpp b/netgames/dmfc/dmfcinterface.cpp index 6596495c..617dd3f2 100644 --- a/netgames/dmfc/dmfcinterface.cpp +++ b/netgames/dmfc/dmfcinterface.cpp @@ -367,7 +367,7 @@ void DLLFUNCCALL IDMFC_OnPlayerConnect(IDMFC *instance, int player_num) { instance->OnPlayerConnect(player_num); } -void DLLFUNCCALL IDMFC_OnControlMessage(IDMFC *instance, ubyte msg, int from_pnum) { +void DLLFUNCCALL IDMFC_OnControlMessage(IDMFC *instance, uint8_t msg, int from_pnum) { assert(instance != NULL); instance->OnControlMessage(msg, from_pnum); } @@ -528,17 +528,17 @@ int DLLFUNCCALL IDMFC_GetMeObjNum(IDMFC *instance) { return instance->GetMeObjNum(); } -void DLLFUNCCALL IDMFC_RegisterPacketReceiver(IDMFC *instance, ubyte id, void (*func)(ubyte *)) { +void DLLFUNCCALL IDMFC_RegisterPacketReceiver(IDMFC *instance, uint8_t id, void (*func)(uint8_t *)) { assert(instance != NULL); instance->RegisterPacketReceiver(id, func); } -void DLLFUNCCALL IDMFC_StartPacket(IDMFC *instance, ubyte *data, ubyte id, int *count) { +void DLLFUNCCALL IDMFC_StartPacket(IDMFC *instance, uint8_t *data, uint8_t id, int *count) { assert(instance != NULL); instance->StartPacket(data, id, count); } -void DLLFUNCCALL IDMFC_SendPacket(IDMFC *instance, ubyte *data, int size, int destination) { +void DLLFUNCCALL IDMFC_SendPacket(IDMFC *instance, uint8_t *data, int size, int destination) { assert(instance != NULL); instance->SendPacket(data, size, destination); } @@ -563,17 +563,17 @@ void DLLFUNCCALL IDMFC_SendTeamAssignment(IDMFC *instance, int playernum, int te instance->SendTeamAssignment(playernum, team, spew_on_respawn); } -void DLLFUNCCALL IDMFC_GetTeamAssignmentPacket(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_GetTeamAssignmentPacket(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->GetTeamAssignmentPacket(data); } -void DLLFUNCCALL IDMFC_GetChangeTeamPacket(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_GetChangeTeamPacket(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->GetChangeTeamPacket(data); } -void DLLFUNCCALL IDMFC_GetGameStateRequest(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_GetGameStateRequest(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->GetGameStateRequest(data); } @@ -583,7 +583,7 @@ void DLLFUNCCALL IDMFC_SendChangeTeamRequest(IDMFC *instance, int newteam, bool instance->SendChangeTeamRequest(newteam, spew_onchange); } -void DLLFUNCCALL IDMFC_GetDMFCGameInfo(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_GetDMFCGameInfo(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->GetDMFCGameInfo(data); } @@ -658,7 +658,7 @@ float DLLFUNCCALL IDMFC_ConvertHUDAlphaFloat(IDMFC *instance, float normal) { return instance->ConvertHUDAlpha(normal); } -ubyte DLLFUNCCALL IDMFC_ConvertHUDAlphaByte(IDMFC *instance, ubyte normal) { +uint8_t DLLFUNCCALL IDMFC_ConvertHUDAlphaByte(IDMFC *instance, uint8_t normal) { assert(instance != NULL); return instance->ConvertHUDAlpha(normal); } @@ -689,12 +689,12 @@ void DLLFUNCCALL IDMFC_KillTimer(IDMFC *instance, int handle) { instance->KillTimer(handle); } -void DLLFUNCCALL IDMFC_SwitchShowHudCallsignLevel(IDMFC *instance, ubyte level, bool announce) { +void DLLFUNCCALL IDMFC_SwitchShowHudCallsignLevel(IDMFC *instance, uint8_t level, bool announce) { assert(instance != NULL); instance->SwitchShowHudCallsignLevel(level, announce); } -void DLLFUNCCALL IDMFC_SwitchServerHudCallsignLevel(IDMFC *instance, ubyte level) { +void DLLFUNCCALL IDMFC_SwitchServerHudCallsignLevel(IDMFC *instance, uint8_t level) { assert(instance != NULL); instance->SwitchServerHudCallsignLevel(level); } @@ -739,12 +739,12 @@ int DLLFUNCCALL IDMFC_CFGCreateRecord(IDMFC *instance, char *name, char type, vo return instance->CFGCreateRecord(name, type, data); } -void DLLFUNCCALL IDMFC_DecryptData(IDMFC *instance, ubyte *data, int size) { +void DLLFUNCCALL IDMFC_DecryptData(IDMFC *instance, uint8_t *data, int size) { assert(instance != NULL); instance->DecryptData(data, size); } -void DLLFUNCCALL IDMFC_EncryptData(IDMFC *instance, ubyte *data, int size) { +void DLLFUNCCALL IDMFC_EncryptData(IDMFC *instance, uint8_t *data, int size) { assert(instance != NULL); instance->EncryptData(data, size); } @@ -785,8 +785,8 @@ void DLLFUNCCALL IDMFC_AddWeaponHash(IDMFC *instance, const char *parent, int co } int DLLFUNCCALL IDMFC_SetupPlayerRecord(IDMFC *instance, int sizeof_individual_data, - int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)) { + int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)) { assert(instance != NULL); return instance->SetupPlayerRecord(sizeof_individual_data, pack_callback, unpack_callback); } @@ -811,7 +811,7 @@ void DLLFUNCCALL IDMFC_SendRequestForPlayerRecords(IDMFC *instance) { instance->SendRequestForPlayerRecords(); } -void DLLFUNCCALL IDMFC_ReceiveRequestForPlayerRecords(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_ReceiveRequestForPlayerRecords(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->ReceiveRequestForPlayerRecords(data); } @@ -856,12 +856,12 @@ bool DLLFUNCCALL IDMFC_IsPlayerAlive(IDMFC *instance, int pnum) { return instance->IsPlayerAlive(pnum); } -void DLLFUNCCALL IDMFC_SendControlMessageToPlayer(IDMFC *instance, int pnum, ubyte msg) { +void DLLFUNCCALL IDMFC_SendControlMessageToPlayer(IDMFC *instance, int pnum, uint8_t msg) { assert(instance != NULL); instance->SendControlMessageToPlayer(pnum, msg); } -void DLLFUNCCALL IDMFC_ReceiveControlMessage(IDMFC *instance, ubyte *data) { +void DLLFUNCCALL IDMFC_ReceiveControlMessage(IDMFC *instance, uint8_t *data) { assert(instance != NULL); instance->ReceiveControlMessage(data); } @@ -1392,7 +1392,7 @@ void DLLFUNCCALL IDMFC_Set_OnPlayerConnect(IDMFC *instance, void (*callback)(int instance->Set_OnPlayerConnect(callback); } -void DLLFUNCCALL IDMFC_Set_OnControlMessage(IDMFC *instance, void (*callback)(ubyte msg, int from_pnum)) { +void DLLFUNCCALL IDMFC_Set_OnControlMessage(IDMFC *instance, void (*callback)(uint8_t msg, int from_pnum)) { assert(instance != NULL); instance->Set_OnControlMessage(callback); } @@ -1697,7 +1697,7 @@ void DLLFUNCCALL IDMFC_CallOnPlayerConnect(IDMFC *instance, int player_num) { instance->CallOnPlayerConnect(player_num); } -void DLLFUNCCALL IDMFC_CallOnControlMessage(IDMFC *instance, ubyte msg, int from_pnum) { +void DLLFUNCCALL IDMFC_CallOnControlMessage(IDMFC *instance, uint8_t msg, int from_pnum) { assert(instance != NULL); instance->CallOnControlMessage(msg, from_pnum); } diff --git a/netgames/dmfc/dmfcinternal.h b/netgames/dmfc/dmfcinternal.h index 591d03da..ae38be5d 100644 --- a/netgames/dmfc/dmfcinternal.h +++ b/netgames/dmfc/dmfcinternal.h @@ -34,7 +34,7 @@ * the server bashes it down. * * 75 9/28/99 10:55a Jeff - * changed size of pointer for mastertracker game from ubyte* to int* + * changed size of pointer for mastertracker game from uint8_t* to int* * * 74 8/21/99 12:32a Jeff * Changed the name of the GetRealGametime function to @@ -293,11 +293,11 @@ typedef struct { } tDeathMsg; typedef struct tSPHandler { - void (*func)(ubyte *); // Function handler to handle the packet - void (DMFCBase::*DMFCfunc)(ubyte *); + void (*func)(uint8_t *); // Function handler to handle the packet + void (DMFCBase::*DMFCfunc)(uint8_t *); tSPHandler *next; // Pointer to next handler int type; - ubyte ID; // ID of special packet + uint8_t ID; // ID of special packet } tSPHandler; // Struct for Input Command nodes (commands that begin with $) @@ -310,7 +310,7 @@ typedef struct tInputCommandNode { } tInputCommandNode; typedef struct tPKillerInfo { - ubyte slot; + uint8_t slot; int kills; tPKillerInfo *next; } tPKillerInfo; @@ -340,8 +340,8 @@ public: void ResetAll(void); int GetSizeOfData(void); int GetExtraInfoSize(void); - void PackData(ubyte *buffer); - bool UnpackData(ubyte *buffer, int buffsize); + void PackData(uint8_t *buffer); + bool UnpackData(uint8_t *buffer, int buffsize); tPExtraInfo *GetExtraInfo(void); void HandleKill(int killer_num); void HandleDeath(int victim_num); @@ -361,7 +361,7 @@ private: class MenuItem : public IMenuItem { public: MenuItem(); - MenuItem(const char *title, char type, ubyte flags, void (*fp)(int), ...); // the last parameters are the state items, which + MenuItem(const char *title, char type, uint8_t flags, void (*fp)(int), ...); // the last parameters are the state items, which // is an int (the number of states), followed by // an int (the initial state), followed by a // a list of char * to the names of the items @@ -423,8 +423,8 @@ private: // no submenus are allowed to be added to a MIT_PLIST, as this is automatically handled // no submenus are allowed for MIT_STATEITEM as they are specific ends for a MIT_STATE submenu char m_cType; - ubyte m_iFlags; - ubyte m_Alpha; + uint8_t m_iFlags; + uint8_t m_Alpha; bool m_AlphaDir; int m_iTopIndex; bool m_bMoreToScroll, m_bAtBottom; @@ -511,9 +511,9 @@ protected: // callback for DSCOL_CUSTOM column types for detailed void (*m_DColCallback)(int precord_num, int column_num, char *buffer, int buffer_size); // callback for DSCOL_BMP column types for Player list (bitmaps) - void (*m_PLColCallbackBMP)(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use); + void (*m_PLColCallbackBMP)(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use); // callback for DSCOL_BMP column types for detailed (bitmaps) - void (*m_DColCallbackBMP)(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use); + void (*m_DColCallbackBMP)(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use); // callback for team data void (*m_TeamCallback)(int team, char *buffer, int buffer_size); // name of the multiplayer game @@ -555,7 +555,7 @@ protected: // does this guy have multiple pages? bool m_has_multiple_pages; // alpha of the items - ubyte m_alpha; + uint8_t m_alpha; float alpha_in_time; // validates all the variables @@ -919,7 +919,7 @@ public: // // // There is a control message sent from someone - virtual void OnControlMessage(ubyte msg, int from_pnum); + virtual void OnControlMessage(uint8_t msg, int from_pnum); // DMFCBase::OnAllowObserverChange // @@ -1120,9 +1120,9 @@ public: // to the ID's given to this function. If any match than it calls the handler given to process // the packet. // id = ID of the packet - // func = Function handler to handle the packet. Must be declared like void MyFunction(ubyte *data); - void RegisterPacketReceiver(ubyte id, void (*func)(ubyte *)); - void RegisterPacketReceiver(ubyte id, void (DMFCBase::*func)(ubyte *)); + // func = Function handler to handle the packet. Must be declared like void MyFunction(uint8_t *data); + void RegisterPacketReceiver(uint8_t id, void (*func)(uint8_t *)); + void RegisterPacketReceiver(uint8_t id, void (DMFCBase::*func)(uint8_t *)); // DMFCBase::StartPacket // @@ -1134,7 +1134,7 @@ public: // handler to // call. // count = pointer to your packet index pointer - void StartPacket(ubyte *data, ubyte id, int *count); + void StartPacket(uint8_t *data, uint8_t id, int *count); // DMFCBase::SendPacket // @@ -1143,7 +1143,7 @@ public: // size = size (in bytes) of the packet // destination = either a player number, SP_ALL for all the players or SP_SERVER to send to the server (if you are a // client) - void SendPacket(ubyte *data, int size, int destination); + void SendPacket(uint8_t *data, int size, int destination); // DMFCBase::GetTeamForNewPlayer // @@ -1176,17 +1176,17 @@ public: // DMFCBase::GetTeamAssignmentPacket // // Reciever for the team assignment packet. - void GetTeamAssignmentPacket(ubyte *data); + void GetTeamAssignmentPacket(uint8_t *data); // DMFCBase::GetChangeTeamPacket // // Reciever for the change team packet.(Server Only) - void GetChangeTeamPacket(ubyte *data); + void GetChangeTeamPacket(uint8_t *data); // DMFCBase::GetGameStateRequest // // Receiver for the server from a client asking for the state of the game - void GetGameStateRequest(ubyte *data); + void GetGameStateRequest(uint8_t *data); // DMFCBase::SendChangeTeamRequest // @@ -1197,7 +1197,7 @@ public: // DMFCBase::GetDMFCGameInfo // // Receives information about the DMFC game - void GetDMFCGameInfo(ubyte *data); + void GetDMFCGameInfo(uint8_t *data); // DMFCBase::SendDMFCGameInfo // @@ -1207,7 +1207,7 @@ public: // DMFCBase::GetRemoteKey // // Handles a new remote key from the server - void GetRemoteKey(ubyte *data); + void GetRemoteKey(uint8_t *data); // DMFCBase::SendRemoteKey // @@ -1286,7 +1286,7 @@ public: // // Returns a converted alpha based on what you give, it will be a more transparent if the onscreen menu is up float ConvertHUDAlpha(float normal); - ubyte ConvertHUDAlpha(ubyte normal); + uint8_t ConvertHUDAlpha(uint8_t normal); // DMFCBase::ClipString // @@ -1329,13 +1329,13 @@ public: // // // Sets the level for displaying of Player's Callsigns on the HUD - void SwitchShowHudCallsignLevel(ubyte level, bool announce = true); + void SwitchShowHudCallsignLevel(uint8_t level, bool announce = true); // DMFCBase::SwitchServerHudCallsignLevel // // // Sets the max level of HUD callsign displayage...determined by the server - void SwitchServerHudCallsignLevel(ubyte level); + void SwitchServerHudCallsignLevel(uint8_t level); // DMFCBase::GetCounterMeasureOwner // @@ -1381,12 +1381,12 @@ public: // DMFCBase::DecryptData // // Decrypts a buffer of data - void DecryptData(ubyte *data, int size); + void DecryptData(uint8_t *data, int size); // DMFCBase::EncryptData // // Encrypts (weak) a buffer of data - void EncryptData(ubyte *data, int size); + void EncryptData(uint8_t *data, int size); // DMFCBase::VersionCheck // @@ -1458,8 +1458,8 @@ public: // returns: 1 if size given was <=0 (if so all previous user stats will be removed) // 0 all went ok // -1 out of memory (all user stats memory will be freed) - int SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)); + int SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)); // DMFCBase::GetPlayerRecordData // @@ -1487,7 +1487,7 @@ public: // // // Recieves and processes a request for a player record - void ReceiveRequestForPlayerRecords(ubyte *data); + void ReceiveRequestForPlayerRecords(uint8_t *data); // DMFCBase::IsPlayerBanned // @@ -1534,13 +1534,13 @@ public: // // // Sends a [1 byte] control message to a player - void SendControlMessageToPlayer(int pnum, ubyte msg); + void SendControlMessageToPlayer(int pnum, uint8_t msg); // DMFCBase::ReceiveControlMessage // // // Handles a control message - void ReceiveControlMessage(ubyte *data); + void ReceiveControlMessage(uint8_t *data); // DMFCBase::SendRealGametime // @@ -1550,7 +1550,7 @@ public: // DMFCBase::GetRealGametime // // handles a packet about updating the real game time - void GetRealGametimePacket(ubyte *data); + void GetRealGametimePacket(uint8_t *data); // DMFCBase::FindPInfoStatFirst // @@ -1822,7 +1822,7 @@ public: // If you are going to create submenus you MUST use this function. along with: // void SetState(int state); // bool SetStateItemList(int count, ... ); for MIT_STATE items - MenuItem *CreateMenuItem(const char *title, char type, ubyte flags, void (*fp)(int), ...); + MenuItem *CreateMenuItem(const char *title, char type, uint8_t flags, void (*fp)(int), ...); // DMFCBase::ReadInHostsAllowDeny // @@ -1997,7 +1997,7 @@ public: protected: void SetPlayerInfo(int pnum); void SendVersionToClient(int pnum); - void GetDMFCVersionCheck(ubyte *data); + void GetDMFCVersionCheck(uint8_t *data); bool DMFC_compare_slots(int a, int b); bool DMFC_compare_slots_efficiency(int a, int b); @@ -2090,10 +2090,10 @@ private: bool m_bDisplayOutrageLogo; int *m_bTrackerGame; bool *Dedicated_server; - ubyte m_iServerHUDCallsignLevel; - ubyte m_iMyPreferredHUDCallsignLevel; // what the user selected for callsign level - ubyte m_iMyCurrentHUDCallsignLevel; // might be lower than preferred level if limited by server - ubyte m_iDeathMessageFilter; + uint8_t m_iServerHUDCallsignLevel; + uint8_t m_iMyPreferredHUDCallsignLevel; // what the user selected for callsign level + uint8_t m_iMyCurrentHUDCallsignLevel; // might be lower than preferred level if limited by server + uint8_t m_iDeathMessageFilter; int m_iNumBanPlayers; int m_iUIWindowID; void *m_UIUserData; @@ -2132,7 +2132,7 @@ private: // DMFCBase::ReceiveNetGameInfoSync // // Receives a NetGame info sync packet from the server - void ReceiveNetGameInfoSync(ubyte *data); + void ReceiveNetGameInfoSync(uint8_t *data); // DMFCBase::SendNewTeamName // // Tells the clients about a team's new name @@ -2140,7 +2140,7 @@ private: // DMFCBase::ReceiveNewTeamName // // The server is telling us about a new team name - void ReceiveNewTeamName(ubyte *data); + void ReceiveNewTeamName(uint8_t *data); // DMFCBase::ParseStartupScript // @@ -2223,7 +2223,7 @@ public: void Set_OnSaveStatsToFile(void (*callback)(void)); void Set_OnPlayerReconnect(void (*callback)(int player_num)); void Set_OnPlayerConnect(void (*callback)(int player_num)); - void Set_OnControlMessage(void (*callback)(ubyte msg, int from_pnum)); + void Set_OnControlMessage(void (*callback)(uint8_t msg, int from_pnum)); void Set_OnAllowObserverChange(bool (*callback)(bool turnonobserver)); void Set_OnClientShowUI(void (*callback)(int id, void *user_data)); void Set_OnPrintScores(void (*callback)(int level)); @@ -2287,7 +2287,7 @@ public: void CallOnSaveStatsToFile(void); void CallOnPlayerReconnect(int player_num); void CallOnPlayerConnect(int player_num); - void CallOnControlMessage(ubyte msg, int from_pnum); + void CallOnControlMessage(uint8_t msg, int from_pnum); bool CallOnAllowObserverChange(bool turnonobserver); void CallOnClientShowUI(int id, void *user_data); void CallOnPrintScores(int level); @@ -2357,7 +2357,7 @@ private: void (*UserOnSaveStatsToFile)(void); void (*UserOnPlayerReconnect)(int player_num); void (*UserOnPlayerConnect)(int player_num); - void (*UserOnControlMessage)(ubyte msg, int from_pnum); + void (*UserOnControlMessage)(uint8_t msg, int from_pnum); bool (*UserOnAllowObserverChange)(bool turnonobserver); void (*UserOnClientShowUI)(int id, void *user_data); void (*UserOnPrintScores)(int level); @@ -2850,14 +2850,14 @@ void Remote_Initialize(void); // Processes remote administration for the frame void Remote_ProcessFrame(void); // Gets the key for the given player record -ubyte *Remote_GetKey(int prec); +uint8_t *Remote_GetKey(int prec); // Enables/Disables remote administration void Remote_Enable(bool enable); // sets the administration password for the server // pass in an unencrypted password void Remote_SetPassword(char *password); // Sets a clients key -void Remote_SetMyKey(ubyte key[8]); +void Remote_SetMyKey(uint8_t key[8]); // handles a remote command (client side) void Remote_ClientProcess(const char *command); // Lists the players logged in @@ -2924,8 +2924,8 @@ void PRec_Close(void); // 0 all went ok // -1 out of memory (all user stats memory will be freed) // -2 invalid callbacks -int PRec_SetupUserPRec(int sizeof_user_stats, int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)); +int PRec_SetupUserPRec(int sizeof_user_stats, int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)); // Given a pnum it will return the PRec slot of that player, or -1 if it's not a valid player int PRec_GetPlayerSlot(int pnum); // Given a PRec slot, it returns a pointer to the user stats struct, NULL if error, or PRec_SetupUserPRec @@ -2957,7 +2957,7 @@ void PRec_LevelReset(void); // Sends the Player records info to the given client void PRec_SendPRecToPlayer(int pnum); // Receives the Player records info from the server -void PRec_ReceivePRecFromServer(ubyte *data); +void PRec_ReceivePRecFromServer(uint8_t *data); // Sets the team of a player given the pnum void PRec_SetPlayerTeam(int pnum, int team); // Gets the team of a player given the pnum diff --git a/netgames/dmfc/dmfcmenu.cpp b/netgames/dmfc/dmfcmenu.cpp index e9629407..e9a34e38 100644 --- a/netgames/dmfc/dmfcmenu.cpp +++ b/netgames/dmfc/dmfcmenu.cpp @@ -164,7 +164,7 @@ MenuItem::MenuItem() { strcpy(m_sTitle, " "); } -MenuItem::MenuItem(const char *title, char type, ubyte flags, void (*fp)(int), ...) { +MenuItem::MenuItem(const char *title, char type, uint8_t flags, void (*fp)(int), ...) { m_bMoreToScroll = false; m_bAtBottom = false; m_iTopIndex = 0; @@ -508,7 +508,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) { if(!ratio) useratio = aspratio; else useratio = *ratio; */ - ubyte alpha_to_use = 255; + uint8_t alpha_to_use = 255; #define FLASHRATE 700.0 // alphas per second @@ -519,7 +519,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) { while (units > 0) { if (m_AlphaDir) { // find the amount to adjust - ubyte amount = std::min(255 - a, units); + uint8_t amount = std::min(255 - a, units); units -= amount; a += amount; if (a >= 255) { @@ -528,7 +528,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) { } } else { // find the amount to adjust - ubyte amount = std::min(a, units); + uint8_t amount = std::min(a, units); units -= amount; a -= amount; if (a <= 0) { @@ -538,7 +538,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) { } } - m_Alpha = alpha_to_use = (ubyte)a; + m_Alpha = alpha_to_use = (uint8_t)a; ddgr_color color; int temp, maxx; @@ -663,7 +663,7 @@ void MenuItem::Draw(int x, int y, int height, int bmp, float *not_used) { x += 5; - ubyte al; + uint8_t al; m_bMoreToScroll = (end_index < SubMenuCount) ? true : false; // m_bAtBottom = (m_bMoreToScroll)?((CurrSubMenutype = SPH_FUNC; current->func = func; } -void DMFCBase::RegisterPacketReceiver(ubyte id, void (DMFCBase::*func)(ubyte *)) { +void DMFCBase::RegisterPacketReceiver(uint8_t id, void (DMFCBase::*func)(uint8_t *)) { // go to the last handler tSPHandler *current, *last; @@ -197,7 +197,7 @@ void DMFCBase::RegisterPacketReceiver(ubyte id, void (DMFCBase::*func)(ubyte *)) // handler to // call. // count = pointer to your packet index pointer -void DMFCBase::StartPacket(ubyte *data, ubyte id, int *count) { +void DMFCBase::StartPacket(uint8_t *data, uint8_t id, int *count) { *count = 0; MultiAddByte(id, data, count); // set the first byte (invisible to coder) as the id @@ -210,7 +210,7 @@ void DMFCBase::StartPacket(ubyte *data, ubyte id, int *count) { // size = size (in bytes) of the packet // destination = either a player number, SP_ALL for all the players or SP_SERVER to send to the server (if you are a // client) -void DMFCBase::SendPacket(ubyte *data, int size, int destination) { +void DMFCBase::SendPacket(uint8_t *data, int size, int destination) { ASSERT(size < MAX_GAME_DATA_SIZE - 2); // allow for a header by the d3 if (size >= MAX_GAME_DATA_SIZE - 2) return; @@ -255,7 +255,7 @@ void DMFCBase::SendPacket(ubyte *data, int size, int destination) { // DMFCBase::GetGameStateRequest // // Receiver for the server from a client asking for the state of the game -void DMFCBase::GetGameStateRequest(ubyte *data) { +void DMFCBase::GetGameStateRequest(uint8_t *data) { int pnum; int count = 0; pnum = MultiGetInt(data, &count); @@ -271,7 +271,7 @@ void DMFCBase::SendTeamAssignment(int playernum, int team, bool spew_onrespawn) if (GetLocalRole() != LR_SERVER) return; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; StartPacket(data, SPID_TEAMASSIGNMENT, &count); @@ -286,7 +286,7 @@ void DMFCBase::SendTeamAssignment(int playernum, int team, bool spew_onrespawn) // DMFCBase::GetTeamAssignmentPacket // // Reciever for the team assignment packet. -void DMFCBase::GetTeamAssignmentPacket(ubyte *data) { +void DMFCBase::GetTeamAssignmentPacket(uint8_t *data) { int count = 0; bool spew = MultiGetByte(data, &count) ? true : false; @@ -302,7 +302,7 @@ void DMFCBase::GetTeamAssignmentPacket(ubyte *data) { // DMFCBase::GetChangeTeamPacket // // Reciever for the change team packet.(Server Only) -void DMFCBase::GetChangeTeamPacket(ubyte *data) { +void DMFCBase::GetChangeTeamPacket(uint8_t *data) { if (GetLocalRole() != LR_SERVER) return; // We recieved a request for a player to change teams @@ -338,7 +338,7 @@ void DMFCBase::GetChangeTeamPacket(ubyte *data) { // // Sends a request to the server to change teams (Client Only) void DMFCBase::SendChangeTeamRequest(int newteam, bool spew_onrespawn) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; StartPacket(data, SPID_CHANGETEAM, &count); @@ -353,10 +353,10 @@ void DMFCBase::SendChangeTeamRequest(int newteam, bool spew_onrespawn) { // DMFCBase::GetDMFCGameInfo // // Receives information about the DMFC game -void DMFCBase::GetDMFCGameInfo(ubyte *data) { +void DMFCBase::GetDMFCGameInfo(uint8_t *data) { int count = 0; - ubyte level = MultiGetByte(data, &count); // server's HUD Callsign max level + uint8_t level = MultiGetByte(data, &count); // server's HUD Callsign max level m_bMakeClientsWait = MultiGetByte(data, &count) ? true : false; SwitchServerHudCallsignLevel(level); @@ -387,7 +387,7 @@ void DMFCBase::GetDMFCGameInfo(ubyte *data) { void DMFCBase::SendDMFCGameInfo(int player) { int r_len, b_len, g_len, y_len; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_DMFCGAMEINFO, &count); @@ -424,7 +424,7 @@ void DMFCBase::SendDMFCGameInfo(int player) { // Updates a player about the 'real' game time void DMFCBase::SendRealGametime(int pnum) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_REALGAMETIME, &count); @@ -444,7 +444,7 @@ void DMFCBase::SendRealGametime(int pnum) { // DMFCBase::GetRealGametime // // handles a packet about updating the real game time -void DMFCBase::GetRealGametimePacket(ubyte *data) { +void DMFCBase::GetRealGametimePacket(uint8_t *data) { int count = 0; RealGametime = MultiGetFloat(data, &count); @@ -470,11 +470,11 @@ void DMFCBase::SendRemoteKey(int pnum) { } if (precnum != -1) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_REMOTEKEY, &count); - ubyte *key = Remote_GetKey(precnum); + uint8_t *key = Remote_GetKey(precnum); memcpy(&data[count], key, 8); count += 8; @@ -487,9 +487,9 @@ void DMFCBase::SendRemoteKey(int pnum) { // DMFCBase::GetRemoteKey // // Handles a new remote key from the server -void DMFCBase::GetRemoteKey(ubyte *data) { +void DMFCBase::GetRemoteKey(uint8_t *data) { int count = 0; - ubyte key[8]; + uint8_t key[8]; memcpy(key, &data[count], 8); count += 8; Remote_SetMyKey(key); @@ -502,7 +502,7 @@ void DMFCBase::RequestGameState(void) { if (GetLocalRole() == LR_SERVER) return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_REQGAMESTATE, &count); MultiAddInt(GetPlayerNum(), data, &count); @@ -514,7 +514,7 @@ void DMFCBase::SendVersionToClient(int pnum) { if (GetLocalRole() != LR_SERVER) return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_VERSIONID, &count); @@ -524,7 +524,7 @@ void DMFCBase::SendVersionToClient(int pnum) { SendPacket(data, count, pnum); } -void DMFCBase::GetDMFCVersionCheck(ubyte *data) { +void DMFCBase::GetDMFCVersionCheck(uint8_t *data) { int major, minor, count = 0; major = MultiGetInt(data, &count); @@ -546,7 +546,7 @@ void DMFCBase::SendRequestForPlayerRecords(void) { if (GetLocalRole() == LR_SERVER) return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_PRECORDREQ, &count); MultiAddByte(GetPlayerNum(), data, &count); @@ -558,7 +558,7 @@ void DMFCBase::SendRequestForPlayerRecords(void) { // // // Recieves and processes a request for a player record -void DMFCBase::ReceiveRequestForPlayerRecords(ubyte *data) { +void DMFCBase::ReceiveRequestForPlayerRecords(uint8_t *data) { if (GetLocalRole() != LR_SERVER) return; int count = 0; @@ -573,9 +573,9 @@ void DMFCBase::ReceiveRequestForPlayerRecords(ubyte *data) { // // // Sends a [1 byte] control message to a player -void DMFCBase::SendControlMessageToPlayer(int pnum, ubyte msg) { +void DMFCBase::SendControlMessageToPlayer(int pnum, uint8_t msg) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_CONTROLMSG, &count); MultiAddByte(msg, data, &count); @@ -593,15 +593,15 @@ void DMFCBase::SendControlMessageToPlayer(int pnum, ubyte msg) { // // // Handles a control message -void DMFCBase::ReceiveControlMessage(ubyte *data) { +void DMFCBase::ReceiveControlMessage(uint8_t *data) { int count = 0; - ubyte msg = MultiGetByte(data, &count); - ubyte src = MultiGetByte(data, &count); - ubyte dst = MultiGetByte(data, &count); + uint8_t msg = MultiGetByte(data, &count); + uint8_t src = MultiGetByte(data, &count); + uint8_t dst = MultiGetByte(data, &count); if ((GetLocalRole() == LR_SERVER) && (dst != SP_SERVER || dst != GetPlayerNum())) { // forward this packet to the correct player - ubyte fdata[MAX_GAME_DATA_SIZE]; + uint8_t fdata[MAX_GAME_DATA_SIZE]; count = 0; StartPacket(fdata, SPID_CONTROLMSG, &count); @@ -622,7 +622,7 @@ void DMFCBase::SendNetGameInfoSync(int to_who) { if (GetLocalRole() != LR_SERVER) return; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; StartPacket(data, SPID_NETGAMESYNC, &count); @@ -641,7 +641,7 @@ void DMFCBase::SendNetGameInfoSync(int to_who) { // DMFCBase::ReceiveNetGameInfoSync // // Receives a NetGame info sync packet from the server -void DMFCBase::ReceiveNetGameInfoSync(ubyte *data) { +void DMFCBase::ReceiveNetGameInfoSync(uint8_t *data) { int count = 0; Netgame->packets_per_second = MultiGetByte(data, &count); @@ -668,7 +668,7 @@ void DMFCBase::SendNewTeamName(int team) { return; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; StartPacket(data, SPID_NEWTEAMNAME, &count); MultiAddByte(team, data, &count); @@ -680,7 +680,7 @@ void DMFCBase::SendNewTeamName(int team) { // DMFCBase::ReceiveNewTeamName // // The server is telling us about a new team name -void DMFCBase::ReceiveNewTeamName(ubyte *data) { +void DMFCBase::ReceiveNewTeamName(uint8_t *data) { int count = 0; int team = MultiGetByte(data, &count); diff --git a/netgames/dmfc/dmfcpinfo.cpp b/netgames/dmfc/dmfcpinfo.cpp index 01783dad..82ad7089 100644 --- a/netgames/dmfc/dmfcpinfo.cpp +++ b/netgames/dmfc/dmfcpinfo.cpp @@ -311,7 +311,7 @@ int PInfo::GetSizeOfData(void) { return size; } -void PInfo::PackData(ubyte *buffer) { +void PInfo::PackData(uint8_t *buffer) { if (!buffer) return; tPKillerInfo *c; @@ -337,7 +337,7 @@ void PInfo::PackData(ubyte *buffer) { } } -bool PInfo::UnpackData(ubyte *buffer, int buffsize) { +bool PInfo::UnpackData(uint8_t *buffer, int buffsize) { if (!buffer) return false; int count = 0; diff --git a/netgames/dmfc/dmfcprecord.cpp b/netgames/dmfc/dmfcprecord.cpp index 475f650f..5c8c8f8e 100644 --- a/netgames/dmfc/dmfcprecord.cpp +++ b/netgames/dmfc/dmfcprecord.cpp @@ -92,8 +92,8 @@ player_record Player_records[MAX_PLAYER_RECORDS]; int Pnum_to_PRec[DLLMAX_PLAYERS]; // callback pointers for packet packing and unpacking -int (*Player_record_pack_cb)(void *user_info, ubyte *data); -int (*Player_record_unpack_cb)(void *user_info, ubyte *data); +int (*Player_record_pack_cb)(void *user_info, uint8_t *data); +int (*Player_record_unpack_cb)(void *user_info, uint8_t *data); // Initializes the Player records void PRec_Init(void) { @@ -147,8 +147,8 @@ void PRec_Close(void) { // 0 all went ok // -1 out of memory (all user stats memory will be freed) // -2 invalid callbacks -int PRec_SetupUserPRec(int sizeof_user_stats, int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)) { +int PRec_SetupUserPRec(int sizeof_user_stats, int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)) { ASSERT(pack_callback != NULL); ASSERT(unpack_callback != NULL); if (!pack_callback || !unpack_callback) @@ -455,7 +455,7 @@ void PRec_SetPlayerTeam(int pnum, int team) { Player_records[slot].team = team; } -void MultiPackNetworkAddress(network_address *addr, ubyte *data, int *count) { +void MultiPackNetworkAddress(network_address *addr, uint8_t *data, int *count) { memcpy(&data[*count], addr->address, 6); (*count) += 6; MultiAddUshort(addr->port, data, count); @@ -464,7 +464,7 @@ void MultiPackNetworkAddress(network_address *addr, ubyte *data, int *count) { MultiAddByte(addr->connection_type, data, count); } -void MultiUnpackNetworkAddress(network_address *addr, ubyte *data, int *count) { +void MultiUnpackNetworkAddress(network_address *addr, uint8_t *data, int *count) { memcpy(addr->address, &data[*count], 6); (*count) += 6; addr->port = MultiGetUshort(data, count); @@ -473,7 +473,7 @@ void MultiUnpackNetworkAddress(network_address *addr, ubyte *data, int *count) { addr->connection_type = (network_protocol)MultiGetByte(data, count); } -void MultiPackDStats(t_dstat *stat, ubyte *data, int *count) { +void MultiPackDStats(t_dstat *stat, uint8_t *data, int *count) { MultiAddInt(stat->kills[0], data, count); MultiAddInt(stat->kills[1], data, count); MultiAddInt(stat->deaths[0], data, count); @@ -482,7 +482,7 @@ void MultiPackDStats(t_dstat *stat, ubyte *data, int *count) { MultiAddInt(stat->suicides[1], data, count); } -void MultiUnpackDStats(t_dstat *stat, ubyte *data, int *count) { +void MultiUnpackDStats(t_dstat *stat, uint8_t *data, int *count) { stat->kills[0] = MultiGetInt(data, count); stat->kills[1] = MultiGetInt(data, count); stat->deaths[0] = MultiGetInt(data, count); @@ -496,7 +496,7 @@ void PRec_SendPRecToPlayer(int pnum) { if (basethis->GetLocalRole() != LR_SERVER) return; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int callsignlen, totalsize, totalcount; totalsize = totalcount = 0; int pinfo_size, count; @@ -510,7 +510,7 @@ void PRec_SendPRecToPlayer(int pnum) { else pinfo_size = 0; - ubyte tracker_len = 0; + uint8_t tracker_len = 0; if (Player_records[i].tracker_id) { tracker_len = strlen(Player_records[i].tracker_id); @@ -573,7 +573,7 @@ void PRec_SendPRecToPlayer(int pnum) { } // Receives the Player records info from the server -void PRec_ReceivePRecFromServer(ubyte *data) { +void PRec_ReceivePRecFromServer(uint8_t *data) { int count = 0; int callsignlen; int slot = MultiGetByte(data, &count); // unpack byte (record num) @@ -596,7 +596,7 @@ void PRec_ReceivePRecFromServer(ubyte *data) { if (MultiGetByte(data, &count)) { ASSERT(basethis->IsMasterTrackerGame() != 0); // there is tracker_id data coming in - ubyte len = MultiGetByte(data, &count); + uint8_t len = MultiGetByte(data, &count); pr->tracker_id = (char *)malloc(len + 1); if (pr->tracker_id) { diff --git a/netgames/dmfc/dmfcremote.cpp b/netgames/dmfc/dmfcremote.cpp index 9adafa9d..fa4407fe 100644 --- a/netgames/dmfc/dmfcremote.cpp +++ b/netgames/dmfc/dmfcremote.cpp @@ -64,7 +64,7 @@ const char *DMFCGetString(int d); typedef struct { bool authorized; // whether the player is authorized - ubyte curr_key[8]; // current encryption key + uint8_t curr_key[8]; // current encryption key } tRemotePlayerData; static tRemotePlayerData Authorized_players[MAX_PLAYER_RECORDS]; @@ -72,26 +72,26 @@ static char Remote_Admin_pass[64]; bool Use_remote_admin = false; static bool IAmAnAdmin = false; -static void Remote_encrypt(ubyte key[8], int size_buffer, ubyte *buffer, int *new_size, ubyte **new_buffer); -static void Remote_decrypt(ubyte key[8], int size_buffer, ubyte *buffer, int *new_size, ubyte **new_buffer); +static void Remote_encrypt(uint8_t key[8], int size_buffer, uint8_t *buffer, int *new_size, uint8_t **new_buffer); +static void Remote_decrypt(uint8_t key[8], int size_buffer, uint8_t *buffer, int *new_size, uint8_t **new_buffer); // Sends a string to the server (function encrypts it before sending) void Remote_SendStringToServer(const char *string); // Recieves a string from the server (function decrypts it) -void Remote_RecieveStringFromServer(ubyte *data, char *buffer, int size); +void Remote_RecieveStringFromServer(uint8_t *data, char *buffer, int size); // Sends a string to a client (function encrypts it before sending) void Remote_SendStringToClient(int client, const char *string); // Recieves a string from a client (function decrypts it) -int Remote_RecieveStringFromClient(ubyte *data, char *buffer, int size); +int Remote_RecieveStringFromClient(uint8_t *data, char *buffer, int size); // Handles remote admin packets from a client -void Remote_HandleClientPacket(ubyte *data); +void Remote_HandleClientPacket(uint8_t *data); // Handles remote admin packets from a client -void Remote_HandleServerPacket(ubyte *data); +void Remote_HandleServerPacket(uint8_t *data); // Sends a message from the server to a client void Remote_SendMessage(int client, const char *message); // Receives a message from the server -void Remote_GetMessage(ubyte *data); +void Remote_GetMessage(uint8_t *data); // Logs a player out from being an administrator void Remote_Logout(int precnum); @@ -173,7 +173,7 @@ void Remote_ProcessFrame(void) { } // Gets the key for the given player record -ubyte *Remote_GetKey(int prec) { +uint8_t *Remote_GetKey(int prec) { ASSERT(prec >= 0 && prec < MAX_PLAYER_RECORDS); return Authorized_players[prec].curr_key; } @@ -302,7 +302,7 @@ int translate_precptr_to_index(player_record *pr) { } // Sets a clients key -void Remote_SetMyKey(ubyte key[8]) { +void Remote_SetMyKey(uint8_t key[8]) { player_record *pr; pr = PRec_GetPRecordByPnum(basethis->GetPlayerNum()); int prec = translate_precptr_to_index(pr); @@ -432,7 +432,7 @@ void Remote_SendMessage(int client, const char *message) { } int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; basethis->StartPacket(data, SPID_SERVERREMOTEMSG, &count); MultiAddString(message, data, &count); @@ -442,7 +442,7 @@ void Remote_SendMessage(int client, const char *message) { } // Receives a message from the server -void Remote_GetMessage(ubyte *data) { +void Remote_GetMessage(uint8_t *data) { int count = 0; char buffer[512]; @@ -460,7 +460,7 @@ void Remote_SendStringToServer(const char *string) { int slen; int new_strlen; - ubyte *packet_data; + uint8_t *packet_data; slen = strlen(string); player_record *pr; @@ -472,7 +472,7 @@ void Remote_SendStringToServer(const char *string) { return; } - Remote_encrypt(Authorized_players[prec].curr_key, slen, (ubyte *)string, &new_strlen, &packet_data); + Remote_encrypt(Authorized_players[prec].curr_key, slen, (uint8_t *)string, &new_strlen, &packet_data); if (new_strlen == 0) { mprintf((0, "COULDN'T ENCRYPT\n")); @@ -482,7 +482,7 @@ void Remote_SendStringToServer(const char *string) { // now we can send off the packet int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; basethis->StartPacket(data, SPID_REMOTETOSERVER, &count); MultiAddByte(prec, data, &count); @@ -495,7 +495,7 @@ void Remote_SendStringToServer(const char *string) { } // Handles remote admin packets from a client -void Remote_HandleServerPacket(ubyte *data) { +void Remote_HandleServerPacket(uint8_t *data) { char buffer[512]; Remote_RecieveStringFromServer(data, buffer, 512); @@ -509,7 +509,7 @@ void Remote_HandleServerPacket(ubyte *data) { } // Recieves a string from the server (function decrypts it) -void Remote_RecieveStringFromServer(ubyte *data, char *buffer, int size) { +void Remote_RecieveStringFromServer(uint8_t *data, char *buffer, int size) { int count = 0; int len = MultiGetInt(data, &count); @@ -526,13 +526,13 @@ void Remote_RecieveStringFromServer(ubyte *data, char *buffer, int size) { if (len <= 0) return; - ubyte *packet; - packet = (ubyte *)malloc(len); + uint8_t *packet; + packet = (uint8_t *)malloc(len); memcpy(packet, &data[count], len); count += len; int new_size; - ubyte *new_buffer; + uint8_t *new_buffer; Remote_decrypt(Authorized_players[prec].curr_key, len, packet, &new_size, &new_buffer); if (new_buffer) { strncpy(buffer, (char *)new_buffer, size - 1); @@ -554,7 +554,7 @@ void Remote_SendStringToClient(int client, const char *string) { int slen; int new_strlen; - ubyte *packet_data; + uint8_t *packet_data; slen = strlen(string); player_record *pr; @@ -572,7 +572,7 @@ void Remote_SendStringToClient(int client, const char *string) { return; } - Remote_encrypt(Authorized_players[prec].curr_key, slen, (ubyte *)string, &new_strlen, &packet_data); + Remote_encrypt(Authorized_players[prec].curr_key, slen, (uint8_t *)string, &new_strlen, &packet_data); if (new_strlen == 0) { mprintf((0, "COULDN'T ENCRYPT\n")); @@ -582,7 +582,7 @@ void Remote_SendStringToClient(int client, const char *string) { // now we can send off the packet int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; basethis->StartPacket(data, SPID_REMOTETOCLIENT, &count); MultiAddInt(new_strlen, data, &count); @@ -594,7 +594,7 @@ void Remote_SendStringToClient(int client, const char *string) { } // Handles remote admin packets from a client -void Remote_HandleClientPacket(ubyte *data) { +void Remote_HandleClientPacket(uint8_t *data) { char buffer[512]; int prec = Remote_RecieveStringFromClient(data, buffer, 512); if (prec == -1) @@ -604,7 +604,7 @@ void Remote_HandleClientPacket(ubyte *data) { } // Recieves a string from a client (function decrypts it) -int Remote_RecieveStringFromClient(ubyte *data, char *buffer, int size) { +int Remote_RecieveStringFromClient(uint8_t *data, char *buffer, int size) { int count = 0; int prec = MultiGetByte(data, &count); int len = MultiGetInt(data, &count); @@ -616,13 +616,13 @@ int Remote_RecieveStringFromClient(ubyte *data, char *buffer, int size) { if (len <= 0) return -1; - ubyte *packet; - packet = (ubyte *)malloc(len); + uint8_t *packet; + packet = (uint8_t *)malloc(len); memcpy(packet, &data[count], len); count += len; int new_size; - ubyte *new_buffer; + uint8_t *new_buffer; Remote_decrypt(Authorized_players[prec].curr_key, len, packet, &new_size, &new_buffer); if (new_buffer) { size = (len < size) ? len + 1 : size; @@ -637,7 +637,7 @@ int Remote_RecieveStringFromClient(ubyte *data, char *buffer, int size) { return prec; } -void Remote_pad_buffer(int orig_size, const ubyte *orig_buffer, int *new_size, ubyte **new_buffer) { +void Remote_pad_buffer(int orig_size, const uint8_t *orig_buffer, int *new_size, uint8_t **new_buffer) { // bump buffer up to size of mod 8 *new_size = orig_size; if (orig_size < 8 || (orig_size % 8) != 0) { @@ -646,7 +646,7 @@ void Remote_pad_buffer(int orig_size, const ubyte *orig_buffer, int *new_size, u *new_size = (chunks + 1) * 8; } - *new_buffer = (ubyte *)malloc(*new_size); + *new_buffer = (uint8_t *)malloc(*new_size); if (!(*new_buffer)) { *new_size = 0; return; @@ -655,22 +655,22 @@ void Remote_pad_buffer(int orig_size, const ubyte *orig_buffer, int *new_size, u memcpy(*new_buffer, orig_buffer, orig_size); } -static void Remote_encrypt(ubyte key[8], int size_buffer, ubyte *buffer, int *new_size, ubyte **new_buffer) { +static void Remote_encrypt(uint8_t key[8], int size_buffer, uint8_t *buffer, int *new_size, uint8_t **new_buffer) { *new_buffer = NULL; - ubyte *buff; + uint8_t *buff; Remote_pad_buffer(size_buffer, buffer, new_size, &buff); if (*new_size == 0) return; IceKey ice(0); - ice.set((ubyte *)key); + ice.set((uint8_t *)key); int i, num_chunks = 0; int chunk_offset = 0; - ubyte *cipher; - cipher = (ubyte *)malloc(*new_size); + uint8_t *cipher; + cipher = (uint8_t *)malloc(*new_size); if (!cipher) return; @@ -684,22 +684,22 @@ static void Remote_encrypt(ubyte key[8], int size_buffer, ubyte *buffer, int *ne *new_buffer = cipher; } -static void Remote_decrypt(ubyte key[8], int size_buffer, ubyte *buffer, int *new_size, ubyte **new_buffer) { +static void Remote_decrypt(uint8_t key[8], int size_buffer, uint8_t *buffer, int *new_size, uint8_t **new_buffer) { *new_buffer = NULL; - ubyte *buff; + uint8_t *buff; Remote_pad_buffer(size_buffer, buffer, new_size, &buff); if (*new_size == 0) return; IceKey ice(0); - ice.set((ubyte *)key); + ice.set((uint8_t *)key); int i, num_chunks = 0; int chunk_offset = 0; - ubyte *cipher; - cipher = (ubyte *)malloc(*new_size); + uint8_t *cipher; + cipher = (uint8_t *)malloc(*new_size); if (!cipher) return; diff --git a/netgames/dmfc/dmfcstats.cpp b/netgames/dmfc/dmfcstats.cpp index c57b8fae..d9e2c7cf 100644 --- a/netgames/dmfc/dmfcstats.cpp +++ b/netgames/dmfc/dmfcstats.cpp @@ -914,7 +914,7 @@ redisplay_list: DLLRenderHUDText(GR_WHITE, m_alpha, 0, x_to_use, curr_y, buffer); curr_y += (m_font_height + ROW_PIXEL_GAP); - ubyte streak_type = 0; + uint8_t streak_type = 0; if (!is_dedicated_server) { // none of this should be displayed for a dedicated server diff --git a/netgames/dmfc/dmfcvirtual.cpp b/netgames/dmfc/dmfcvirtual.cpp index 95dcfb9e..ece7010c 100644 --- a/netgames/dmfc/dmfcvirtual.cpp +++ b/netgames/dmfc/dmfcvirtual.cpp @@ -283,7 +283,7 @@ void DMFCBase::Set_OnPlayerReconnect(void (*callback)(int player_num)) { UserOnP void DMFCBase::Set_OnPlayerConnect(void (*callback)(int player_num)) { UserOnPlayerConnect = callback; } -void DMFCBase::Set_OnControlMessage(void (*callback)(ubyte msg, int from_pnum)) { UserOnControlMessage = callback; } +void DMFCBase::Set_OnControlMessage(void (*callback)(uint8_t msg, int from_pnum)) { UserOnControlMessage = callback; } void DMFCBase::Set_OnAllowObserverChange(bool (*callback)(bool turnonobserver)) { UserOnAllowObserverChange = callback; @@ -666,7 +666,7 @@ void DMFCBase::CallOnPlayerConnect(int player_num) { OnPlayerConnect(player_num); } -void DMFCBase::CallOnControlMessage(ubyte msg, int from_pnum) { +void DMFCBase::CallOnControlMessage(uint8_t msg, int from_pnum) { if (UserOnControlMessage) (*UserOnControlMessage)(msg, from_pnum); else diff --git a/netgames/dmfc/encryption.cpp b/netgames/dmfc/encryption.cpp index 0370807d..f28b1a91 100644 --- a/netgames/dmfc/encryption.cpp +++ b/netgames/dmfc/encryption.cpp @@ -211,7 +211,7 @@ static uint32_t ice_f(uint32_t p, const IceSubkey *sk) { // // Encrypt a block of 8 bytes of data with the given ICE key. // -void IceKey::encrypt(const ubyte *ptext, ubyte *ctext) const { +void IceKey::encrypt(const uint8_t *ptext, uint8_t *ctext) const { int i; uint32_t l, r; @@ -227,8 +227,8 @@ void IceKey::encrypt(const ubyte *ptext, ubyte *ctext) const { } for (i = 0; i < 4; i++) { - ctext[3 - i] = (ubyte)r & 0xff; - ctext[7 - i] = (ubyte)l & 0xff; + ctext[3 - i] = (uint8_t)r & 0xff; + ctext[7 - i] = (uint8_t)l & 0xff; r >>= 8; l >>= 8; @@ -238,7 +238,7 @@ void IceKey::encrypt(const ubyte *ptext, ubyte *ctext) const { // // Decrypt a block of 8 bytes of data with the given ICE key. // -void IceKey::decrypt(const ubyte *ctext, ubyte *ptext) const { +void IceKey::decrypt(const uint8_t *ctext, uint8_t *ptext) const { int i; uint32_t l, r; @@ -253,8 +253,8 @@ void IceKey::decrypt(const ubyte *ctext, ubyte *ptext) const { } for (i = 0; i < 4; i++) { - ptext[3 - i] = (ubyte)r & 0xff; - ptext[7 - i] = (ubyte)l & 0xff; + ptext[3 - i] = (uint8_t)r & 0xff; + ptext[7 - i] = (uint8_t)l & 0xff; r >>= 8; l >>= 8; @@ -293,7 +293,7 @@ void IceKey::scheduleBuild(uint16_t *kb, int n, const int *keyrot) { // // Set the key schedule of an ICE key. // -void IceKey::set(const ubyte *key) { +void IceKey::set(const uint8_t *key) { int i; if (_rounds == 8) { diff --git a/netgames/dmfc/encryption.h b/netgames/dmfc/encryption.h index 7ec00062..a82fdd26 100644 --- a/netgames/dmfc/encryption.h +++ b/netgames/dmfc/encryption.h @@ -47,10 +47,10 @@ public: IceKey(int n); ~IceKey(); - void set(const ubyte *key); + void set(const uint8_t *key); - void encrypt(const ubyte *plaintext, ubyte *ciphertext) const; - void decrypt(const ubyte *ciphertext, ubyte *plaintext) const; + void encrypt(const uint8_t *plaintext, uint8_t *ciphertext) const; + void decrypt(const uint8_t *ciphertext, uint8_t *plaintext) const; int keySize(void) const; int blockSize(void) const; diff --git a/netgames/dmfc/idmfc.cpp b/netgames/dmfc/idmfc.cpp index d709f5c0..cbfb3c97 100644 --- a/netgames/dmfc/idmfc.cpp +++ b/netgames/dmfc/idmfc.cpp @@ -102,7 +102,7 @@ IMenuItem DLLFUNCCALLPTR CreateMenuItem(void) { return pfsResult; } -IMenuItem DLLFUNCCALLPTR CreateMenuItemWArgs(const char *title, char type, ubyte flags, void (*fp)(int), +IMenuItem DLLFUNCCALLPTR CreateMenuItemWArgs(const char *title, char type, uint8_t flags, void (*fp)(int), tCustomMenu *custom_menu) { MenuItem *p; diff --git a/netgames/entropy/Entropy.h b/netgames/entropy/Entropy.h index 8eca0d13..7e9723be 100644 --- a/netgames/entropy/Entropy.h +++ b/netgames/entropy/Entropy.h @@ -48,7 +48,7 @@ void OnClientPlayerDisconnect(int pnum); void OnServerPlayerChangeSegment(int player_num, int newseg, int oldseg); void OnClientPlayerChangeSegment(int player_num, int newseg, int oldseg); void OnServerCollide(object *me_obj, object *it_obj); -void OnControlMessage(ubyte msg, int from_pnum); +void OnControlMessage(uint8_t msg, int from_pnum); void OnClientShowUI(int id, void *user_data); /* @@ -66,15 +66,15 @@ Prototypes needed for the Game->DLL/D3M Interface // These next two function prototypes MUST appear in the extern "C" block if called // from a CPP file. extern "C" { -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); } /* @@ -107,7 +107,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -150,7 +150,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/entropy/EntropyAux.h b/netgames/entropy/EntropyAux.h index c1bd205b..02b0869d 100644 --- a/netgames/entropy/EntropyAux.h +++ b/netgames/entropy/EntropyAux.h @@ -51,14 +51,14 @@ Some common function prototypes ===================================================================== */ void SendRoomInfo(int pnum); -void ReceiveRoomInfo(ubyte *data); +void ReceiveRoomInfo(uint8_t *data); void SendClientPickupVirus(int player_num); -void ReceivePickupVirus(ubyte *data); +void ReceivePickupVirus(uint8_t *data); void SendGameStartPacket(int pnum); -void GetGameStartPacket(ubyte *data); +void GetGameStartPacket(uint8_t *data); void SendTakeOverPacket(int newteam, int oldteam, int room, int victor); -void ReceiveTakeOverPacket(ubyte *data); -void DoVirusCreate(ubyte *data); +void ReceiveTakeOverPacket(uint8_t *data); +void DoVirusCreate(uint8_t *data); void SendVirusCreate(object *obj); bool IsPlayerInEnemy(int pnum); void RemoveVirusFromPlayer(int player_num, bool remove_all); @@ -70,7 +70,7 @@ bool PaintRoomWithTexture(int texture, int roomnum); // Take over functions void TakeOverRoom(int newteam, int oldteam, int room, int victor); void SendTakeOverPacket(int newteam, int oldteam, int room, int victor); -void ReceiveTakeOverPacket(ubyte *data); +void ReceiveTakeOverPacket(uint8_t *data); /* ===================================================================== diff --git a/netgames/entropy/EntropyBase.cpp b/netgames/entropy/EntropyBase.cpp index 4bf5fc4c..376ba661 100644 --- a/netgames/entropy/EntropyBase.cpp +++ b/netgames/entropy/EntropyBase.cpp @@ -142,16 +142,16 @@ typedef struct { typedef struct { int Score[2]; } tPlayerStat; // Overall scores (throughout the game) -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -248,7 +248,7 @@ void TeamScoreCallback(int team, char *buffer, int buffer_size) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -334,8 +334,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) snd_damage = DLLFindSoundName("HitEnergy"); snd_virus_pickup = DLLFindSoundName("Powerup pickup"); - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); virus_id = DLLFindObjectIDName("EntropyVirus"); @@ -1374,7 +1374,7 @@ do_disconnected_folk: quick_exit:; } -void OnControlMessage(ubyte msg, int from_pnum) { +void OnControlMessage(uint8_t msg, int from_pnum) { switch (msg) { case VIRUS_NOTENOUGHKILLS: DLLAddHUDMessage(TXT_CANTCARRY); @@ -1648,7 +1648,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 3) / 2); int x = 520; int team; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); team = DMFCBase->GetMyTeam(); DLLRenderHUDText(DMFCBase->GetTeamColor(team), alpha, 0, x, 0, TXT_TEAMINFO, DMFCBase->GetTeamString(team)); diff --git a/netgames/entropy/EntropyPackets.cpp b/netgames/entropy/EntropyPackets.cpp index f880db7a..9b4f2f11 100644 --- a/netgames/entropy/EntropyPackets.cpp +++ b/netgames/entropy/EntropyPackets.cpp @@ -55,7 +55,7 @@ extern object *dObjects; void SendTakeOverPacket(int newteam, int oldteam, int room, int victor) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_TAKEOVER, &count); MultiAddByte(newteam, data, &count); @@ -66,8 +66,8 @@ void SendTakeOverPacket(int newteam, int oldteam, int room, int victor) { DMFCBase->SendPacket(data, count, SP_ALL); } -void ReceiveTakeOverPacket(ubyte *data) { - ubyte newteam, oldteam; +void ReceiveTakeOverPacket(uint8_t *data) { + uint8_t newteam, oldteam; int room; int count = 0; int victor; @@ -80,7 +80,7 @@ void ReceiveTakeOverPacket(ubyte *data) { } // Handles when we get a new player packet -void GetGameStartPacket(ubyte *data) { +void GetGameStartPacket(uint8_t *data) { int i, count = 0; for (i = 0; i < DLLMAX_PLAYERS; i++) { @@ -106,7 +106,7 @@ void SendGameStartPacket(int pnum) { int count = 0; int i; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_NEWPLAYER, &count); for (i = 0; i < DLLMAX_PLAYERS; i++) { @@ -131,7 +131,7 @@ void SendGameStartPacket(int pnum) { void SendClientPickupVirus(int player_num) { int start, count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_PICKUPVIRUS, &count); start = count; @@ -140,7 +140,7 @@ void SendClientPickupVirus(int player_num) { DMFCBase->SendPacket(data, count, SP_ALL); } -void ReceivePickupVirus(ubyte *data) { +void ReceivePickupVirus(uint8_t *data) { int player_num, count = 0; player_num = MultiGetByte(data, &count); @@ -191,7 +191,7 @@ void SendRoomInfo(int pnum) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_ROOMINFO, &count); for (i = 0; i < RoomCount; i++) { @@ -207,7 +207,7 @@ void SendRoomInfo(int pnum) { free(room_info); } -void ReceiveRoomInfo(ubyte *data) { +void ReceiveRoomInfo(uint8_t *data) { int i, count = 0; int flag; char *room_info; @@ -268,7 +268,7 @@ void ReceiveRoomInfo(ubyte *data) { void SendVirusCreate(object *obj) { int start, count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_VIRUSCREATE, &count); start = count; @@ -278,7 +278,7 @@ void SendVirusCreate(object *obj) { DMFCBase->SendPacket(data, count, SP_ALL); } -void DoVirusCreate(ubyte *data) { +void DoVirusCreate(uint8_t *data) { int s_objnum, l_objnum, count = 0; s_objnum = MultiGetInt(data, &count); diff --git a/netgames/hoard/Hoard.h b/netgames/hoard/Hoard.h index 4256fd38..40fa9160 100644 --- a/netgames/hoard/Hoard.h +++ b/netgames/hoard/Hoard.h @@ -59,15 +59,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -93,7 +93,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -136,7 +136,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/hoard/hoard.cpp b/netgames/hoard/hoard.cpp index 3492b10b..db60f519 100644 --- a/netgames/hoard/hoard.cpp +++ b/netgames/hoard/hoard.cpp @@ -89,9 +89,9 @@ typedef struct { int Score[2]; int HighestScore[2]; } tPlayerStat; -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); @@ -100,7 +100,7 @@ int pack_pstat(tPlayerStat *user_info, ubyte *data) { return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -118,7 +118,7 @@ static int HoardOrbIcon = BAD_BITMAP_HANDLE; static bool DisplayBlink = true; static int WhoJustScored = -1; static int WhoJustScoredTimer = -1; -static ubyte HUD_color_model = HCM_PLAYERCOLOR; +static uint8_t HUD_color_model = HCM_PLAYERCOLOR; static int Highlight_bmp = -1; static bool display_my_welcome = false; @@ -129,10 +129,10 @@ static void DisplayHUDScores(struct tHUDItem *hitem); static void SortPlayerScores(int *sortedindex, int size); static void DisplayWelcomeMessage(int player_num); static void DoBallsEffect(int i, int count); -static void ReceiveHoardInv(ubyte *data); +static void ReceiveHoardInv(uint8_t *data); static void SendHoardInv(int playernum); static void SaveStatsToFile(char *filename); -static void ReceiveGameConfig(ubyte *data); +static void ReceiveGameConfig(uint8_t *data); static void OnClientPlayerEntersGame(int player_num); static bool Config_displayed = false; @@ -175,7 +175,7 @@ void DetermineScore(int precord_num, int column_num, char *buffer, int buffer_si } } -void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use) { +void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use) { player_record *pr = DMFCBase->GetPlayerRecord(precord_num); float ratio = DEFAULT_HUD_WIDTH / ((float)DMFCBase->GetGameWindowW()); @@ -265,7 +265,7 @@ void DMFCInputCommand_MinCount(const char *input_string) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -351,8 +351,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) return; } - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); DMFCBase->RegisterPacketReceiver(SPID_INVINFO, ReceiveHoardInv); DMFCBase->RegisterPacketReceiver(SPID_GAMECONFIG, ReceiveGameConfig); @@ -1223,7 +1223,7 @@ void OnDisconnectSaveStatsToFile(void) { } // handles a hoard inventory packet -void ReceiveHoardInv(ubyte *data) { +void ReceiveHoardInv(uint8_t *data) { int x, i, count = 0; int size; @@ -1244,7 +1244,7 @@ void ReceiveHoardInv(ubyte *data) { // sends a hoard inventory packet to a player void SendHoardInv(int playernum) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int i; int count = 0; @@ -1274,7 +1274,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int x = 520; int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); int rank = 1; ddgr_color color; @@ -1487,7 +1487,7 @@ void OnTimerKill(void) { // game config send/receive void SendGameConfig(int towho) { - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; DMFCBase->StartPacket(data, SPID_GAMECONFIG, &count); @@ -1497,7 +1497,7 @@ void SendGameConfig(int towho) { DMFCBase->SendPacket(data, count, towho); } -void ReceiveGameConfig(ubyte *data) { +void ReceiveGameConfig(uint8_t *data) { int count = 0; config.min_hoard = MultiGetByte(data, &count); } diff --git a/netgames/hyperanarchy/HyperAnarchy.h b/netgames/hyperanarchy/HyperAnarchy.h index 945e703b..48bfcedb 100644 --- a/netgames/hyperanarchy/HyperAnarchy.h +++ b/netgames/hyperanarchy/HyperAnarchy.h @@ -51,15 +51,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -85,7 +85,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -128,7 +128,7 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/hyperanarchy/hyperanarchy.cpp b/netgames/hyperanarchy/hyperanarchy.cpp index 08ea9bce..762c4bc4 100644 --- a/netgames/hyperanarchy/hyperanarchy.cpp +++ b/netgames/hyperanarchy/hyperanarchy.cpp @@ -73,17 +73,17 @@ typedef struct { int Score[2]; } tPlayerStat; -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -99,7 +99,7 @@ static int HyperOrbIcon = -1; static bool DisplayFlagBlink = true; static int WhoJustScoredTimer = -1; static int HyperMoveTimer = -1; -static ubyte HUD_color_model = HCM_PLAYERCOLOR; +static uint8_t HUD_color_model = HCM_PLAYERCOLOR; static int Highlight_bmp = -1; static bool display_my_welcome = false; @@ -120,7 +120,7 @@ const char *GetStringFromTable(int d) { static void SwitchHUDColor(int i); // handles a Hyper Anarchy Game State packet -static void ReceiveHyperGameState(ubyte *data); +static void ReceiveHyperGameState(uint8_t *data); // sends a Hyper Anarchy Game State packet static void SendHyperGameState(int playernum); // Displays HUD scores @@ -145,7 +145,7 @@ static void CreateHyperOrbInRoom(int room); // Given the objnum and room it will move the HyperOrb to the center of that room. Objnum better be valid. static void MoveHyperOrbToRoomCenter(int objnum, int room); // handles a Hyper Anarchy Object Placement packet -static void ReceiveHyperPos(ubyte *data); +static void ReceiveHyperPos(uint8_t *data); // Searches through all the objects and looks for the HyperOrb, returns it's objnum. -1 if it doesn't exist static int FindHyperObjectNum(void); // Searches through all the player's inventory, returns the pnum of the player who has the HyperOrb, -1 @@ -166,7 +166,7 @@ void DetermineScore(int precord_num, int column_num, char *buffer, int buffer_si snprintf(buffer, buffer_size, "%d[%d]", stat->Score[DSTAT_LEVEL], stat->Score[DSTAT_OVERALL]); } -void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use) { +void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use) { player_record *pr = DMFCBase->GetPlayerRecord(precord_num); if (pr && pr->state == STATE_INGAME) { @@ -192,7 +192,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -267,8 +267,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) } // setup the Playerstats struct so DMFC can handle it automatically when a new player enters the game - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); DMFCBase->RegisterPacketReceiver(SPID_HYPERINFO, ReceiveHyperGameState); DMFCBase->RegisterPacketReceiver(SPID_HYPERPOS, ReceiveHyperPos); @@ -1098,7 +1098,7 @@ void OnDisconnectSaveStatsToFile(void) { ///////////////////////////////////////////////////////////// // handles a Hyper Anarchy Game State packet -void ReceiveHyperGameState(ubyte *data) { +void ReceiveHyperGameState(uint8_t *data) { // remove all the HyperOrbs from everyone's inventory for (int i = 0; i < DLLMAX_PLAYERS; i++) DLLInvRemove(i, OBJ_POWERUP, HyperOrbID); @@ -1118,7 +1118,7 @@ void ReceiveHyperGameState(ubyte *data) { void SendHyperGameState(int playernum) { bool updateall = false; int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_HYPERINFO, &count); if ((WhoHasOrb != -1) && (!DMFCBase->CheckPlayerNum(WhoHasOrb))) { @@ -1152,7 +1152,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { return; int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); int x = 510; int rank = 1; @@ -1425,7 +1425,7 @@ void MoveHyperOrbToRoomCenter(int objnum, int room) { DLLComputeRoomCenter(&home_pos, &((DMFCBase->GetRooms())[room])); DLLObjSetPos(&dObjects[objnum], &home_pos, room, NULL, false); if (DMFCBase->GetLocalRole() == LR_SERVER) { // tell the clients to move - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; int count = 0; DMFCBase->StartPacket(data, SPID_HYPERPOS, &count); @@ -1435,7 +1435,7 @@ void MoveHyperOrbToRoomCenter(int objnum, int room) { } // handles a Hyper Anarchy Object Placement packet -void ReceiveHyperPos(ubyte *data) { +void ReceiveHyperPos(uint8_t *data) { int count = 0; int room = MultiGetInt(data, &count); diff --git a/netgames/includes/DMFC.h b/netgames/includes/DMFC.h index 28d39022..fe6f4775 100644 --- a/netgames/includes/DMFC.h +++ b/netgames/includes/DMFC.h @@ -665,13 +665,13 @@ typedef struct { // column_num: which column (index into the PlayerListColumns array) it is working on // x,y,w,h: the (x,y) position of the upper left corner of the area, and the allowed width/height // handle the drawing in this function - void (*clbPlayerColumnBMP)(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use); + void (*clbPlayerColumnBMP)(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use); // Callback function when the stats manager needs to draw the custom bitmap on the detailed column // precord_num: contains the player record number of the player it displaying // column_num: which column (index into the DetailedColumns array) it is working on // x,y,w,h: the (x,y) position of the upper left corner of the area, and the allowed width/height // handle the drawing in this function - void (*clbDetailedColumnBMP)(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use); + void (*clbDetailedColumnBMP)(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use); // Callback function when the stats manager needs to display team info for a particular team // team: contains the team it's displaying about (0 = red, ... 3 = yellow) // buffer: buffer to fill in for your data diff --git a/netgames/includes/gamedll_header.h b/netgames/includes/gamedll_header.h index babe9853..f2e05769 100644 --- a/netgames/includes/gamedll_header.h +++ b/netgames/includes/gamedll_header.h @@ -93,7 +93,7 @@ typedef struct { typedef struct { int me_handle; int it_handle; - ubyte *special_data; + uint8_t *special_data; char *input_string; int input_key; union { @@ -163,15 +163,15 @@ DMFCDLLOUT(Debug_ConsolePrintf_fp DLLDebug_ConsolePrintf;) typedef void (*MultiSendClientExecuteDLL_fp)(int eventnum, int me_objnum, int it_objnum, int to, dllinfo *info); DMFCDLLOUT(MultiSendClientExecuteDLL_fp DLLMultiSendClientExecuteDLL;) -// typedef void( *MultiSendObject_fp ) (object *obj,ubyte announce,ubyte demo_record=true); -typedef void (*MultiSendObject_fp)(object *obj, ubyte announce, ubyte demo_record); +// typedef void( *MultiSendObject_fp ) (object *obj,uint8_t announce,uint8_t demo_record=true); +typedef void (*MultiSendObject_fp)(object *obj, uint8_t announce, uint8_t demo_record); DMFCDLLOUT(MultiSendObject_fp DLLMultiSendObject;) // typedef void( *MultiPaintGoalRooms_fp ) (int *texcolors=NULL); typedef void (*MultiPaintGoalRooms_fp)(int *texcolors); DMFCDLLOUT(MultiPaintGoalRooms_fp DLLMultiPaintGoalRooms;) -typedef void (*MultiSendSpecialPacket_fp)(int slot, ubyte *outdata, int size); +typedef void (*MultiSendSpecialPacket_fp)(int slot, uint8_t *outdata, int size); DMFCDLLOUT(MultiSendSpecialPacket_fp DLLMultiSendSpecialPacket;) typedef void (*ComputeRoomCenter_fp)(vector *vp, room *rp); @@ -181,9 +181,9 @@ typedef int (*GetGoalRoomForTeam_fp)(int teamnum); DMFCDLLOUT(GetGoalRoomForTeam_fp DLLGetGoalRoomForTeam;) // ObjCreate without writing data to demo -// typedef int( *ObjCreate_fp ) (ubyte type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle = +// typedef int( *ObjCreate_fp ) (uint8_t type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle = // OBJECT_HANDLE_NONE); -typedef int (*ObjCreate_fp)(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle); +typedef int (*ObjCreate_fp)(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle); DMFCDLLOUT(ObjCreate_fp DLLObjCreate;) typedef int (*FindObjectIDName_fp)(const char *name); @@ -280,11 +280,11 @@ typedef void (*grtext_SetFancyColor_fp)(ddgr_color col1, ddgr_color col2, ddgr_c DMFCDLLOUT(grtext_SetFancyColor_fp DLLgrtext_SetFancyColor;) // sets the alpha value for text -typedef void (*grtext_SetAlpha_fp)(ubyte alpha); +typedef void (*grtext_SetAlpha_fp)(uint8_t alpha); DMFCDLLOUT(grtext_SetAlpha_fp DLLgrtext_SetAlpha;) // gets font alpha -typedef ubyte (*grtext_GetAlpha_fp)(void); +typedef uint8_t (*grtext_GetAlpha_fp)(void); DMFCDLLOUT(grtext_GetAlpha_fp DLLgrtext_GetAlpha;) // sets the font for text @@ -324,7 +324,7 @@ typedef void (*rend_DrawSimpleBitmap_fp)(int bm_handle, int x, int y); DMFCDLLOUT(rend_DrawSimpleBitmap_fp DLLrend_DrawSimpleBitmap;) // sends a special packet to the server -typedef void (*MultiClientSendSpecialPacket_fp)(ubyte *outdate, int size); +typedef void (*MultiClientSendSpecialPacket_fp)(uint8_t *outdate, int size); DMFCDLLOUT(MultiClientSendSpecialPacket_fp DLLMultiClientSendSpecialPacket;) // adds a blinking hud message @@ -341,14 +341,14 @@ typedef void (*AddHUDItem_fp)(tHUDItem *item); DMFCDLLOUT(AddHUDItem_fp DLLAddHUDItem;) // renders a bitmap onto the hud -// typedef void (*RenderHUDQuad_fp) (int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, ubyte +// typedef void (*RenderHUDQuad_fp) (int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, uint8_t // alpha, int sat_count=0); typedef void (*RenderHUDQuad_fp)(int x, int y, int w, int h, float u0, float v0, float u1, float v1, int bm, - ubyte alpha, int sat_count); + uint8_t alpha, int sat_count); DMFCDLLOUT(RenderHUDQuad_fp DLLRenderHUDQuad;) // renders text, scaled, alphaed, saturated, -typedef void (*RenderHUDText_fp)(ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); +typedef void (*RenderHUDText_fp)(ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); DMFCDLLOUT(RenderHUDText_fp DLLRenderHUDText;) // Ends a multiplayer level and goes on to the next, Server only @@ -379,11 +379,11 @@ typedef void (*bm_DestroyChunkedBitmap_fp)(chunked_bitmap *chunk); DMFCDLLOUT(bm_DestroyChunkedBitmap_fp DLLbm_DestroyChunkedBitmap;) // given a chunked bitmap, renders it. -typedef void (*rend_DrawChunkedBitmap_fp)(chunked_bitmap *chunk, int x, int y, ubyte alpha); +typedef void (*rend_DrawChunkedBitmap_fp)(chunked_bitmap *chunk, int x, int y, uint8_t alpha); DMFCDLLOUT(rend_DrawChunkedBitmap_fp DLLrend_DrawChunkedBitmap;) // given a chunked bitmap, renders it.scaled -typedef void (*rend_DrawScaledChunkedBitmap_fp)(chunked_bitmap *chunk, int x, int y, int neww, int newh, ubyte alpha); +typedef void (*rend_DrawScaledChunkedBitmap_fp)(chunked_bitmap *chunk, int x, int y, int neww, int newh, uint8_t alpha); DMFCDLLOUT(rend_DrawScaledChunkedBitmap_fp DLLrend_DrawScaledChunkedBitmap;) // Opens a file for reading or writing @@ -415,7 +415,7 @@ DMFCDLLOUT(cfexist_fp DLLcfexist;) // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -typedef int (*cf_ReadBytes_fp)(ubyte *buf, int count, CFILE *cfp); +typedef int (*cf_ReadBytes_fp)(uint8_t *buf, int count, CFILE *cfp); DMFCDLLOUT(cf_ReadBytes_fp DLLcf_ReadBytes;) // The following functions read numeric vales from a CFILE. All values are @@ -466,7 +466,7 @@ DMFCDLLOUT(cf_ReadString_fp DLLcf_ReadString;) // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -typedef int (*cf_WriteBytes_fp)(const ubyte *buf, int count, CFILE *cfp); +typedef int (*cf_WriteBytes_fp)(const uint8_t *buf, int count, CFILE *cfp); DMFCDLLOUT(cf_WriteBytes_fp DLLcf_WriteBytes;) // Writes a null-terminated string to a file. If the file is type binary, @@ -537,7 +537,7 @@ typedef void (*DestroyStringTable_fp)(char **table, int size); DMFCDLLOUT(DestroyStringTable_fp DLLDestroyStringTable;) // renders text, scaled, alphaed, saturated, -typedef void (*RenderHUDTextFlags_fp)(int flags, ddgr_color col, ubyte alpha, int sat_count, int x, int y, const char *fmt, ...); +typedef void (*RenderHUDTextFlags_fp)(int flags, ddgr_color col, uint8_t alpha, int sat_count, int x, int y, const char *fmt, ...); DMFCDLLOUT(RenderHUDTextFlags_fp DLLRenderHUDTextFlags;) // Sets the FOV range at which the hud names will come on @@ -731,7 +731,7 @@ DMFCDLLOUT(CreateNewUITextItem_fp DLLCreateNewUITextItem;) typedef void (*RemoveUIBmpItem_fp)(void *item); DMFCDLLOUT(RemoveUIBmpItem_fp DLLRemoveUIBmpItem;) -typedef void *(*CreateNewUIBmpItem_fp)(int handle, ubyte alpha); +typedef void *(*CreateNewUIBmpItem_fp)(int handle, uint8_t alpha); DMFCDLLOUT(CreateNewUIBmpItem_fp DLLCreateNewUIBmpItem;) typedef void *(*UIConsoleGadgetCreate_fp)(void *parentid, int id, int x, int y, int font, int cols, int rows, @@ -1246,7 +1246,7 @@ typedef void (*rend_SetOverlayMap_fp)(int handle); DMFCDLLOUT(rend_SetOverlayMap_fp DLLrend_SetOverlayMap;) // Sets the type of overlay operation -typedef void (*rend_SetOverlayType_fp)(ubyte type); +typedef void (*rend_SetOverlayType_fp)(uint8_t type); DMFCDLLOUT(rend_SetOverlayType_fp DLLrend_SetOverlayType;) // Clears the display to a specified color @@ -1274,7 +1274,7 @@ typedef void (*rend_SetAlphaType_fp)(int8_t); DMFCDLLOUT(rend_SetAlphaType_fp DLLrend_SetAlphaType;) // Sets the constant alpha value -typedef void (*rend_SetAlphaValue_fp)(ubyte val); +typedef void (*rend_SetAlphaValue_fp)(uint8_t val); DMFCDLLOUT(rend_SetAlphaValue_fp DLLrend_SetAlphaValue;) // Sets the wrap parameter @@ -1373,7 +1373,7 @@ DMFCDLLOUT(VisEffectInitType_fp DLLVisEffectInitType;) // initialize a new viseffect. adds to the list for the given room // returns the object number -typedef int (*VisEffectCreate_fp)(ubyte type, ubyte id, int roomnum, vector *pos); +typedef int (*VisEffectCreate_fp)(uint8_t type, uint8_t id, int roomnum, vector *pos); DMFCDLLOUT(VisEffectCreate_fp DLLVisEffectCreate;) // link the viseffect into the list for its room @@ -1410,9 +1410,9 @@ DMFCDLLOUT(CreateRandomLineSparks_fp DLLCreateRandomLineSparks;) // Creates vis effects but has the caller set their parameters // initialize a new viseffect. adds to the list for the given room // returns the vis number -// typedef int (*VisEffectCreateControlled_fp)(ubyte type,object *parent,ubyte id,int roomnum,vector *pos,float +// typedef int (*VisEffectCreateControlled_fp)(uint8_t type,object *parent,uint8_t id,int roomnum,vector *pos,float // lifetime,vector *velocity,int phys_flags=0,float size=0,float mass=0.0f,float drag=0.0f,bool isreal=0); -typedef int (*VisEffectCreateControlled_fp)(ubyte type, object *parent, ubyte id, int roomnum, vector *pos, +typedef int (*VisEffectCreateControlled_fp)(uint8_t type, object *parent, uint8_t id, int roomnum, vector *pos, float lifetime, vector *velocity, int phys_flags, float size, float mass, float drag, bool isreal); DMFCDLLOUT(VisEffectCreateControlled_fp DLLVisEffectCreateControlled;) @@ -1477,7 +1477,7 @@ DMFCDLLOUT(g3_CheckNormalFacing_fp DLLg3_CheckNormalFacing;) // Point definition and rotation functions: // rotates a point. returns codes. does not check if already rotated -typedef ubyte (*g3_RotatePoint_fp)(g3Point *dest, vector *src); +typedef uint8_t (*g3_RotatePoint_fp)(g3Point *dest, vector *src); DMFCDLLOUT(g3_RotatePoint_fp DLLg3_RotatePoint;) // projects a point @@ -1493,7 +1493,7 @@ typedef void (*g3_Point2Vec_fp)(vector *v, short sx, short sy); DMFCDLLOUT(g3_Point2Vec_fp DLLg3_Point2Vec;) // code a point. fills in the p3_codes field of the point, and returns the codes -typedef ubyte (*g3_CodePoint_fp)(g3Point *point); +typedef uint8_t (*g3_CodePoint_fp)(g3Point *point); DMFCDLLOUT(g3_CodePoint_fp DLLg3_CodePoint;) // delta rotation functions @@ -1505,7 +1505,7 @@ typedef vector *(*g3_RotateDeltaZ_fp)(vector *dest, float dz); DMFCDLLOUT(g3_RotateDeltaZ_fp DLLg3_RotateDeltaZ;) typedef vector *(*g3_RotateDeltaVec_fp)(vector *dest, vector *src); DMFCDLLOUT(g3_RotateDeltaVec_fp DLLg3_RotateDeltaVec;) -typedef ubyte (*g3_AddDeltaVec_fp)(g3Point *dest, g3Point *src, vector *deltav); +typedef uint8_t (*g3_AddDeltaVec_fp)(g3Point *dest, g3Point *src, vector *deltav); DMFCDLLOUT(g3_AddDeltaVec_fp DLLg3_AddDeltaVec;) // Drawing functions: @@ -1553,7 +1553,7 @@ typedef void (*g3_DrawBox_fp)(ddgr_color color, g3Point *pnt, float rad); DMFCDLLOUT(g3_DrawBox_fp DLLg3_DrawBox;) // Sets up a custom clipping plane - g3_StartFrame must be called before this is called -typedef void (*g3_SetCustomClipPlane_fp)(ubyte state, vector *pnt, vector *normal); +typedef void (*g3_SetCustomClipPlane_fp)(uint8_t state, vector *pnt, vector *normal); DMFCDLLOUT(g3_SetCustomClipPlane_fp DLLg3_SetCustomClipPlane;) // sets the z distance of the far clipping plane diff --git a/netgames/includes/idmfc.h b/netgames/includes/idmfc.h index 5d32af4a..183287b1 100644 --- a/netgames/includes/idmfc.h +++ b/netgames/includes/idmfc.h @@ -521,7 +521,7 @@ public: // // // There is a control message sent from someone - virtual void OnControlMessage(ubyte msg, int from_pnum) = 0; + virtual void OnControlMessage(uint8_t msg, int from_pnum) = 0; // DMFCBase::OnAllowObserverChange // @@ -722,9 +722,9 @@ public: // to the ID's given to this function. If any match than it calls the handler given to process // the packet. // id = ID of the packet - // func = Function handler to handle the packet. Must be declared like void MyFunction(ubyte *data); - virtual void RegisterPacketReceiver(ubyte id, void (*func)(ubyte *)) = 0; - //@@@@virtual void RegisterPacketReceiver(ubyte id,void (DMFCBase::*func)(ubyte *)) = 0; + // func = Function handler to handle the packet. Must be declared like void MyFunction(uint8_t *data); + virtual void RegisterPacketReceiver(uint8_t id, void (*func)(uint8_t *)) = 0; + //@@@@virtual void RegisterPacketReceiver(uint8_t id,void (DMFCBase::*func)(uint8_t *)) = 0; // DMFCBase::StartPacket // @@ -736,7 +736,7 @@ public: // handler to // call. // count = pointer to your packet index pointer - virtual void StartPacket(ubyte *data, ubyte id, int *count) = 0; + virtual void StartPacket(uint8_t *data, uint8_t id, int *count) = 0; // DMFCBase::SendPacket // @@ -745,7 +745,7 @@ public: // size = size (in bytes) of the packet // destination = either a player number, SP_ALL for all the players or SP_SERVER to send to the server (if you are a // client) - virtual void SendPacket(ubyte *data, int size, int destination) = 0; + virtual void SendPacket(uint8_t *data, int size, int destination) = 0; // DMFCBase::GetTeamForNewPlayer // @@ -778,17 +778,17 @@ public: // DMFCBase::GetTeamAssignmentPacket // // Reciever for the team assignment packet. - virtual void GetTeamAssignmentPacket(ubyte *data) = 0; + virtual void GetTeamAssignmentPacket(uint8_t *data) = 0; // DMFCBase::GetChangeTeamPacket // // Reciever for the change team packet.(Server Only) - virtual void GetChangeTeamPacket(ubyte *data) = 0; + virtual void GetChangeTeamPacket(uint8_t *data) = 0; // DMFCBase::GetGameStateRequest // // Receiver for the server from a client asking for the state of the game - virtual void GetGameStateRequest(ubyte *data) = 0; + virtual void GetGameStateRequest(uint8_t *data) = 0; // DMFCBase::SendChangeTeamRequest // @@ -799,7 +799,7 @@ public: // DMFCBase::GetDMFCGameInfo // // Receives information about the DMFC game - virtual void GetDMFCGameInfo(ubyte *data) = 0; + virtual void GetDMFCGameInfo(uint8_t *data) = 0; // DMFCBase::SendDMFCGameInfo // @@ -878,7 +878,7 @@ public: // // Returns a converted alpha based on what you give, it will be a more transparent if the onscreen menu is up virtual float ConvertHUDAlpha(float normal) = 0; - virtual ubyte ConvertHUDAlpha(ubyte normal) = 0; + virtual uint8_t ConvertHUDAlpha(uint8_t normal) = 0; // DMFCBase::ClipString // @@ -911,13 +911,13 @@ public: // // // Sets the level for displaying of Player's Callsigns on the HUD - virtual void SwitchShowHudCallsignLevel(ubyte level, bool announce = true) = 0; + virtual void SwitchShowHudCallsignLevel(uint8_t level, bool announce = true) = 0; // DMFCBase::SwitchServerHudCallsignLevel // // // Sets the max level of HUD callsign displayage...determined by the server - virtual void SwitchServerHudCallsignLevel(ubyte level) = 0; + virtual void SwitchServerHudCallsignLevel(uint8_t level) = 0; // DMFCBase::GetCounterMeasureOwner // @@ -963,12 +963,12 @@ public: // DMFCBase::DecryptData // // Decrypts a buffer of data - virtual void DecryptData(ubyte *data, int size) = 0; + virtual void DecryptData(uint8_t *data, int size) = 0; // DMFCBase::EncryptData // // Encrypts (weak) a buffer of data - virtual void EncryptData(ubyte *data, int size) = 0; + virtual void EncryptData(uint8_t *data, int size) = 0; // DMFCBase::VersionCheck // @@ -1034,8 +1034,8 @@ public: // returns: 1 if size given was <=0 (if so all previous user stats will be removed) // 0 all went ok // -1 out of memory (all user stats memory will be freed) - virtual int SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)) = 0; + virtual int SetupPlayerRecord(int sizeof_individual_data, int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)) = 0; // DMFCBase::GetPlayerRecordData // @@ -1063,7 +1063,7 @@ public: // // // Recieves and processes a request for a player record - virtual void ReceiveRequestForPlayerRecords(ubyte *data) = 0; + virtual void ReceiveRequestForPlayerRecords(uint8_t *data) = 0; // DMFCBase::IsPlayerBanned // @@ -1110,13 +1110,13 @@ public: // // // Sends a [1 byte] control message to a player - virtual void SendControlMessageToPlayer(int pnum, ubyte msg) = 0; + virtual void SendControlMessageToPlayer(int pnum, uint8_t msg) = 0; // DMFCBase::ReceiveControlMessage // // // Handles a control message - virtual void ReceiveControlMessage(ubyte *data) = 0; + virtual void ReceiveControlMessage(uint8_t *data) = 0; // DMFCBase::FindPInfoStatFirst // @@ -1372,7 +1372,7 @@ public: // bool SetStateItemList(int count, ... ); for MIT_STATE items // or // bool SetStateItemListArray(int count, char **array); for MIT_STATE items - // virtual MenuItem *CreateMenuItem(const char *title,char type,ubyte flags,void (*fp)(int), ... ) = 0; + // virtual MenuItem *CreateMenuItem(const char *title,char type,uint8_t flags,void (*fp)(int), ... ) = 0; // DMFCBase::ReadInHostsAllowDeny // @@ -1474,7 +1474,7 @@ public: virtual void Set_OnSaveStatsToFile(void (*callback)(void)) = 0; virtual void Set_OnPlayerReconnect(void (*callback)(int player_num)) = 0; virtual void Set_OnPlayerConnect(void (*callback)(int player_num)) = 0; - virtual void Set_OnControlMessage(void (*callback)(ubyte msg, int from_pnum)) = 0; + virtual void Set_OnControlMessage(void (*callback)(uint8_t msg, int from_pnum)) = 0; virtual void Set_OnAllowObserverChange(bool (*callback)(bool turnonobserver)) = 0; virtual void Set_OnClientShowUI(void (*callback)(int id, void *user_data)) = 0; virtual void Set_OnPrintScores(void (*callback)(int level)) = 0; @@ -1546,7 +1546,7 @@ public: virtual void CallOnSaveStatsToFile(void) = 0; virtual void CallOnPlayerReconnect(int player_num) = 0; virtual void CallOnPlayerConnect(int player_num) = 0; - virtual void CallOnControlMessage(ubyte msg, int from_pnum) = 0; + virtual void CallOnControlMessage(uint8_t msg, int from_pnum) = 0; virtual bool CallOnAllowObserverChange(bool turnonobserver) = 0; virtual void CallOnClientShowUI(int id, void *user_data) = 0; virtual void CallOnPrintScores(int level) = 0; @@ -1725,7 +1725,7 @@ Class creation interface functions */ DLLEXPORT IDMFC DLLFUNCCALLPTR CreateDMFC(void); DLLEXPORT IMenuItem DLLFUNCCALLPTR CreateMenuItem(void); -DLLEXPORT IMenuItem DLLFUNCCALLPTR CreateMenuItemWArgs(const char *title, char type, ubyte flags, void (*fp)(int), +DLLEXPORT IMenuItem DLLFUNCCALLPTR CreateMenuItemWArgs(const char *title, char type, uint8_t flags, void (*fp)(int), tCustomMenu *custom_menu = NULL); DLLEXPORT IDmfcStats DLLFUNCCALLPTR CreateDmfcStats(void); @@ -1801,7 +1801,7 @@ DLLEXPORT void DLLFUNCCALL IDMFC_OnGameStateRequest(IDMFC *instance, int pnum); DLLEXPORT void DLLFUNCCALL IDMFC_OnSaveStatsToFile(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_OnPlayerReconnect(IDMFC *instance, int player_num); DLLEXPORT void DLLFUNCCALL IDMFC_OnPlayerConnect(IDMFC *instance, int player_num); -DLLEXPORT void DLLFUNCCALL IDMFC_OnControlMessage(IDMFC *instance, ubyte msg, int from_pnum); +DLLEXPORT void DLLFUNCCALL IDMFC_OnControlMessage(IDMFC *instance, uint8_t msg, int from_pnum); DLLEXPORT bool DLLFUNCCALL IDMFC_OnAllowObserverChange(IDMFC *instance, bool turnonobserver); DLLEXPORT void DLLFUNCCALL IDMFC_OnClientShowUI(IDMFC *instance, int id, void *user_data); DLLEXPORT void DLLFUNCCALL IDMFC_OnPrintScores(IDMFC *instance, int level); @@ -1836,19 +1836,19 @@ DLLEXPORT void DLLFUNCCALL IDMFC_DoRandomDeathMessage(IDMFC *instance, int kille uint32_t hash = -1); DLLEXPORT int DLLFUNCCALL IDMFC_GetItObjNum(IDMFC *instance); DLLEXPORT int DLLFUNCCALL IDMFC_GetMeObjNum(IDMFC *instance); -DLLEXPORT void DLLFUNCCALL IDMFC_RegisterPacketReceiver(IDMFC *instance, ubyte id, void (*func)(ubyte *)); -DLLEXPORT void DLLFUNCCALL IDMFC_StartPacket(IDMFC *instance, ubyte *data, ubyte id, int *count); -DLLEXPORT void DLLFUNCCALL IDMFC_SendPacket(IDMFC *instance, ubyte *data, int size, int destination); +DLLEXPORT void DLLFUNCCALL IDMFC_RegisterPacketReceiver(IDMFC *instance, uint8_t id, void (*func)(uint8_t *)); +DLLEXPORT void DLLFUNCCALL IDMFC_StartPacket(IDMFC *instance, uint8_t *data, uint8_t id, int *count); +DLLEXPORT void DLLFUNCCALL IDMFC_SendPacket(IDMFC *instance, uint8_t *data, int size, int destination); DLLEXPORT int DLLFUNCCALL IDMFC_GetTeamForNewPlayer(IDMFC *instance, int player_num, int num_teams); DLLEXPORT void DLLFUNCCALL IDMFC_SetNumberOfTeams(IDMFC *instance, int teams); DLLEXPORT void DLLFUNCCALL IDMFC_AutoTeamSelect(IDMFC *instance, bool turnon); DLLEXPORT void DLLFUNCCALL IDMFC_SendTeamAssignment(IDMFC *instance, int playernum, int team, bool spew_on_respawn); -DLLEXPORT void DLLFUNCCALL IDMFC_GetTeamAssignmentPacket(IDMFC *instance, ubyte *data); -DLLEXPORT void DLLFUNCCALL IDMFC_GetChangeTeamPacket(IDMFC *instance, ubyte *data); -DLLEXPORT void DLLFUNCCALL IDMFC_GetGameStateRequest(IDMFC *instance, ubyte *data); +DLLEXPORT void DLLFUNCCALL IDMFC_GetTeamAssignmentPacket(IDMFC *instance, uint8_t *data); +DLLEXPORT void DLLFUNCCALL IDMFC_GetChangeTeamPacket(IDMFC *instance, uint8_t *data); +DLLEXPORT void DLLFUNCCALL IDMFC_GetGameStateRequest(IDMFC *instance, uint8_t *data); DLLEXPORT void DLLFUNCCALL IDMFC_SendChangeTeamRequest(IDMFC *instance, int newteam, bool spew_onchange); -DLLEXPORT void DLLFUNCCALL IDMFC_GetDMFCGameInfo(IDMFC *instance, ubyte *data); +DLLEXPORT void DLLFUNCCALL IDMFC_GetDMFCGameInfo(IDMFC *instance, uint8_t *data); DLLEXPORT void DLLFUNCCALL IDMFC_SendDMFCGameInfo(IDMFC *instance, int player); DLLEXPORT void DLLFUNCCALL IDMFC_RequestTeamChange(IDMFC *instance, int team, int pnum, bool spew_on_respawn); DLLEXPORT void DLLFUNCCALL IDMFC_RequestGameState(IDMFC *instance); @@ -1864,15 +1864,15 @@ DLLEXPORT void DLLFUNCCALL IDMFC_GetSortedPlayerSlotsByEfficiency(IDMFC *instanc int maxsize); DLLEXPORT bool DLLFUNCCALL IDMFC_IsMenuUp(IDMFC *instance); DLLEXPORT float DLLFUNCCALL IDMFC_ConvertHUDAlphaFloat(IDMFC *instance, float normal); -DLLEXPORT ubyte DLLFUNCCALL IDMFC_ConvertHUDAlphaByte(IDMFC *instance, ubyte normal); +DLLEXPORT uint8_t DLLFUNCCALL IDMFC_ConvertHUDAlphaByte(IDMFC *instance, uint8_t normal); DLLEXPORT void DLLFUNCCALL IDMFC_ClipString(IDMFC *instance, int width, char *string, bool arrow); DLLEXPORT void DLLFUNCCALL IDMFC_DisplayOutrageLogo(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_KillAllTimers(IDMFC *instance); DLLEXPORT int DLLFUNCCALL IDMFC_SetTimerInterval(IDMFC *instance, void (*func)(void), float intval, float longevity, void (*onkill)(void) = NULL); DLLEXPORT void DLLFUNCCALL IDMFC_KillTimer(IDMFC *instance, int handle); -DLLEXPORT void DLLFUNCCALL IDMFC_SwitchShowHudCallsignLevel(IDMFC *instance, ubyte level, bool announce = true); -DLLEXPORT void DLLFUNCCALL IDMFC_SwitchServerHudCallsignLevel(IDMFC *instance, ubyte level); +DLLEXPORT void DLLFUNCCALL IDMFC_SwitchShowHudCallsignLevel(IDMFC *instance, uint8_t level, bool announce = true); +DLLEXPORT void DLLFUNCCALL IDMFC_SwitchServerHudCallsignLevel(IDMFC *instance, uint8_t level); DLLEXPORT int DLLFUNCCALL IDMFC_GetCounterMeasureOwner(IDMFC *instance, object *robot); DLLEXPORT int DLLFUNCCALL IDMFC_CFGOpen(IDMFC *instance, char *filename); DLLEXPORT void DLLFUNCCALL IDMFC_CFGClose(IDMFC *instance); @@ -1881,8 +1881,8 @@ DLLEXPORT int DLLFUNCCALL IDMFC_CFGCreateKey(IDMFC *instance, char *name); DLLEXPORT int DLLFUNCCALL IDMFC_CFGLookupKey(IDMFC *instance, char *name); DLLEXPORT int DLLFUNCCALL IDMFC_CFGLookupRecord(IDMFC *instance, char *record, void *data); DLLEXPORT int DLLFUNCCALL IDMFC_CFGCreateRecord(IDMFC *instance, char *name, char type, void *data); -DLLEXPORT void DLLFUNCCALL IDMFC_DecryptData(IDMFC *instance, ubyte *data, int size); -DLLEXPORT void DLLFUNCCALL IDMFC_EncryptData(IDMFC *instance, ubyte *data, int size); +DLLEXPORT void DLLFUNCCALL IDMFC_DecryptData(IDMFC *instance, uint8_t *data, int size); +DLLEXPORT void DLLFUNCCALL IDMFC_EncryptData(IDMFC *instance, uint8_t *data, int size); DLLEXPORT void DLLFUNCCALL IDMFC_VersionCheck(IDMFC *instance, int pnum); DLLEXPORT void DLLFUNCCALL IDMFC_UpdatePInfo(IDMFC *instance, int victim, int killer, int amount); DLLEXPORT void DLLFUNCCALL IDMFC_ResetPInfo(IDMFC *instance); @@ -1891,13 +1891,13 @@ DLLEXPORT bool DLLFUNCCALL IDMFC_SetWeaponDeathMessage(IDMFC *instance, const ch DLLEXPORT char DLLFUNCCALLPTR IDMFC_GetWeaponDeathMessage(IDMFC *instance, int index, bool *victim_first); DLLEXPORT void DLLFUNCCALL IDMFC_AddWeaponHash(IDMFC *instance, const char *parent, int count, char **array); DLLEXPORT int DLLFUNCCALL IDMFC_SetupPlayerRecord(IDMFC *instance, int sizeof_individual_data, - int (*pack_callback)(void *user_info, ubyte *data), - int (*unpack_callback)(void *user_info, ubyte *data)); + int (*pack_callback)(void *user_info, uint8_t *data), + int (*unpack_callback)(void *user_info, uint8_t *data)); DLLEXPORT void DLLFUNCCALLPTR IDMFC_GetPlayerRecordData(IDMFC *instance, int pnum); DLLEXPORT player_record DLLFUNCCALLPTR IDMFC_GetPlayerRecord(IDMFC *instance, int slot); DLLEXPORT player_record DLLFUNCCALLPTR IDMFC_GetPlayerRecordByPnum(IDMFC *instance, int pnum); DLLEXPORT void DLLFUNCCALL IDMFC_SendRequestForPlayerRecords(IDMFC *instance); -DLLEXPORT void DLLFUNCCALL IDMFC_ReceiveRequestForPlayerRecords(IDMFC *instance, ubyte *data); +DLLEXPORT void DLLFUNCCALL IDMFC_ReceiveRequestForPlayerRecords(IDMFC *instance, uint8_t *data); DLLEXPORT bool DLLFUNCCALL IDMFC_IsPlayerBanned(IDMFC *instance, int pnum); DLLEXPORT bool DLLFUNCCALL IDMFC_IsAddressBanned(IDMFC *instance, network_address *addr, const char *tracker_id); DLLEXPORT void DLLFUNCCALL IDMFC_RemoveAllBans(IDMFC *instance); @@ -1906,8 +1906,8 @@ DLLEXPORT char DLLFUNCCALLPTR IDMFC_GetBannedPlayerCallsign(IDMFC *instance, int DLLEXPORT int DLLFUNCCALL IDMFC_GetNumBannedPlayers(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_BanPlayerFromGame(IDMFC *instance, int pnum); DLLEXPORT bool DLLFUNCCALL IDMFC_IsPlayerAlive(IDMFC *instance, int pnum); -DLLEXPORT void DLLFUNCCALL IDMFC_SendControlMessageToPlayer(IDMFC *instance, int pnum, ubyte msg); -DLLEXPORT void DLLFUNCCALL IDMFC_ReceiveControlMessage(IDMFC *instance, ubyte *data); +DLLEXPORT void DLLFUNCCALL IDMFC_SendControlMessageToPlayer(IDMFC *instance, int pnum, uint8_t msg); +DLLEXPORT void DLLFUNCCALL IDMFC_ReceiveControlMessage(IDMFC *instance, uint8_t *data); DLLEXPORT bool DLLFUNCCALL IDMFC_FindPInfoStatFirst(IDMFC *instance, int slot, tPInfoStat *stat); DLLEXPORT bool DLLFUNCCALL IDMFC_FindPInfoStatNext(IDMFC *instance, tPInfoStat *stat); DLLEXPORT void DLLFUNCCALL IDMFC_FindPInfoStatClose(IDMFC *instance); @@ -2050,7 +2050,7 @@ DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnSaveStatsToFile(IDMFC *instance, void (*c DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnPlayerReconnect(IDMFC *instance, void (*callback)(int player_num)); DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnPlayerConnect(IDMFC *instance, void (*callback)(int player_num)); DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnControlMessage(IDMFC *instance, - void (*callback)(ubyte msg, int from_pnum)); + void (*callback)(uint8_t msg, int from_pnum)); DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnAllowObserverChange(IDMFC *instance, bool (*callback)(bool turnonobserver)); DLLEXPORT void DLLFUNCCALL IDMFC_Set_OnClientShowUI(IDMFC *instance, void (*callback)(int id, void *user_data)); @@ -2125,7 +2125,7 @@ DLLEXPORT void DLLFUNCCALL IDMFC_CallOnGameStateRequest(IDMFC *instance, int pnu DLLEXPORT void DLLFUNCCALL IDMFC_CallOnSaveStatsToFile(IDMFC *instance); DLLEXPORT void DLLFUNCCALL IDMFC_CallOnPlayerReconnect(IDMFC *instance, int player_num); DLLEXPORT void DLLFUNCCALL IDMFC_CallOnPlayerConnect(IDMFC *instance, int player_num); -DLLEXPORT void DLLFUNCCALL IDMFC_CallOnControlMessage(IDMFC *instance, ubyte msg, int from_pnum); +DLLEXPORT void DLLFUNCCALL IDMFC_CallOnControlMessage(IDMFC *instance, uint8_t msg, int from_pnum); DLLEXPORT bool DLLFUNCCALL IDMFC_CallOnAllowObserverChange(IDMFC *instance, bool turnonobserver); DLLEXPORT void DLLFUNCCALL IDMFC_CallOnClientShowUI(IDMFC *instance, int id, void *user_data); DLLEXPORT void DLLFUNCCALL IDMFC_CallOnPrintScores(IDMFC *instance, int level); diff --git a/netgames/monsterball/monsterball.cpp b/netgames/monsterball/monsterball.cpp index c74aa7a7..668ab9df 100644 --- a/netgames/monsterball/monsterball.cpp +++ b/netgames/monsterball/monsterball.cpp @@ -207,10 +207,10 @@ typedef struct { int BadScore[2]; } tPlayerStat; -static int pack_pstat(tPlayerStat *user_info, ubyte *data); -static int unpack_pstat(tPlayerStat *user_info, ubyte *data); +static int pack_pstat(tPlayerStat *user_info, uint8_t *data); +static int unpack_pstat(tPlayerStat *user_info, uint8_t *data); -int pack_pstat(tPlayerStat *user_info, ubyte *data) { +int pack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; MultiAddInt(user_info->Score[0], data, &count); MultiAddInt(user_info->Score[1], data, &count); @@ -219,7 +219,7 @@ int pack_pstat(tPlayerStat *user_info, ubyte *data) { return count; } -int unpack_pstat(tPlayerStat *user_info, ubyte *data) { +int unpack_pstat(tPlayerStat *user_info, uint8_t *data) { int count = 0; user_info->Score[0] = MultiGetInt(data, &count); user_info->Score[1] = MultiGetInt(data, &count); @@ -283,7 +283,7 @@ const char *GetStringFromTable(int d) { // Prototypes static void DisplayHUDScores(struct tHUDItem *hitem); static void DisplayStats(void); -static void GetGameStartPacket(ubyte *data); +static void GetGameStartPacket(uint8_t *data); static void SendGameStartPacket(int pnum); static bool GetMonsterballInfo(int id); static void SortTeams(void); @@ -297,7 +297,7 @@ static void OnTimerRegenKill(void); static void SaveStatsToFile(char *filename); static void SortPlayerSlots(int *sorted_list, int count); static void SendLastHitInfo(void); -static void GetLastHitInfo(ubyte *data); +static void GetLastHitInfo(uint8_t *data); static void HandlePickupPowerball(object *owner); static void HandleLosePowerball(bool play_sound); @@ -333,7 +333,7 @@ void TeamScoreCallback(int team, char *buffer, int buffer_size) { snprintf(buffer, buffer_size, " %d", TeamScores[team]); } -void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, ubyte alpha_to_use) { +void ShowStatBitmap(int precord_num, int column_num, int x, int y, int w, int h, uint8_t alpha_to_use) { player_record *pr = DMFCBase->GetPlayerRecord(precord_num); if (!pr || pr->state != STATE_INGAME) @@ -363,7 +363,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -424,8 +424,8 @@ void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) DMFCBase->AddSuicideMessage(TXT_SUICIDEA); // setup the Playerstats struct so DMFC can handle it automatically when a new player enters the game - DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, ubyte *))pack_pstat, - (int (*)(void *, ubyte *))unpack_pstat); + DMFCBase->SetupPlayerRecord(sizeof(tPlayerStat), (int (*)(void *, uint8_t *))pack_pstat, + (int (*)(void *, uint8_t *))unpack_pstat); // register special packet receivers DMFCBase->RegisterPacketReceiver(SPID_NEWPLAYER, GetGameStartPacket); @@ -1672,7 +1672,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; int y, x, team, p; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)255); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)255); if (!ValidateOwner(&p, NULL)) { p = -1; @@ -1737,14 +1737,14 @@ void DisplayHUDScores(struct tHUDItem *hitem) { } } -void GetLastHitInfo(ubyte *data) { +void GetLastHitInfo(uint8_t *data) { int size = 0; LastHitPnum = (int8_t)MultiGetByte(data, &size); } void SendLastHitInfo(void) { int size = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_HITINFO, &size); @@ -1753,7 +1753,7 @@ void SendLastHitInfo(void) { DMFCBase->SendPacket(data, size, SP_ALL); } -void GetGameStartPacket(ubyte *data) { +void GetGameStartPacket(uint8_t *data) { int i, count = 0; // team scores @@ -1799,7 +1799,7 @@ void GetGameStartPacket(ubyte *data) { void SendGameStartPacket(int pnum) { int i, count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_NEWPLAYER, &count); diff --git a/netgames/monsterball/monsterball.h b/netgames/monsterball/monsterball.h index a6ded8c8..352f00b3 100644 --- a/netgames/monsterball/monsterball.h +++ b/netgames/monsterball/monsterball.h @@ -85,15 +85,15 @@ extern IDMFC *DMFCBase; // These next two function prototypes MUST appear in the extern "C" block if called // from a CPP file. extern "C" { -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); } // The main entry point where the game calls the dll @@ -116,7 +116,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -159,6 +159,6 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/roboanarchy/roboAnarchy.h b/netgames/roboanarchy/roboAnarchy.h index fa0c3746..e5ab9ee1 100644 --- a/netgames/roboanarchy/roboAnarchy.h +++ b/netgames/roboanarchy/roboAnarchy.h @@ -76,15 +76,15 @@ extern IDMFC *DMFCBase; #ifdef __cplusplus extern "C" { #endif -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -110,7 +110,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -153,6 +153,6 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/roboanarchy/roboanarchy.cpp b/netgames/roboanarchy/roboanarchy.cpp index c9ee9e15..e57bfa6b 100644 --- a/netgames/roboanarchy/roboanarchy.cpp +++ b/netgames/roboanarchy/roboanarchy.cpp @@ -68,8 +68,8 @@ static int Highlight_bmp = -1; #define AHD_EFFICIENCY 2 #define ACM_PLAYERCOLOR 0 #define ACM_NORMAL 1 -static ubyte Anarchy_hud_display = AHD_SCORE; -static ubyte HUD_color_model = ACM_PLAYERCOLOR; +static uint8_t Anarchy_hud_display = AHD_SCORE; +static uint8_t HUD_color_model = ACM_PLAYERCOLOR; static bool display_my_welcome = false; static void DisplayHUDScores(struct tHUDItem *hitem); @@ -122,7 +122,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -818,7 +818,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { return; int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int y = (DMFCBase->GetGameWindowH() / 2) - ((height * 5) / 2); int x = 520; ddgr_color color; diff --git a/netgames/tanarchy/tanDMFC.h b/netgames/tanarchy/tanDMFC.h index 0cada559..c64822e4 100644 --- a/netgames/tanarchy/tanDMFC.h +++ b/netgames/tanarchy/tanDMFC.h @@ -40,15 +40,15 @@ extern IDMFC *DMFCBase; // These next two function prototypes MUST appear in the extern "C" block if called // from a CPP file. extern "C" { -DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use); +DLLEXPORT void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use); DLLEXPORT void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data); DLLEXPORT void DLLFUNCCALL DLLGameClose(); DLLEXPORT void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options); -DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void DLLFUNCCALLPTR CreateInstance(int id); DLLEXPORT void DLLFUNCCALL DestroyInstance(int id, void *ptr); DLLEXPORT short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); } @@ -72,7 +72,7 @@ void DLLFUNCCALL DLLGameCall(int eventnum, dllinfo *data) { // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int DLLFUNCCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int DLLFUNCCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // CreateInstance // Purpose: @@ -115,6 +115,6 @@ short DLLFUNCCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventIn // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int DLLFUNCCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int DLLFUNCCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } #endif diff --git a/netgames/tanarchy/tanarchy.cpp b/netgames/tanarchy/tanarchy.cpp index b56f027f..11c6c1c7 100644 --- a/netgames/tanarchy/tanarchy.cpp +++ b/netgames/tanarchy/tanarchy.cpp @@ -95,7 +95,7 @@ static int SortedPlayers[MAX_PLAYER_RECORDS]; static bool DisplayScoreScreen; static bool display_my_welcome = false; -static void GetGameStartPacket(ubyte *data); +static void GetGameStartPacket(uint8_t *data); static void SendGameStartPacket(int pnum); static void DisplayScores(void); static void DisplayHUDScores(struct tHUDItem *hitem); @@ -151,7 +151,7 @@ void DLLFUNCCALL DLLGetGameInfo(tDLLOptions *options) { } // Initializes the game function pointers -void DLLFUNCCALL DLLGameInit(int *api_func, ubyte *all_ok, int num_teams_to_use) { +void DLLFUNCCALL DLLGameInit(int *api_func, uint8_t *all_ok, int num_teams_to_use) { *all_ok = 1; DMFCBase = CreateDMFC(); if (!DMFCBase) { @@ -837,7 +837,7 @@ void OnDisconnectSaveStatsToFile(void) { } // Handles when we get a new player packet -void GetGameStartPacket(ubyte *data) { +void GetGameStartPacket(uint8_t *data) { // get the team scores DLLmprintf((0, "Receiving Team Scores from server\n")); int count = 0, i; @@ -849,7 +849,7 @@ void GetGameStartPacket(ubyte *data) { // Handles sending a new player packet void SendGameStartPacket(int pnum) { int count = 0; - ubyte data[MAX_GAME_DATA_SIZE]; + uint8_t data[MAX_GAME_DATA_SIZE]; DMFCBase->StartPacket(data, SPID_NEWPLAYER, &count); @@ -876,7 +876,7 @@ void DisplayHUDScores(struct tHUDItem *hitem) { int height = DLLgrfont_GetHeight((DMFCBase->GetGameFontTranslateArray())[HUD_FONT_INDEX]) + 3; int y = (DMFCBase->GetGameWindowH() / 2) - ((height * NUM_TEAMS) / 2); int x = 520; - ubyte alpha = DMFCBase->ConvertHUDAlpha((ubyte)((DisplayScoreScreen) ? 128 : 255)); + uint8_t alpha = DMFCBase->ConvertHUDAlpha((uint8_t)((DisplayScoreScreen) ? 128 : 255)); int team; // char name[30]; diff --git a/networking/directplay.cpp b/networking/directplay.cpp index 127ad46e..e8cd53a3 100644 --- a/networking/directplay.cpp +++ b/networking/directplay.cpp @@ -497,7 +497,7 @@ int dp_ListDirectPlayGames() { // This function will look for incoming messages, and dispatch them accordingly void dp_DirectPlayDispatch() { HRESULT hr; - ubyte packet_data[32000]; // MAX_PACKET_SIZE+1]; + uint8_t packet_data[32000]; // MAX_PACKET_SIZE+1]; DWORD dwMsgBufferSize = 32000; // MAX_PACKET_SIZE; DPID idFrom = 0; DPID idTo = 0; @@ -578,14 +578,14 @@ void dp_DirectPlayDispatch() { memset(&from_addr, 0, sizeof(network_address)); from_addr.connection_type = NP_DIRECTPLAY; memcpy(from_addr.address, &idFrom, sizeof(DPID)); - nw_psnet_buffer_packet((ubyte *)packet_data, dwMsgBufferSize, &from_addr); + nw_psnet_buffer_packet((uint8_t *)packet_data, dwMsgBufferSize, &from_addr); } } } } // Send a packet to a direct play user -int dp_DirectPlaySend(network_address *who_to, ubyte *data, int len, bool reliable) { +int dp_DirectPlaySend(network_address *who_to, uint8_t *data, int len, bool reliable) { DPID idTo; HRESULT hr; uint32_t send_flags; diff --git a/networking/networking.cpp b/networking/networking.cpp index 8be7d7c8..3c609358 100644 --- a/networking/networking.cpp +++ b/networking/networking.cpp @@ -392,14 +392,14 @@ typedef struct network_checksum_packet { int sequence_number; ushort flags; ushort checksum; - ubyte data[MAX_PACKET_SIZE]; + uint8_t data[MAX_PACKET_SIZE]; } network_checksum_packet; // definition for a non-checksum packet typedef struct network_packet { int sequence_number; ushort flags; - ubyte data[MAX_PACKET_SIZE]; + uint8_t data[MAX_PACKET_SIZE]; } network_naked_packet; // structure definition for our packet buffers @@ -407,7 +407,7 @@ typedef struct network_packet_buffer { int sequence_number; int len; network_address from_addr; - ubyte data[MAX_PACKET_SIZE]; + uint8_t data[MAX_PACKET_SIZE]; } network_packet_buffer; #define MAX_PACKET_BUFFERS 96 @@ -455,24 +455,24 @@ static int Psnet_highest_id = 0; #endif #pragma pack(1) typedef struct { - ubyte type; // packet type - ubyte compressed; // + uint8_t type; // packet type + uint8_t compressed; // ushort seq; // sequence packet 0-65535 used for ACKing also ushort data_len; // length of data float send_time; // Time the packet was sent, if an ACK the time the packet being ACK'd was sent. - ubyte data[NETBUFFERSIZE]; // Packet data + uint8_t data[NETBUFFERSIZE]; // Packet data } reliable_header; #define RELIABLE_PACKET_HEADER_ONLY_SIZE (sizeof(reliable_header) - NETBUFFERSIZE) #define MAX_PING_HISTORY 10 typedef struct { - ubyte buffer[NETBUFFERSIZE]; + uint8_t buffer[NETBUFFERSIZE]; } reliable_net_sendbuffer; typedef struct { - ubyte buffer[NETBUFFERSIZE]; + uint8_t buffer[NETBUFFERSIZE]; } reliable_net_rcvbuffer; static SOCKET Reliable_UDP_socket = INVALID_SOCKET; @@ -506,7 +506,7 @@ typedef struct { uint16_t theirsequence; // This is the next sequence number the peer is expecting uint16_t rsequence[MAXNETBUFFERS]; // This is the sequence number of the given packet - ubyte ping_pos; + uint8_t ping_pos; network_address net_addr; // A D3 network address structure network_protocol connection_type; // IPX, IP, modem, etc. @@ -514,7 +514,7 @@ typedef struct { SOCKADDR addr; // SOCKADDR of our peer reliable_net_sendbuffer *sbuffers[MAXNETBUFFERS]; // This is an array of pointers for quick sorting uint16_t ssequence[MAXNETBUFFERS]; // This is the sequence number of the given packet - ubyte send_urgent; + uint8_t send_urgent; } reliable_socket; static reliable_socket reliable_sockets[MAXRELIABLESOCKETS]; @@ -892,7 +892,7 @@ uint32_t nw_GetThisIP() { // Calculates a unique ushort checksum for a stream of data ushort nw_CalculateChecksum(void *vptr, int len) { - ubyte *ptr = (ubyte *)vptr; + uint8_t *ptr = (uint8_t *)vptr; uint32_t sum1, sum2; sum1 = sum2 = 0; @@ -915,15 +915,15 @@ int nw_Send(network_address *who_to, void *data, int len, int flags) { Int3(); } if (NetDebugFile) { - ubyte *ptr = (ubyte *)data; + uint8_t *ptr = (uint8_t *)data; cfprintf(NetDebugFile, "nw_Send packet of type %d at %f seconds.\n", ptr[0], timer_GetTime()); } - return nw_SendWithID(NWT_UNRELIABLE, (ubyte *)data, len, who_to); + return nw_SendWithID(NWT_UNRELIABLE, (uint8_t *)data, len, who_to); } // MTS: only used in this file? -void nw_HandleUnreliableData(ubyte *data, int len, network_address *from_addr) { - nw_psnet_buffer_packet((ubyte *)data, len, from_addr); +void nw_HandleUnreliableData(uint8_t *data, int len, network_address *from_addr) { + nw_psnet_buffer_packet((uint8_t *)data, len, from_addr); } // MTS: unused? @@ -953,7 +953,7 @@ int nw_Receive(void *data, network_address *from_addr) { int buffer_size; // try and get a free buffer and return its size - if (nw_psnet_buffer_get_next((ubyte *)data, &buffer_size, from_addr)) { + if (nw_psnet_buffer_get_next((uint8_t *)data, &buffer_size, from_addr)) { return buffer_size; } return 0; @@ -967,7 +967,7 @@ int ExtraBufferTempHack = 0; // 0 No packet ready to receive // >0 Buffer filled with the number of bytes recieved -int nw_ReceiveReliable(SOCKET socketid, ubyte *buffer, int max_len) { +int nw_ReceiveReliable(SOCKET socketid, uint8_t *buffer, int max_len) { int i; if (Use_DirectPlay) { @@ -975,7 +975,7 @@ int nw_ReceiveReliable(SOCKET socketid, ubyte *buffer, int max_len) { dp_DirectPlayDispatch(); // try and get a free buffer and return its size - if (nw_psnet_buffer_get_next_by_packet_id((ubyte *)buffer, &max_len, socketid)) { + if (nw_psnet_buffer_get_next_by_packet_id((uint8_t *)buffer, &max_len, socketid)) { return max_len; } return 0; @@ -1076,7 +1076,7 @@ int nw_CheckListenSocket(network_address *from_addr) { return INVALID_SOCKET; } -int nw_SendReliable(uint32_t socketid, ubyte *data, int length, bool urgent) { +int nw_SendReliable(uint32_t socketid, uint8_t *data, int length, bool urgent) { int i; int bytesout; int use_buffer = -1; @@ -1150,7 +1150,7 @@ int nw_SendReliable(uint32_t socketid, ubyte *data, int length, bool urgent) { } // mprintf((0,"Sending reliable packet! Sequence %d\n",send_header.seq)); - bytesout = nw_SendWithID(NWT_RELIABLE, (ubyte *)&send_header, + bytesout = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + rsocket->send_len[use_buffer], &send_address); if ((bytesout == SOCKET_ERROR) && (WSAEWOULDBLOCK == WSAGetLastError())) { @@ -1236,7 +1236,7 @@ void nw_SendReliableAck(SOCKADDR *raddr, uint32_t sig, network_protocol link_typ send_address.connection_type = NP_TCP; } - ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&ack_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + sizeof(uint32_t), + ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&ack_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + sizeof(uint32_t), &send_address); } @@ -1249,7 +1249,7 @@ void nw_DoNetworkIdle(void) { #define CONNECTSEQ 0x142 // Magic number for starting a connection, just so it isn't 0 -void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { +void nw_WorkReliable(uint8_t *data, int len, network_address *naddr) { int i; int rcode = -1; short max_len = NETBUFFERSIZE; @@ -1292,7 +1292,7 @@ void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { send_address.connection_type = NP_TCP; } - int ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); + int ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); if ((ret == SOCKET_ERROR) && (WSAEWOULDBLOCK == WSAGetLastError())) { reliable_sockets[serverconn].last_packet_sent = timer_GetTime() - NETRETRYTIME; @@ -1303,7 +1303,7 @@ void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { network_protocol link_type = naddr->connection_type; network_address d3_rcv_addr; memcpy(&d3_rcv_addr, naddr, sizeof(network_address)); - memcpy((ubyte *)&rcv_buff, data, len); + memcpy((uint8_t *)&rcv_buff, data, len); SOCKADDR_IN *rcvaddr, *rsockaddr; do { @@ -1513,7 +1513,7 @@ void nw_WorkReliable(ubyte *data, int len, network_address *naddr) { } // MTS: only used in this file -void nw_HandleConnectResponse(ubyte *data, int len, network_address *server_addr) { +void nw_HandleConnectResponse(uint8_t *data, int len, network_address *server_addr) { int i; static reliable_header ack_header; @@ -1556,7 +1556,7 @@ void nw_HandleConnectResponse(ubyte *data, int len, network_address *server_addr last_sent_iamhere = timer_GetTime(); int rcode = - nw_SendWithID(NWT_RELIABLE, (ubyte *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); + nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); // int rcode = sendto(typeless_sock,(char // *)&conn_header,RELIABLE_PACKET_HEADER_ONLY_SIZE,0,addr,sizeof(SOCKADDR)); if (rcode == SOCKET_ERROR) { @@ -1634,7 +1634,7 @@ void nw_ConnectToServer(SOCKET *socket, network_address *server_addr) { network_address d3_rcv_addr; memset(&d3_rcv_addr, 0, sizeof(network_address)); - int ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); + int ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); if (SOCKET_ERROR == ret) { mprintf((0, "Unable to send packet in nw_ConnectToServer()! -- %d\n", WSAGetLastError())); return; @@ -1654,7 +1654,7 @@ void nw_ConnectToServer(SOCKET *socket, network_address *server_addr) { } if ((timer_GetTime() - time_sent_req) > 2) { mprintf((0, "Resending connect request.\n")); - int ret = nw_SendWithID(NWT_RELIABLE, (ubyte *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); + int ret = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, server_addr); if (ret != SOCKET_ERROR) { time_sent_req = timer_GetTime(); } else { @@ -1715,7 +1715,7 @@ void nw_CloseSocket(SOCKET *sockp) { send_address.connection_type = NP_TCP; } - nw_SendWithID(NWT_RELIABLE, (ubyte *)&diss_conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); + nw_SendWithID(NWT_RELIABLE, (uint8_t *)&diss_conn_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); memset(&reliable_sockets[*sockp], 0, sizeof(reliable_socket)); reliable_sockets[*sockp].status = RNF_UNUSED; @@ -1761,8 +1761,8 @@ int nw_PingCompare(const void *arg1, const void *arg2) { #define COMPRESS_KEY 0xfd int nw_Compress(void *srcdata, void *destdata, int count) { int i; - ubyte *curr_src = (ubyte *)srcdata; - ubyte *currp = (ubyte *)destdata; + uint8_t *curr_src = (uint8_t *)srcdata; + uint8_t *currp = (uint8_t *)destdata; for (i = 0; i < count; i++) { // Woops, we have a char that matches our compress key, so add it as it's own type if (curr_src[i] == COMPRESS_KEY) { @@ -1791,15 +1791,15 @@ int nw_Compress(void *srcdata, void *destdata, int count) { currp++; } } - return currp - (ubyte *)destdata; + return currp - (uint8_t *)destdata; } // MTS: only used in this file int nw_Uncompress(void *compdata, void *uncompdata, int count) { int i; int destlen = 0; - ubyte *comp_src = (ubyte *)compdata; - ubyte *currp = (ubyte *)uncompdata; + uint8_t *comp_src = (uint8_t *)compdata; + uint8_t *currp = (uint8_t *)uncompdata; for (i = 0; i < count; i++) { if (*comp_src == COMPRESS_KEY) { comp_src++; @@ -1845,7 +1845,7 @@ void nw_psnet_buffer_init() { // MTS: only used in this file // buffer a packet (maintain order!) -void nw_psnet_buffer_packet(ubyte *data, int length, network_address *from) { +void nw_psnet_buffer_packet(uint8_t *data, int length, network_address *from) { int idx; int found_buf = 0; @@ -1879,7 +1879,7 @@ void nw_psnet_buffer_packet(ubyte *data, int length, network_address *from) { // MTS: only used in this file // get the index of the next packet in order! -int nw_psnet_buffer_get_next_by_packet_id(ubyte *data, int *length, uint32_t packet_id) { +int nw_psnet_buffer_get_next_by_packet_id(uint8_t *data, int *length, uint32_t packet_id) { int idx; int found_buf = 0; @@ -1917,7 +1917,7 @@ int nw_psnet_buffer_get_next_by_packet_id(ubyte *data, int *length, uint32_t pac // MTS: only used in this file // get the index of the next packet in order! -int nw_psnet_buffer_get_next(ubyte *data, int *length, network_address *from) { +int nw_psnet_buffer_get_next(uint8_t *data, int *length, network_address *from) { int idx; int found_buf = 0; @@ -2288,7 +2288,7 @@ int nw_ReccomendPPS() { // Register the networking library to call your function back // When data containing your ID is found // Returns non-zero if succesfull, Zero if this ID is already registered -int nw_RegisterCallback(NetworkReceiveCallback nfp, ubyte id) { +int nw_RegisterCallback(NetworkReceiveCallback nfp, uint8_t id) { ASSERT(id < 16); // rcg06212000 this happens all the time; let it slide. @@ -2302,7 +2302,7 @@ int nw_RegisterCallback(NetworkReceiveCallback nfp, ubyte id) { return 0; } -NetworkReceiveCallback nw_UnRegisterCallback(ubyte id) { +NetworkReceiveCallback nw_UnRegisterCallback(uint8_t id) { NetworkReceiveCallback nfp; ASSERT(id < 16); nfp = Netcallbacks[id]; @@ -2310,14 +2310,14 @@ NetworkReceiveCallback nw_UnRegisterCallback(ubyte id) { return nfp; } -int nw_SendWithID(ubyte id, ubyte *data, int len, network_address *who_to) { - ubyte packet_data[1500]; +int nw_SendWithID(uint8_t id, uint8_t *data, int len, network_address *who_to) { + uint8_t packet_data[1500]; int send_this_packet = 1; SOCKET send_sock; SOCKADDR_IN sock_addr; // UDP/TCP socket structure int ret, send_len; - ubyte iaddr[6], *send_data; + uint8_t iaddr[6], *send_data; short port; fd_set wfds; @@ -2338,7 +2338,7 @@ int nw_SendWithID(ubyte id, ubyte *data, int len, network_address *who_to) { // mprintf((0,"Sending packet for id %d.\n",id)); #ifdef WIN32 if (Use_DirectPlay) - return dp_DirectPlaySend(who_to, (ubyte *)data, len, false); + return dp_DirectPlaySend(who_to, (uint8_t *)data, len, false); #endif // mprintf((1, "network: type %d\n", who_to->connection_type)); @@ -2364,8 +2364,8 @@ int nw_SendWithID(ubyte id, ubyte *data, int len, network_address *who_to) { } /* - ubyte compdata[MAX_PACKET_SIZE*3]; - ubyte testdata[MAX_PACKET_SIZE*3]; + uint8_t compdata[MAX_PACKET_SIZE*3]; + uint8_t testdata[MAX_PACKET_SIZE*3]; int uncompsize; ////Int3(); @@ -2398,7 +2398,7 @@ int nw_SendWithID(ubyte id, ubyte *data, int len, network_address *who_to) { } send_len = len; - send_data = (ubyte *)packet_data; + send_data = (uint8_t *)packet_data; FD_ZERO(&wfds); FD_SET(send_sock, &wfds); @@ -2448,7 +2448,7 @@ int nw_DoReceiveCallbacks(void) { socklen_t read_len, from_len; network_address from_addr; - ubyte packet_data[1500]; + uint8_t packet_data[1500]; nw_ReliableResend(); @@ -2494,7 +2494,7 @@ int nw_DoReceiveCallbacks(void) { #else memcpy(from_addr.address, &ip_addr.sin_addr.s_addr, 4); #endif - ubyte packet_id = (packet_data[0] & 0x0f); + uint8_t packet_id = (packet_data[0] & 0x0f); if (Netcallbacks[packet_id]) { // mprintf((0,"Calling network callback for id %d.\n",packet_id)); int rlen = read_len - 1; @@ -2596,7 +2596,7 @@ void nw_ReliableResend(void) { } // mprintf((0,"Resending reliable packet! Sequence %d\n",send_header.seq)); - rcode = nw_SendWithID(NWT_RELIABLE, (ubyte *)&send_header, + rcode = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE + rsocket->send_len[i], &send_address); if ((rcode == SOCKET_ERROR) && (WSAEWOULDBLOCK == WSAGetLastError())) { @@ -2638,7 +2638,7 @@ void nw_ReliableResend(void) { NetStatistics.tcp_total_bytes_resent += len; } - rcode = nw_SendWithID(NWT_RELIABLE, (ubyte *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); + rcode = nw_SendWithID(NWT_RELIABLE, (uint8_t *)&send_header, RELIABLE_PACKET_HEADER_ONLY_SIZE, &send_address); if ((rcode != SOCKET_ERROR) && (WSAEWOULDBLOCK != WSAGetLastError())) { // It must have been sent diff --git a/physics/Collide.cpp b/physics/Collide.cpp index 19bc9141..1b9da9f3 100644 --- a/physics/Collide.cpp +++ b/physics/Collide.cpp @@ -865,8 +865,8 @@ #define PLAYER_ROTATION_BY_FORCE_SCALAR 0.12f #define NONPLAYER_ROTATION_BY_FORCE_SCALAR 1.0f -ubyte CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES]; -ubyte CollisionRayResult[MAX_OBJECT_TYPES]; +uint8_t CollisionResult[MAX_OBJECT_TYPES][MAX_OBJECT_TYPES]; +uint8_t CollisionRayResult[MAX_OBJECT_TYPES]; static bool IsOKToApplyForce(object *objp); static void bump_this_object(object *objp, object *other_objp, vector *force, vector *collision_pnt, int damage_flag); @@ -2458,7 +2458,7 @@ void collide_generic_and_weapon(object *robotobj, object *weapon, vector *collis bool f_reverse_normal, fvi_info *hit_info) { object *parent_obj; float damage_to_apply; - ubyte electrical = (Weapons[weapon->id].flags & WF_ELECTRICAL) ? 1 : 0; + uint8_t electrical = (Weapons[weapon->id].flags & WF_ELECTRICAL) ? 1 : 0; bool f_stick = ((weapon->mtype.phys_info.flags & PF_STICK) != 0); bool f_energy = ((Weapons[weapon->id].flags & WF_MATTER_WEAPON) == 0); int damage_type; @@ -2584,7 +2584,7 @@ void collide_player_and_weapon(object *playerobj, object *weapon, vector *collis bool f_reverse_normal, fvi_info *hit_info) { object *parent_obj; float damage_to_apply; - ubyte electrical = Weapons[weapon->id].flags & WF_ELECTRICAL ? 1 : 0; + uint8_t electrical = Weapons[weapon->id].flags & WF_ELECTRICAL ? 1 : 0; bool f_stick = ((weapon->mtype.phys_info.flags & PF_STICK) != 0); if (f_reverse_normal) @@ -2697,8 +2697,8 @@ void collide_two_objects(object *A, object *B, vector *collision_point, vector * int collision_type; int a_num = A - Objects; int b_num = B - Objects; - ubyte a_good = 0, b_good = 0; - ubyte a_hittime_good = 1, b_hittime_good = 1; + uint8_t a_good = 0, b_good = 0; + uint8_t a_hittime_good = 1, b_hittime_good = 1; // Only do omega particle collisions if specifically allowed extern bool Enable_omega_collions; @@ -2952,7 +2952,7 @@ void CollideInit() { // Returns true if the object hits the wall, and false if should keep going though the wall (for breakable glass) bool collide_object_with_wall(object *A, float hitspeed, int hitseg, int hitwall, vector *hitpt, vector *wall_normal, float hit_dot) { - ubyte do_event = 0; + uint8_t do_event = 0; bool ret = true; switch (A->type) { diff --git a/physics/FindIntersection.cpp b/physics/FindIntersection.cpp index 1473c899..2cb7a318 100644 --- a/physics/FindIntersection.cpp +++ b/physics/FindIntersection.cpp @@ -1960,7 +1960,7 @@ int fvi_QuickDistFaceList(int init_room_index, vector *pos, float rad, fvi_face_ cur_room = &Rooms[next_rooms[cur_next_room_index]]; // sort shit - ubyte msector = 0; + uint8_t msector = 0; if (min_xyz.x <= cur_room->bbf_min_xyz.x) { msector |= 0x01; @@ -1983,7 +1983,7 @@ int fvi_QuickDistFaceList(int init_room_index, vector *pos, float rad, fvi_face_ const short num_bbf_regions = cur_room->num_bbf_regions; short *num_faces_ptr = cur_room->num_bbf; - ubyte *bbf_val = cur_room->bbf_list_sector; + uint8_t *bbf_val = cur_room->bbf_list_sector; vector *region_min = cur_room->bbf_list_min_xyz; vector *region_max = cur_room->bbf_list_max_xyz; short **bbf_list_ptr = cur_room->bbf_list; @@ -2348,7 +2348,7 @@ internal_try_again: // mprintf((0, "Checking room %d ", ROOMNUM(cur_room))); // sort shit - ubyte msector = 0; + uint8_t msector = 0; if (min_xyz.x <= cur_room->bbf_min_xyz.x) { msector |= 0x01; @@ -2371,7 +2371,7 @@ internal_try_again: const short num_bbf_regions = cur_room->num_bbf_regions; short *num_faces_ptr = cur_room->num_bbf; - ubyte *bbf_val = cur_room->bbf_list_sector; + uint8_t *bbf_val = cur_room->bbf_list_sector; vector *region_min = cur_room->bbf_list_min_xyz; vector *region_max = cur_room->bbf_list_max_xyz; short **bbf_list_ptr = cur_room->bbf_list; @@ -4470,7 +4470,7 @@ int fvi_room(int room_index, int from_portal, int room_obj) { // vector col_normal[32]; int num_cols = 0; object *this_obj; - ubyte msector = 0; + uint8_t msector = 0; if (fvi_min_xyz.x <= cur_room->bbf_min_xyz.x) { msector |= 0x01; @@ -4570,7 +4570,7 @@ int fvi_room(int room_index, int from_portal, int room_obj) { } else { const short num_bbf_regions = cur_room->num_bbf_regions; short *num_faces_ptr = cur_room->num_bbf; - ubyte *bbf_val = cur_room->bbf_list_sector; + uint8_t *bbf_val = cur_room->bbf_list_sector; vector *region_min = cur_room->bbf_list_min_xyz; vector *region_max = cur_room->bbf_list_max_xyz; short **bbf_list_ptr = cur_room->bbf_list; diff --git a/physics/physics.cpp b/physics/physics.cpp index 00959a51..8772d035 100644 --- a/physics/physics.cpp +++ b/physics/physics.cpp @@ -45,8 +45,8 @@ #include "vibeinterface.h" // Global variables for physics system -ubyte Default_player_terrain_leveling = 0; -ubyte Default_player_room_leveling = 0; +uint8_t Default_player_terrain_leveling = 0; +uint8_t Default_player_room_leveling = 0; // Maximum iterations thru the simulation loop NOTE: It is assumed that the player loops >= non-player loops #define MAX_PLAYER_SIM_LOOPS 9 diff --git a/renderer/HardwareBaseGPU.cpp b/renderer/HardwareBaseGPU.cpp index f3b0ca4e..f4048d68 100644 --- a/renderer/HardwareBaseGPU.cpp +++ b/renderer/HardwareBaseGPU.cpp @@ -46,8 +46,8 @@ bool UseWBuffer = false; // General renderer states int gpu_Overlay_map = -1; -ubyte gpu_Overlay_type = OT_NONE; -ubyte Renderer_initted = 0; +uint8_t gpu_Overlay_type = OT_NONE; +uint8_t Renderer_initted = 0; // Generic GPU data rendering_state gpu_state; @@ -120,7 +120,7 @@ void rend_SetCharacterParameters(ddgr_color color1, ddgr_color color2, ddgr_colo } // Sets where the software renderer should write to -void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, ubyte *framebuffer) {} +void rend_SetSoftwareParameters(float aspect, int width, int height, int pitch, uint8_t *framebuffer) {} // Sets the state of bilinear filtering for our textures void rend_SetFiltering(int8_t state) { @@ -142,7 +142,7 @@ void rend_SetZValues(float nearz, float farz) { // a -1 value indicates no overlay map void rend_SetOverlayMap(int handle) { gpu_Overlay_map = handle; } -void rend_SetOverlayType(ubyte type) { gpu_Overlay_type = type; } +void rend_SetOverlayType(uint8_t type) { gpu_Overlay_type = type; } void rend_FillCircle(ddgr_color col, int x, int y, int rad) {} @@ -178,7 +178,7 @@ void rend_DrawFontCharacter(int bm_handle, int x1, int y1, int x2, int y2, float } // Sets the alpha value for constant alpha -void rend_SetAlphaValue(ubyte val) { +void rend_SetAlphaValue(uint8_t val) { gpu_state.cur_alpha = val; gpu_Alpha_multiplier = rend_GetAlphaMultiplier(); } @@ -290,7 +290,7 @@ void rend_DrawScaledBitmap(int x1, int y1, int x2, int y2, int bm, float u0, flo } // given a chunked bitmap, renders it. -void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, ubyte alpha) { +void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, uint8_t alpha) { int *bm_array = chunk->bm_array; int w = chunk->w; int h = chunk->h; @@ -323,7 +323,7 @@ void rend_DrawChunkedBitmap(chunked_bitmap *chunk, int x, int y, ubyte alpha) { } // given a chunked bitmap, renders it.scaled -void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, ubyte alpha) { +void rend_DrawScaledChunkedBitmap(chunked_bitmap *chunk, int x, int y, int neww, int newh, uint8_t alpha) { int *bm_array = chunk->bm_array; int w = chunk->w; int h = chunk->h; diff --git a/renderer/HardwareClipper.cpp b/renderer/HardwareClipper.cpp index ee6e607f..7302e274 100644 --- a/renderer/HardwareClipper.cpp +++ b/renderer/HardwareClipper.cpp @@ -254,7 +254,7 @@ g3Point *ClipEdge(int plane_flag, g3Point *on_pnt, g3Point *off_pnt) { } // clips a line to the viewing pyramid. -void ClipLine(g3Point **p0, g3Point **p1, ubyte codes_or) { +void ClipLine(g3Point **p0, g3Point **p1, uint8_t codes_or) { int plane_flag; g3Point *old_p1; @@ -373,7 +373,7 @@ g3Point **g3_ClipPolygon(g3Point **pointlist, int *nv, g3Codes *cc) { void g3_SetFarClipZ(float z) { Far_clip_z = z; } // Sets up a custom clipping plane - g3_StartFrame must be called before this is called -void g3_SetCustomClipPlane(ubyte state, vector *pnt, vector *normal) { +void g3_SetCustomClipPlane(uint8_t state, vector *pnt, vector *normal) { Clip_custom = state; if (state) { vector tempv; diff --git a/renderer/HardwareDraw.cpp b/renderer/HardwareDraw.cpp index b6464e45..4daa329d 100644 --- a/renderer/HardwareDraw.cpp +++ b/renderer/HardwareDraw.cpp @@ -24,7 +24,7 @@ // draws a line. takes two points. returns true if drew void g3_DrawLine(ddgr_color color, g3Point *p0, g3Point *p1) { - ubyte codes_or; + uint8_t codes_or; bool was_clipped = 0; if (p0->p3_codes & p1->p3_codes) @@ -65,7 +65,7 @@ void g3_DrawLine(ddgr_color color, g3Point *p0, g3Point *p1) { // draws a line based on the current setting of render states. takes two points. returns true if drew void g3_DrawSpecialLine(g3Point *p0, g3Point *p1) { - ubyte codes_or; + uint8_t codes_or; bool was_clipped = 0; if (p0->p3_codes & p1->p3_codes) @@ -180,7 +180,7 @@ int g3_DrawPoly(int nv, g3Point **pointlist, int bm, int map_type, g3Codes *clip //Get codes for this polygon, and copy uvls into points for( i = 0; i < nv; ++i ) { - ubyte c = pointlist[i]->p3_codes; + uint8_t c = pointlist[i]->p3_codes; cc.cc_and &= c; cc.cc_or |= c; } diff --git a/renderer/HardwareGlobalVars.cpp b/renderer/HardwareGlobalVars.cpp index 26e6b208..439cee32 100644 --- a/renderer/HardwareGlobalVars.cpp +++ b/renderer/HardwareGlobalVars.cpp @@ -25,7 +25,7 @@ float View_zoom; float Far_clip_z = FLT_MAX; // set to a really really far distance initially -ubyte Clip_custom = 0; +uint8_t Clip_custom = 0; float Clip_plane_distance = 0; vector Clip_plane; diff --git a/renderer/HardwareInternal.h b/renderer/HardwareInternal.h index fd09649e..7027eba7 100644 --- a/renderer/HardwareInternal.h +++ b/renderer/HardwareInternal.h @@ -48,7 +48,7 @@ struct PosColorUV2Vertex { void FreeTempPoint(g3Point *p); void InitFreePoints(void); -void ClipLine(g3Point **p0, g3Point **p1, ubyte codes_or); +void ClipLine(g3Point **p0, g3Point **p1, uint8_t codes_or); // Verify that all the temp points are free, and free them it they are not. #ifdef _DEBUG @@ -65,7 +65,7 @@ extern matrix View_matrix, Unscaled_matrix; extern float Far_clip_z; // For custom clipping plane -extern ubyte Clip_custom; +extern uint8_t Clip_custom; extern float Clip_plane_distance; extern vector Clip_plane; diff --git a/renderer/HardwareOpenGL.cpp b/renderer/HardwareOpenGL.cpp index 96f62986..fe529536 100644 --- a/renderer/HardwareOpenGL.cpp +++ b/renderer/HardwareOpenGL.cpp @@ -61,10 +61,10 @@ void rend_SetLightingState(light_state state); extern int gpu_Overlay_map; int Bump_map = 0; int Bumpmap_ready = 0; -extern ubyte gpu_Overlay_type; +extern uint8_t gpu_Overlay_type; float Z_bias = 0.0f; -ubyte Renderer_close_flag = 0; -extern ubyte Renderer_initted; +uint8_t Renderer_close_flag = 0; +extern uint8_t Renderer_initted; renderer_type Renderer_type = RENDERER_OPENGL; int WindowGL = 0; @@ -135,8 +135,8 @@ PFNGLMULTITEXCOORD4FARBPROC oglMultiTexCoord4f = NULL; ushort *OpenGL_bitmap_remap = NULL; ushort *OpenGL_lightmap_remap = NULL; -ubyte *OpenGL_bitmap_states = NULL; -ubyte *OpenGL_lightmap_states = NULL; +uint8_t *OpenGL_bitmap_states = NULL; +uint8_t *OpenGL_lightmap_states = NULL; uint32_t *opengl_Upload_data = NULL; uint32_t *opengl_Translate_table = NULL; @@ -285,9 +285,9 @@ int opengl_InitCache(void) { OpenGL_lightmap_remap = (ushort *)mem_malloc(MAX_LIGHTMAPS * 2); ASSERT(OpenGL_lightmap_remap); - OpenGL_bitmap_states = (ubyte *)mem_malloc(MAX_BITMAPS); + OpenGL_bitmap_states = (uint8_t *)mem_malloc(MAX_BITMAPS); ASSERT(OpenGL_bitmap_states); - OpenGL_lightmap_states = (ubyte *)mem_malloc(MAX_LIGHTMAPS); + OpenGL_lightmap_states = (uint8_t *)mem_malloc(MAX_LIGHTMAPS); ASSERT(OpenGL_lightmap_states); Cur_texture_object_num = 1; @@ -1488,7 +1488,7 @@ void opengl_ResetCache(void) { opengl_InitCache(); } -ubyte opengl_Framebuffer_ready = 0; +uint8_t opengl_Framebuffer_ready = 0; chunked_bitmap opengl_Chunked_bitmap; void opengl_ChangeChunkedBitmap(int bm_handle, chunked_bitmap *chunk) { diff --git a/renderer/HardwarePoints.cpp b/renderer/HardwarePoints.cpp index eba5a21a..6acf4919 100644 --- a/renderer/HardwarePoints.cpp +++ b/renderer/HardwarePoints.cpp @@ -22,8 +22,8 @@ extern vector Clip_plane_point; // code a point. fills in the p3_codes field of the point, and returns the codes -ubyte g3_CodePoint(g3Point *p) { - ubyte cc = 0; +uint8_t g3_CodePoint(g3Point *p) { + uint8_t cc = 0; if (p->p3_x > p->p3_z) cc |= CC_OFF_RIGHT; @@ -60,7 +60,7 @@ ubyte g3_CodePoint(g3Point *p) { } // rotates a point. returns codes. does not check if already rotated -ubyte g3_RotatePoint(g3Point *dest, vector *src) { +uint8_t g3_RotatePoint(g3Point *dest, vector *src) { // store the pre-rotated point dest->p3_vecPreRot = *src; @@ -133,7 +133,7 @@ vector *g3_RotateDeltaVec(vector *dest, vector *src) { return dest; } -ubyte g3_AddDeltaVec(g3Point *dest, g3Point *src, vector *deltav) { +uint8_t g3_AddDeltaVec(g3Point *dest, g3Point *src, vector *deltav) { dest->p3_vec = src->p3_vec + *deltav; dest->p3_flags = 0; // not projected diff --git a/scripts/AIGame.cpp b/scripts/AIGame.cpp index 90561b5e..ecaf25e5 100644 --- a/scripts/AIGame.cpp +++ b/scripts/AIGame.cpp @@ -33,11 +33,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -202,11 +202,11 @@ const char *GetStringFromTable(int index) { #define TXT_GB_I_FOUND_A_GB_POWERUP TXT(145) // Returns the new child's handle -static int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, +static int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned = true, bool f_set_parent = false); // Returns the new child's handle -int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, bool f_aligned, +int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned, bool f_set_parent) { int child_handle = OBJECT_HANDLE_NONE; int child_id = Obj_FindID(child_name); @@ -2459,7 +2459,7 @@ public: // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) { osicommon_Initialize((tOSIRISModuleInit *)func_list); @@ -2477,7 +2477,7 @@ char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) { void STDCALL ShutdownDLL(void) {} -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { for (int i = 0; i < NUM_IDS; i++) { if (!stricmp(name, ScriptInfo[i].name)) { return ScriptInfo[i].id; diff --git a/scripts/AIGame3.cpp b/scripts/AIGame3.cpp index ab1784f0..62607b88 100644 --- a/scripts/AIGame3.cpp +++ b/scripts/AIGame3.cpp @@ -36,11 +36,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -62,10 +62,10 @@ const char *GetStringFromTable(int index) { // Function prototypes //------------------- -static int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, ubyte isreal, - float lifetime, float interval, float longevity, float size, float speed, ubyte random); +static int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_t isreal, + float lifetime, float interval, float longevity, float size, float speed, uint8_t random); // Returns the new child's handle -static int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, +static int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned = true, bool f_set_parent = false); static int FindClosestPlayer(int objhandle); @@ -259,8 +259,8 @@ void AI_SafeSetType(int obj_handle, int ai_type) { // Miscellaneous Utility Funcs // ============================ -int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, ubyte isreal, - float lifetime, float interval, float longevity, float size, float speed, ubyte random) { +int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_t isreal, + float lifetime, float interval, float longevity, float size, float speed, uint8_t random) { msafe_struct mstruct; mstruct.objhandle = objref; @@ -283,7 +283,7 @@ int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag } // Returns the new child's handle -int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, bool f_aligned, +int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned, bool f_set_parent) { int child_handle = OBJECT_HANDLE_NONE; int child_id = Obj_FindID(child_name); @@ -1528,7 +1528,7 @@ void STDCALL ShutdownDLL(void) {} // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { for (int i = 0; i < NUM_IDS; i++) { if (!stricmp(name, ScriptInfo[i].name)) { return ScriptInfo[i].id; @@ -1627,7 +1627,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } //============================================ // Script Implementation diff --git a/scripts/BatteriesIncluded.cpp b/scripts/BatteriesIncluded.cpp index 4e53f09a..4a76310c 100644 --- a/scripts/BatteriesIncluded.cpp +++ b/scripts/BatteriesIncluded.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -827,7 +827,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1135,7 +1135,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/BossCamera.cpp b/scripts/BossCamera.cpp index 688fbf6d..852cf5b6 100644 --- a/scripts/BossCamera.cpp +++ b/scripts/BossCamera.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -430,7 +430,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -486,7 +486,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/CanyonsCTF.cpp b/scripts/CanyonsCTF.cpp index 3b75b046..348aa476 100644 --- a/scripts/CanyonsCTF.cpp +++ b/scripts/CanyonsCTF.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -421,7 +421,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -469,7 +469,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/CellTestLevel.cpp b/scripts/CellTestLevel.cpp index de9f9fdd..51ea4530 100644 --- a/scripts/CellTestLevel.cpp +++ b/scripts/CellTestLevel.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -423,7 +423,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -471,7 +471,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/ChrisTest.cpp b/scripts/ChrisTest.cpp index 3f2f4359..8b64217f 100644 --- a/scripts/ChrisTest.cpp +++ b/scripts/ChrisTest.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -448,7 +448,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -504,7 +504,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/DallasFuncs.cpp b/scripts/DallasFuncs.cpp index 06c6a935..4d52fd12 100644 --- a/scripts/DallasFuncs.cpp +++ b/scripts/DallasFuncs.cpp @@ -1285,7 +1285,7 @@ void aShowColoredHUDMessage(int red, int green, int blue, const char *format, .. mstruct.message[sizeof(mstruct.message) - 1] = 0; // if message too long, vsnprintf() won't terminate mstruct.state = 0; // means all players - mstruct.color = GR_RGB((ubyte)red, (ubyte)green, (ubyte)blue); + mstruct.color = GR_RGB((uint8_t)red, (uint8_t)green, (uint8_t)blue); MSafe_CallFunction(MSAFE_MISC_HUD_MESSAGE, &mstruct); } @@ -1317,7 +1317,7 @@ void aShowColoredHUDMessageObj(int red, int green, int blue, const char *format, mstruct.state = 1; mstruct.objhandle = dfGetPlayer(objhandle); - mstruct.color = GR_RGB((ubyte)red, (ubyte)green, (ubyte)blue); + mstruct.color = GR_RGB((uint8_t)red, (uint8_t)green, (uint8_t)blue); MSafe_CallFunction(MSAFE_MISC_HUD_MESSAGE, &mstruct); } @@ -2209,8 +2209,8 @@ void aRoomSetLightingPulse(int roomnum, float time, float offset) { msafe_struct mstruct; mstruct.roomnum = roomnum; - mstruct.pulse_time = (ubyte)(time * 100); - mstruct.pulse_offset = (ubyte)(offset * 100); + mstruct.pulse_time = (uint8_t)(time * 100); + mstruct.pulse_offset = (uint8_t)(offset * 100); MSafe_CallFunction(MSAFE_ROOM_LIGHT_PULSE, &mstruct); } @@ -2256,8 +2256,8 @@ speed of each blob spew Randomize: if set than BlobSize, BlobSpeed and BlobLifet for each blob SpewHandle: Where to store the handle for this spewer $$END */ -void aTurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, ubyte isreal, - float lifetime, float interval, float longevity, float size, float speed, ubyte random, +void aTurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_t isreal, + float lifetime, float interval, float longevity, float size, float speed, uint8_t random, int handle_slot) { msafe_struct mstruct; diff --git a/scripts/Geodomes.cpp b/scripts/Geodomes.cpp index 24611f2a..0a12a8d7 100644 --- a/scripts/Geodomes.cpp +++ b/scripts/Geodomes.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -474,7 +474,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -551,7 +551,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/HalfPipe.cpp b/scripts/HalfPipe.cpp index ac6e9133..5c751d82 100644 --- a/scripts/HalfPipe.cpp +++ b/scripts/HalfPipe.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -470,7 +470,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -547,7 +547,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/InfernalBolt.cpp b/scripts/InfernalBolt.cpp index 8f434831..66581996 100644 --- a/scripts/InfernalBolt.cpp +++ b/scripts/InfernalBolt.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -480,7 +480,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -543,7 +543,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Inversion.cpp b/scripts/Inversion.cpp index b8e602e0..982d89cd 100644 --- a/scripts/Inversion.cpp +++ b/scripts/Inversion.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -714,7 +714,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -903,7 +903,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/LEVEL0.cpp b/scripts/LEVEL0.cpp index d316543c..81e7a2c3 100644 --- a/scripts/LEVEL0.cpp +++ b/scripts/LEVEL0.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -720,7 +720,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -923,7 +923,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/LEVEL15.cpp b/scripts/LEVEL15.cpp index 1f4037f9..b0f981d8 100644 --- a/scripts/LEVEL15.cpp +++ b/scripts/LEVEL15.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1839,7 +1839,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2280,7 +2280,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Level12.cpp b/scripts/Level12.cpp index 8ccb16d1..2817bdcf 100644 --- a/scripts/Level12.cpp +++ b/scripts/Level12.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -2062,7 +2062,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2902,7 +2902,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Level16.cpp b/scripts/Level16.cpp index 946eab36..e0700e78 100644 --- a/scripts/Level16.cpp +++ b/scripts/Level16.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -523,7 +523,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -614,7 +614,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Level6.cpp b/scripts/Level6.cpp index d1939cbc..3e6356da 100644 --- a/scripts/Level6.cpp +++ b/scripts/Level6.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1777,7 +1777,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2218,7 +2218,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Level9.cpp b/scripts/Level9.cpp index 28fb665e..76370393 100644 --- a/scripts/Level9.cpp +++ b/scripts/Level9.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1110,7 +1110,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1467,7 +1467,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/LevelS1.cpp b/scripts/LevelS1.cpp index 0f047519..27e6c45f 100644 --- a/scripts/LevelS1.cpp +++ b/scripts/LevelS1.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -554,7 +554,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -652,7 +652,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc02.cpp b/scripts/Merc02.cpp index 9474248c..2ee7350f 100644 --- a/scripts/Merc02.cpp +++ b/scripts/Merc02.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1775,7 +1775,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2258,7 +2258,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc1.cpp b/scripts/Merc1.cpp index 68602cac..916736ed 100644 --- a/scripts/Merc1.cpp +++ b/scripts/Merc1.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -2335,7 +2335,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -3168,7 +3168,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc3.cpp b/scripts/Merc3.cpp index 9e0f7bba..eaa36aa9 100644 --- a/scripts/Merc3.cpp +++ b/scripts/Merc3.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -3070,7 +3070,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -3910,7 +3910,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc4.cpp b/scripts/Merc4.cpp index 83a57ef1..d8065f1a 100644 --- a/scripts/Merc4.cpp +++ b/scripts/Merc4.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1425,7 +1425,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1733,7 +1733,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc6.cpp b/scripts/Merc6.cpp index 984838e8..c651ff85 100644 --- a/scripts/Merc6.cpp +++ b/scripts/Merc6.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1406,7 +1406,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1791,7 +1791,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Merc7.cpp b/scripts/Merc7.cpp index ebcd4ec3..0e950d8e 100644 --- a/scripts/Merc7.cpp +++ b/scripts/Merc7.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1169,7 +1169,7 @@ void aEmitSparks(float num_sparks, int objhandle) { #define SPECIAL_TIMER_MAX 256 #define SPECIAL_TIMER_ID_LIMIT (SPECIAL_TIMER_ID_BASE + SPECIAL_TIMER_MAX * SPECIAL_TIMER_CLASSES - 1) -inline int LEVEL_TIMER_UID(ubyte timer_class, ubyte index) { +inline int LEVEL_TIMER_UID(uint8_t timer_class, uint8_t index) { return (SPECIAL_TIMER_ID_BASE + (timer_class % SPECIAL_TIMER_CLASSES) * SPECIAL_TIMER_MAX + index); } @@ -1189,7 +1189,7 @@ Parameters: $$END */ -static ubyte ff_index = 0; +static uint8_t ff_index = 0; static struct t_ff_enable_data { short room_number; short portal_num; @@ -1225,7 +1225,7 @@ Parameters: $$END */ -static ubyte wind_fx_index = 0; +static uint8_t wind_fx_index = 0; static struct t_wind_fx_data { int room_number; float x, y, z; @@ -1312,11 +1312,11 @@ void cExecTimerEvent(int timerid) { #define GOAL_PRIORITY_HIGH 3 #define GOAL_PRIORITY_LOW 0 -inline int LEVEL_GOAL_UID(ubyte goal_class, ubyte index) { +inline int LEVEL_GOAL_UID(uint8_t goal_class, uint8_t index) { return (SPECIAL_TIMER_ID_BASE + (goal_class % SPECIAL_GOAL_CLASSES) * SPECIAL_GOAL_MAX + index); } -static ubyte DC_Goal_Index = 0; +static uint8_t DC_Goal_Index = 0; #define DC_N_DROIDS 32 #define DC_EXIT_GOAL 0 @@ -2516,7 +2516,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -3146,7 +3146,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Mysterious_Isle.cpp b/scripts/Mysterious_Isle.cpp index c9bd2926..3a91b902 100644 --- a/scripts/Mysterious_Isle.cpp +++ b/scripts/Mysterious_Isle.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -661,7 +661,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -787,7 +787,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Paranoia.cpp b/scripts/Paranoia.cpp index 370aa8f9..b4e9cf61 100644 --- a/scripts/Paranoia.cpp +++ b/scripts/Paranoia.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -377,7 +377,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -425,7 +425,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/PiccuStation.cpp b/scripts/PiccuStation.cpp index 5d64b1c3..e858cd14 100644 --- a/scripts/PiccuStation.cpp +++ b/scripts/PiccuStation.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1377,7 +1377,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1944,7 +1944,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Polaris.cpp b/scripts/Polaris.cpp index 09b6c1ec..d0e23b8e 100644 --- a/scripts/Polaris.cpp +++ b/scripts/Polaris.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -481,7 +481,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -565,7 +565,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Quadsomniac.cpp b/scripts/Quadsomniac.cpp index b463a964..67597039 100644 --- a/scripts/Quadsomniac.cpp +++ b/scripts/Quadsomniac.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -511,7 +511,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -616,7 +616,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/RudeAwakening.cpp b/scripts/RudeAwakening.cpp index ddcd8926..917e2da7 100644 --- a/scripts/RudeAwakening.cpp +++ b/scripts/RudeAwakening.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -512,7 +512,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -617,7 +617,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/SewerRat.cpp b/scripts/SewerRat.cpp index 82a8e100..78f787bf 100644 --- a/scripts/SewerRat.cpp +++ b/scripts/SewerRat.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -436,7 +436,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -484,7 +484,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/TrainingMission.cpp b/scripts/TrainingMission.cpp index 0af54ecc..17ffb38a 100644 --- a/scripts/TrainingMission.cpp +++ b/scripts/TrainingMission.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1005,7 +1005,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1257,7 +1257,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/Y2K.cpp b/scripts/Y2K.cpp index 8e33f9eb..10b6a0b6 100644 --- a/scripts/Y2K.cpp +++ b/scripts/Y2K.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -441,7 +441,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -489,7 +489,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/aigame2.cpp b/scripts/aigame2.cpp index e4596b2c..1ad42936 100644 --- a/scripts/aigame2.cpp +++ b/scripts/aigame2.cpp @@ -33,11 +33,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -192,7 +192,7 @@ private: float timer; float eye_timer; int8_t state; - ubyte melee_flags; + uint8_t melee_flags; short energy; short hits; int eye_obj; @@ -289,7 +289,7 @@ void STDCALL ShutdownDLL(void) {} // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { int i; for (i = 0; i < NUM_IDS; i++) { if (strcmp(name, Script_names[i]) == 0) { @@ -374,21 +374,21 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } -static int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, +static int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned = true, bool f_set_parent = false); static void FlushGoal(int me_handle, int goal_priority); static void SafeGoalClearAll(int obj_handle); static void AI_SafeSetType(int obj_handle, int ai_type); -static int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, ubyte isreal, - float lifetime, float interval, float longevity, float size, float speed, ubyte random); +static int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_t isreal, + float lifetime, float interval, float longevity, float size, float speed, uint8_t random); ////////////////////////////////////////////////////////////////////////////// // HELPER FUNCTIONS // Returns the new child's handle -int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, bool f_aligned, +int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned, bool f_set_parent) { int child_handle = OBJECT_HANDLE_NONE; int child_id = Obj_FindID(child_name); @@ -546,8 +546,8 @@ void AI_SafeSetType(int obj_handle, int ai_type) { } } -int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, ubyte isreal, - float lifetime, float interval, float longevity, float size, float speed, ubyte random) { +int TurnOnSpew(int objref, int gunpoint, int effect_type, float mass, float drag, int gravity_type, uint8_t isreal, + float lifetime, float interval, float longevity, float size, float speed, uint8_t random) { msafe_struct mstruct; mstruct.objhandle = objref; @@ -1228,7 +1228,7 @@ void aiCreeper::OnInit(int me_handle) { memory->hits = 50; AI_Value(me_handle, VF_GET, AIV_I_FLAGS, &flags); - memory->melee_flags = (ubyte)(flags & (AIF_MELEE1 | AIF_MELEE2)); + memory->melee_flags = (uint8_t)(flags & (AIF_MELEE1 | AIF_MELEE2)); // set initial state of creeper set_state(me_handle, STATE_IDLE); diff --git a/scripts/aigame4.cpp b/scripts/aigame4.cpp index e0a2dd90..8eb9f1d1 100644 --- a/scripts/aigame4.cpp +++ b/scripts/aigame4.cpp @@ -33,11 +33,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -57,7 +57,7 @@ const char *GetStringFromTable(int index) { static void PortalBreakGlass(int portalnum, int roomnum); // Returns the new child's handle -static int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, +static int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned = true, bool f_set_parent = false); static float Obj_GetObjDist(int me, int it, bool f_sub_rads); @@ -71,7 +71,7 @@ void PortalBreakGlass(int portalnum, int roomnum) { } // Returns the new child's handle -int CreateAndAttach(int me, const char *child_name, ubyte child_type, char parent_ap, char child_ap, bool f_aligned, +int CreateAndAttach(int me, const char *child_name, uint8_t child_type, char parent_ap, char child_ap, bool f_aligned, bool f_set_parent) { int child_handle = OBJECT_HANDLE_NONE; int child_id = Obj_FindID(child_name); @@ -291,7 +291,7 @@ public: // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) { osicommon_Initialize((tOSIRISModuleInit *)func_list); @@ -309,7 +309,7 @@ char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) { void STDCALL ShutdownDLL(void) {} -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { for (int i = 0; i < NUM_IDS; i++) { if (!stricmp(name, ScriptInfo[i].name)) { return ScriptInfo[i].id; diff --git a/scripts/barney.cpp b/scripts/barney.cpp index 0e9ec6ef..03d11e62 100644 --- a/scripts/barney.cpp +++ b/scripts/barney.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -399,7 +399,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -447,7 +447,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/clutter.cpp b/scripts/clutter.cpp index 9f273c94..f28f88a5 100644 --- a/scripts/clutter.cpp +++ b/scripts/clutter.cpp @@ -32,11 +32,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -171,7 +171,7 @@ void STDCALL ShutdownDLL(void) {} // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { if (!isdoor) { for (int i = 0; i < NumScriptIDs; i++) { if (!stricmp(name, ScriptIDs[i].name)) @@ -272,7 +272,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } int GetObjectType(int object) { msafe_struct ms; diff --git a/scripts/generic.cpp b/scripts/generic.cpp index 77add881..7ca7e383 100644 --- a/scripts/generic.cpp +++ b/scripts/generic.cpp @@ -32,11 +32,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -123,7 +123,7 @@ tPlayerTimerInfo RapidFirePlayerTimers[MAX_PLAYERS]; typedef struct { int collided_object; - ubyte collided_pnum; + uint8_t collided_pnum; } rapidfirememory; class RapidFireScript : public GenericScript { @@ -183,7 +183,7 @@ void STDCALL ShutdownDLL(void) {} // or OBJ_ROBOT), therefore, a 1 is passed in for isdoor if the given object name refers to a // door, else it is a 0. The return value is the unique identifier, else -1 if the script // does not exist in the DLL. -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { if (!isdoor) { for (int i = 0; i < NUM_IDS; i++) { if (!stricmp(ScriptIDInfo[i].name, name)) @@ -284,7 +284,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. #define VERSION 0x01 -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { int size = 0; int i; diff --git a/scripts/level1.cpp b/scripts/level1.cpp index 87094a4f..10f3a35b 100644 --- a/scripts/level1.cpp +++ b/scripts/level1.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -777,7 +777,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -994,7 +994,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level10.cpp b/scripts/level10.cpp index d89ecd57..7976a2f1 100644 --- a/scripts/level10.cpp +++ b/scripts/level10.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1765,7 +1765,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2395,7 +2395,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level11.cpp b/scripts/level11.cpp index 882fe329..843ca5d8 100644 --- a/scripts/level11.cpp +++ b/scripts/level11.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -2156,7 +2156,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -3241,7 +3241,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level13.cpp b/scripts/level13.cpp index 54446a8f..9d01b3de 100644 --- a/scripts/level13.cpp +++ b/scripts/level13.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1751,7 +1751,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2542,7 +2542,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level14.cpp b/scripts/level14.cpp index 65b95e3a..a4c23ab3 100644 --- a/scripts/level14.cpp +++ b/scripts/level14.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1299,7 +1299,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1670,7 +1670,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level17.cpp b/scripts/level17.cpp index 1cc8b444..2d39e333 100644 --- a/scripts/level17.cpp +++ b/scripts/level17.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1920,7 +1920,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2893,7 +2893,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level2.cpp b/scripts/level2.cpp index ee4319b3..9627ca9e 100644 --- a/scripts/level2.cpp +++ b/scripts/level2.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1501,7 +1501,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2012,7 +2012,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level3.cpp b/scripts/level3.cpp index cf415c55..31889a11 100644 --- a/scripts/level3.cpp +++ b/scripts/level3.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1354,7 +1354,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1844,7 +1844,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level4.cpp b/scripts/level4.cpp index 22581d58..15ccd236 100644 --- a/scripts/level4.cpp +++ b/scripts/level4.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -762,7 +762,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -909,7 +909,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level5.cpp b/scripts/level5.cpp index a6bfa04e..0c997c11 100644 --- a/scripts/level5.cpp +++ b/scripts/level5.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1079,7 +1079,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1352,7 +1352,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level7.cpp b/scripts/level7.cpp index 4c1d40a0..02d8dbe5 100644 --- a/scripts/level7.cpp +++ b/scripts/level7.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1229,7 +1229,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1733,7 +1733,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/level8.cpp b/scripts/level8.cpp index 9844a471..df1ebb78 100644 --- a/scripts/level8.cpp +++ b/scripts/level8.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1303,7 +1303,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1779,7 +1779,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/levelS2.cpp b/scripts/levelS2.cpp index 6bfe09fb..7929bef2 100644 --- a/scripts/levelS2.cpp +++ b/scripts/levelS2.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -1955,7 +1955,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -2935,7 +2935,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/lnx/osiris_common.h b/scripts/lnx/osiris_common.h index f048bd44..8eb36550 100644 --- a/scripts/lnx/osiris_common.h +++ b/scripts/lnx/osiris_common.h @@ -927,7 +927,7 @@ typedef int OMMSHANDLE; #endif // define unsigned types; -typedef uint8_t ubyte; +typedef uint8_t uint8_t; typedef int8_t int8_t; typedef uint16_t ushort; typedef uint32_t uint32_t; @@ -1020,7 +1020,7 @@ typedef struct { } tOSIRISEVTCREATED; // struct for EVT_CREATED data typedef struct { - ubyte is_dying; // if this is !=0 than the event is coming because it is + uint8_t is_dying; // if this is !=0 than the event is coming because it is // really being destroyed. Else it is due to the level ending. } tOSIRISEVTDESTROY; // struct for EVT_DESTROY data @@ -1072,7 +1072,7 @@ typedef struct { typedef struct { int handle; - ubyte detonated; + uint8_t detonated; } tOSIRISEVTTIMERCANCEL; // struct for EVT_TIMERCANCEL data typedef struct { @@ -1210,7 +1210,7 @@ typedef struct { #define KOI_ID 0 // this item is specifying a type/id of object NOT to kill #define KOI_HANDLE 1 // this item is specifying an object handle of an object NOT to kill typedef struct { - ubyte info_type; + uint8_t info_type; int id; int objhandle; } tKillObjectItem; @@ -1225,8 +1225,8 @@ typedef struct { short portalnum; float fog_r, fog_g, fog_b, fog_depth; vector wind; - ubyte pulse_time; - ubyte pulse_offset; + uint8_t pulse_time; + uint8_t pulse_offset; // Objects/Players uint32_t objhandle; @@ -1239,12 +1239,12 @@ typedef struct { uint32_t checksum; int path_id; float amount; - ubyte damage_type; + uint8_t damage_type; uint32_t killer_handle; float ammo; - ubyte playsound; - ubyte remove; - ubyte do_powerup; + uint8_t playsound; + uint8_t remove; + uint8_t do_powerup; vector velocity; vector rot_velocity; float rot_drag; @@ -1259,12 +1259,12 @@ typedef struct { float anim_frame; // Spew - ubyte is_real; - ubyte random; - ubyte unused2; // was use_gunpoint + uint8_t is_real; + uint8_t random; + uint8_t unused2; // was use_gunpoint int8_t gunpoint; - ubyte effect_type; - ubyte phys_info; + uint8_t effect_type; + uint8_t phys_info; float drag, mass; // Unused @@ -1274,7 +1274,7 @@ typedef struct { int randval; // Triggers - ubyte trigger_num; + uint8_t trigger_num; // sounds int sound_handle; @@ -1284,7 +1284,7 @@ typedef struct { int index; float scalar; float interval; - ubyte state; + uint8_t state; int8_t slot; char message[MSAFE_MESSAGE_LENGTH]; char name[MSAFE_NAME_LENGTH]; diff --git a/scripts/lnx/osiris_import.h b/scripts/lnx/osiris_import.h index 69c66b32..a9969de3 100644 --- a/scripts/lnx/osiris_import.h +++ b/scripts/lnx/osiris_import.h @@ -90,9 +90,9 @@ OSIRISEXTERN Obj_GetGroundPos_fp Obj_GetGroundPos; typedef void (*Room_Value_fp)(int roomnum, char op, char vhandle, void *ptr, int index = 0); OSIRISEXTERN Room_Value_fp Room_Value; -// ubyte Room_IsValid(int roomnum); +// uint8_t Room_IsValid(int roomnum); // returns 0 if the room is not valid. 1 if the room is a terrain cell. 2 if the room is a room segment -typedef ubyte (*Room_IsValid_fp)(int roomnum); +typedef uint8_t (*Room_IsValid_fp)(int roomnum); OSIRISEXTERN Room_IsValid_fp Room_IsValid; // int Obj_GetAttachParent(int childhandle); @@ -110,10 +110,10 @@ OSIRISEXTERN Obj_GetNumAttachSlots_fp Obj_GetNumAttachSlots; typedef int (*Obj_GetAttachChildHandle_fp)(int objhandle, char attachpoint); OSIRISEXTERN Obj_GetAttachChildHandle_fp Obj_GetAttachChildHandle; -// int Obj_AttachObjectAP(int parenthandle,char parent_ap,int childhandle,char child_ap,ubyte f_use_aligned); +// int Obj_AttachObjectAP(int parenthandle,char parent_ap,int childhandle,char child_ap,uint8_t f_use_aligned); // Attaches one object to another object based on their attach points typedef int (*Obj_AttachObjectAP_fp)(int parenthandle, char parent_ap, int childhandle, char child_ap, - ubyte f_use_aligned); + uint8_t f_use_aligned); OSIRISEXTERN Obj_AttachObjectAP_fp Obj_AttachObjectAP; // int Obj_AttachObjectRad(int parenthandle,char parent_ap,int childhandle,float percent_rad); @@ -151,8 +151,8 @@ OSIRISEXTERN AI_GetPathID_fp AI_GetPathID; typedef int (*AI_GoalFollowPathSimple_fp)(int objhandle, int path_id, int guid, int flags, int slot = 3); OSIRISEXTERN AI_GoalFollowPathSimple_fp AI_GoalFollowPathSimple; -// int AI_PowerSwitch(int objhandle,ubyte f_power_on); -typedef int (*AI_PowerSwitch_fp)(int objhandle, ubyte f_power_on); +// int AI_PowerSwitch(int objhandle,uint8_t f_power_on); +typedef int (*AI_PowerSwitch_fp)(int objhandle, uint8_t f_power_on); OSIRISEXTERN AI_PowerSwitch_fp AI_PowerSwitch; // void AI_Value(int objhandle, char op, char vtype, void *ptr); @@ -167,8 +167,8 @@ OSIRISEXTERN Obj_Value_fp Obj_Value; typedef void (*Matcen_Value_fp)(int matcen_handle, char op, char vtype, void *ptr, int prod_index = 0); OSIRISEXTERN Matcen_Value_fp Matcen_Value; -// ubyte AI_TurnTowardsVectors(int objhandle,vector *fvec,vector *uvec); -typedef ubyte (*AI_TurnTowardsVectors_fp)(int objhandle, vector *fvec, vector *uvec); +// uint8_t AI_TurnTowardsVectors(int objhandle,vector *fvec,vector *uvec); +typedef uint8_t (*AI_TurnTowardsVectors_fp)(int objhandle, vector *fvec, vector *uvec); OSIRISEXTERN AI_TurnTowardsVectors_fp AI_TurnTowardsVectors; // void AI_SetType(int objhandle,int type); @@ -209,21 +209,21 @@ OSIRISEXTERN AI_FindEnergyCenter_fp AI_FindEnergyCenter; typedef float (*AI_GetDistToObj_fp)(int objhandle, int otherobjhandle); OSIRISEXTERN AI_GetDistToObj_fp AI_GetDistToObj; -// int AI_SetGoalFlags(int objhandle,int goal_handle,int flags,ubyte f_enable); -typedef int (*AI_SetGoalFlags_fp)(int objhandle, int goal_handle, int flags, ubyte f_enable); +// int AI_SetGoalFlags(int objhandle,int goal_handle,int flags,uint8_t f_enable); +typedef int (*AI_SetGoalFlags_fp)(int objhandle, int goal_handle, int flags, uint8_t f_enable); OSIRISEXTERN AI_SetGoalFlags_fp AI_SetGoalFlags; // void AI_SetGoalCircleDist(int objhandle,int goal_handle,float dist); typedef void (*AI_SetGoalCircleDist_fp)(int objhandle, int goal_handle, float dist); OSIRISEXTERN AI_SetGoalCircleDist_fp AI_SetGoalCircleDist; -// int File_ReadBytes(ubyte *buffer, int count, void *fileptr); +// int File_ReadBytes(uint8_t *buffer, int count, void *fileptr); // Reads the specified number of bytes from a file into the buffer // DO NOT USE THIS TO READ STRUCTURES. This function is for byte // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -typedef int (*File_ReadBytes_fp)(ubyte *buffer, int count, void *fileptr); +typedef int (*File_ReadBytes_fp)(uint8_t *buffer, int count, void *fileptr); OSIRISEXTERN File_ReadBytes_fp File_ReadBytes; // int File_ReadInt(void *fileptr); @@ -275,13 +275,13 @@ OSIRISEXTERN File_ReadDouble_fp File_ReadDouble; typedef int (*File_ReadString_fp)(char *buf, size_t n, void *fileptr); OSIRISEXTERN File_ReadString_fp File_ReadString; -// int File_WriteBytes(const ubyte *buf,int count,void *fileptr); +// int File_WriteBytes(const uint8_t *buf,int count,void *fileptr); // Writes the specified number of bytes from a file into the buffer // DO NOT USE THIS TO WRITE STRUCTURES. This function is for byte // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -typedef int (*File_WriteBytes_fp)(const ubyte *buf, int count, void *fileptr); +typedef int (*File_WriteBytes_fp)(const uint8_t *buf, int count, void *fileptr); OSIRISEXTERN File_WriteBytes_fp File_WriteBytes; // int File_WriteString(const char *buf,void *fileptr); @@ -356,8 +356,8 @@ OSIRISEXTERN Scrpt_CreateTimer_fp Scrpt_CreateTimer; typedef void (*MSafe_DoPowerup_fp)(msafe_struct *mstruct); OSIRISEXTERN MSafe_DoPowerup_fp MSafe_DoPowerup; -// int Obj_Create()(ubyte type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle) -typedef int (*Obj_Create_fp)(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, +// int Obj_Create()(uint8_t type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle) +typedef int (*Obj_Create_fp)(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, int parent_handle = OBJECT_HANDLE_NONE, vector *initial_velocity = NULL); OSIRISEXTERN Obj_Create_fp Obj_Create; @@ -373,8 +373,8 @@ OSIRISEXTERN Game_GetFrameTime_fp Game_GetFrameTime; typedef void (*Obj_WBValue_fp)(int obj_handle, char wb_index, char op, char vtype, void *ptr, char g_index = 0); OSIRISEXTERN Obj_WBValue_fp Obj_WBValue; -// ubyte Scrpt_TimerExists(int handle); -typedef ubyte (*Scrpt_TimerExists_fp)(int handle); +// uint8_t Scrpt_TimerExists(int handle); +typedef uint8_t (*Scrpt_TimerExists_fp)(int handle); OSIRISEXTERN Scrpt_TimerExists_fp Scrpt_TimerExists; typedef void (*Matcen_Reset_fp)(int handle); @@ -389,10 +389,10 @@ OSIRISEXTERN Matcen_Create_fp Matcen_Create; typedef int (*Matcen_FindID_fp)(char *str); OSIRISEXTERN Matcen_FindID_fp Matcen_FindID; -// void Msn_FlagSet(int flag,ubyte value); +// void Msn_FlagSet(int flag,uint8_t value); // Sets/Clears mission flags. flag is which mission flag to set/clear (1-32) // value is 0 to clear, or 1 to set -typedef void (*Msn_FlagSet_fp)(int flag, ubyte value); +typedef void (*Msn_FlagSet_fp)(int flag, uint8_t value); OSIRISEXTERN Msn_FlagSet_fp Msn_FlagSet; // int Msn_FlagGet(int flag); @@ -432,7 +432,7 @@ typedef int (*File_Tell_fp)(void *fileptr); OSIRISEXTERN File_Tell_fp File_Tell; // returns 1 if the file is at the EOF, else 0 (like feof()) -typedef ubyte (*File_eof_fp)(void *fileptr); +typedef uint8_t (*File_eof_fp)(void *fileptr); OSIRISEXTERN File_eof_fp File_eof; typedef void (*Sound_Stop_fp)(int s_handle, bool f_immediately = false); @@ -507,7 +507,7 @@ OSIRISEXTERN OMMS_Find_fp OMMS_Find; // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in; // Pass NULL in for those parameters you don't need information about. typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count, - ubyte *has_free_been_called); + uint8_t *has_free_been_called); OSIRISEXTERN OMMS_GetInfo_fp OMMS_GetInfo; // Starts an in-game cinematic sequence. text_string is the text to be displayed diff --git a/scripts/merc5.cpp b/scripts/merc5.cpp index 000cf081..6dbe6854 100644 --- a/scripts/merc5.cpp +++ b/scripts/merc5.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -921,7 +921,7 @@ Parameters: $$END */ -static ubyte breaking_glass_index = 0; +static uint8_t breaking_glass_index = 0; static struct t_breaking_glass_data { short room_number; short portal_num; @@ -932,7 +932,7 @@ static struct t_breaking_glass_data { #define SPECIAL_TIMER_MAX 256 #define SPECIAL_TIMER_ID_LIMIT (SPECIAL_TIMER_ID_BASE + SPECIAL_TIMER_MAX * SPECIAL_TIMER_CLASSES - 1) -inline int LEVEL_TIMER_UID(ubyte timer_class, ubyte index) { +inline int LEVEL_TIMER_UID(uint8_t timer_class, uint8_t index) { return (SPECIAL_TIMER_ID_BASE + (timer_class % SPECIAL_TIMER_CLASSES) * SPECIAL_TIMER_MAX + index); } @@ -1513,7 +1513,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -1884,7 +1884,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/myPowerHouse.cpp b/scripts/myPowerHouse.cpp index 5b77bc03..52d3bf6d 100644 --- a/scripts/myPowerHouse.cpp +++ b/scripts/myPowerHouse.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -430,7 +430,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -486,7 +486,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/orbital.cpp b/scripts/orbital.cpp index 4911d250..6f09729e 100644 --- a/scripts/orbital.cpp +++ b/scripts/orbital.cpp @@ -37,13 +37,13 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte is_door); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t is_door); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); DLLEXPORT int STDCALL GetTriggerScriptID(int trigger_room, int trigger_face); DLLEXPORT int STDCALL GetCOScriptList(int **list, int **id_list); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -634,7 +634,7 @@ void STDCALL ShutdownDLL(void) { ClearMessageList(); } // =============== // GetGOScriptID() // =============== -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { return -1; } +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { return -1; } // ================ // CreateInstance() @@ -697,7 +697,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // ================== // SaveRestoreState() // ================== -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } // ==================== // GetTriggerScriptID() diff --git a/scripts/osiris_common.h b/scripts/osiris_common.h index 3173aca9..5790b011 100644 --- a/scripts/osiris_common.h +++ b/scripts/osiris_common.h @@ -928,7 +928,7 @@ typedef int OMMSHANDLE; #endif // define unsigned types; -typedef uint8_t ubyte; +typedef uint8_t uint8_t; typedef int8_t int8_t; typedef uint16_t ushort; typedef uint32_t uint32_t; diff --git a/scripts/osiris_import.h b/scripts/osiris_import.h index 0d63879e..ff19ae9a 100644 --- a/scripts/osiris_import.h +++ b/scripts/osiris_import.h @@ -106,9 +106,9 @@ static inline void Room_Value(int roomnum, char op, char vhandle, void *ptr, int Room_ValueFP(roomnum, op, vhandle, ptr, index); } -// ubyte Room_IsValid(int roomnum); +// uint8_t Room_IsValid(int roomnum); // returns 0 if the room is not valid. 1 if the room is a terrain cell. 2 if the room is a room segment -typedef ubyte (*Room_IsValid_fp)(int roomnum); +typedef uint8_t (*Room_IsValid_fp)(int roomnum); OSIRISEXTERN Room_IsValid_fp Room_IsValid; // int Obj_GetAttachParent(int childhandle); @@ -126,10 +126,10 @@ OSIRISEXTERN Obj_GetNumAttachSlots_fp Obj_GetNumAttachSlots; typedef int (*Obj_GetAttachChildHandle_fp)(int objhandle, char attachpoint); OSIRISEXTERN Obj_GetAttachChildHandle_fp Obj_GetAttachChildHandle; -// int Obj_AttachObjectAP(int parenthandle,char parent_ap,int childhandle,char child_ap,ubyte f_use_aligned); +// int Obj_AttachObjectAP(int parenthandle,char parent_ap,int childhandle,char child_ap,uint8_t f_use_aligned); // Attaches one object to another object based on their attach points typedef int (*Obj_AttachObjectAP_fp)(int parenthandle, char parent_ap, int childhandle, char child_ap, - ubyte f_use_aligned); + uint8_t f_use_aligned); OSIRISEXTERN Obj_AttachObjectAP_fp Obj_AttachObjectAP; // int Obj_AttachObjectRad(int parenthandle,char parent_ap,int childhandle,float percent_rad); @@ -170,8 +170,8 @@ static inline int AI_GoalFollowPathSimple(int objhandle, int path_id, int guid, return AI_GoalFollowPathSimpleFP(objhandle, path_id, guid, flags, slot); } -// int AI_PowerSwitch(int objhandle,ubyte f_power_on); -typedef int (*AI_PowerSwitch_fp)(int objhandle, ubyte f_power_on); +// int AI_PowerSwitch(int objhandle,uint8_t f_power_on); +typedef int (*AI_PowerSwitch_fp)(int objhandle, uint8_t f_power_on); OSIRISEXTERN AI_PowerSwitch_fp AI_PowerSwitch; // void AI_Value(int objhandle, char op, char vtype, void *ptr); @@ -193,8 +193,8 @@ static inline void Matcen_Value(int matcen_handle, char op, char vtype, void *pt Matcen_ValueFP(matcen_handle, op, vtype, ptr, prod_index); } -// ubyte AI_TurnTowardsVectors(int objhandle,vector *fvec,vector *uvec); -typedef ubyte (*AI_TurnTowardsVectors_fp)(int objhandle, vector *fvec, vector *uvec); +// uint8_t AI_TurnTowardsVectors(int objhandle,vector *fvec,vector *uvec); +typedef uint8_t (*AI_TurnTowardsVectors_fp)(int objhandle, vector *fvec, vector *uvec); OSIRISEXTERN AI_TurnTowardsVectors_fp AI_TurnTowardsVectors; // void AI_SetType(int objhandle,int type); @@ -237,21 +237,21 @@ OSIRISEXTERN AI_FindEnergyCenter_fp AI_FindEnergyCenter; typedef float (*AI_GetDistToObj_fp)(int objhandle, int otherobjhandle); OSIRISEXTERN AI_GetDistToObj_fp AI_GetDistToObj; -// int AI_SetGoalFlags(int objhandle,int goal_handle,int flags,ubyte f_enable); -typedef int (*AI_SetGoalFlags_fp)(int objhandle, int goal_handle, int flags, ubyte f_enable); +// int AI_SetGoalFlags(int objhandle,int goal_handle,int flags,uint8_t f_enable); +typedef int (*AI_SetGoalFlags_fp)(int objhandle, int goal_handle, int flags, uint8_t f_enable); OSIRISEXTERN AI_SetGoalFlags_fp AI_SetGoalFlags; // void AI_SetGoalCircleDist(int objhandle,int goal_handle,float dist); typedef void (*AI_SetGoalCircleDist_fp)(int objhandle, int goal_handle, float dist); OSIRISEXTERN AI_SetGoalCircleDist_fp AI_SetGoalCircleDist; -// int File_ReadBytes(ubyte *buffer, int count, void *fileptr); +// int File_ReadBytes(uint8_t *buffer, int count, void *fileptr); // Reads the specified number of bytes from a file into the buffer // DO NOT USE THIS TO READ STRUCTURES. This function is for byte // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes read. // Throws an exception of type (cfile_error *) if the OS returns an error on read -typedef int (*File_ReadBytes_fp)(ubyte *buffer, int count, void *fileptr); +typedef int (*File_ReadBytes_fp)(uint8_t *buffer, int count, void *fileptr); OSIRISEXTERN File_ReadBytes_fp File_ReadBytes; // int File_ReadInt(void *fileptr); @@ -303,13 +303,13 @@ OSIRISEXTERN File_ReadDouble_fp File_ReadDouble; typedef int (*File_ReadString_fp)(char *buf, size_t n, void *fileptr); OSIRISEXTERN File_ReadString_fp File_ReadString; -// int File_WriteBytes(const ubyte *buf,int count,void *fileptr); +// int File_WriteBytes(const uint8_t *buf,int count,void *fileptr); // Writes the specified number of bytes from a file into the buffer // DO NOT USE THIS TO WRITE STRUCTURES. This function is for byte // data, such as a string or a bitmap of 8-bit pixels. // Returns the number of bytes written. // Throws an exception of type (cfile_error *) if the OS returns an error on write -typedef int (*File_WriteBytes_fp)(const ubyte *buf, int count, void *fileptr); +typedef int (*File_WriteBytes_fp)(const uint8_t *buf, int count, void *fileptr); OSIRISEXTERN File_WriteBytes_fp File_WriteBytes; // int File_WriteString(const char *buf,void *fileptr); @@ -384,11 +384,11 @@ OSIRISEXTERN Scrpt_CreateTimer_fp Scrpt_CreateTimer; typedef void (*MSafe_DoPowerup_fp)(msafe_struct *mstruct); OSIRISEXTERN MSafe_DoPowerup_fp MSafe_DoPowerup; -// int Obj_Create()(ubyte type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle) -typedef int (*Obj_Create_fp)(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, +// int Obj_Create()(uint8_t type,ushort id,int roomnum,vector *pos,const matrix *orient,int parent_handle) +typedef int (*Obj_Create_fp)(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient, int parent_handle, vector *initial_velocity); OSIRISEXTERN Obj_Create_fp Obj_CreateFP; -static inline int Obj_Create(ubyte type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, +static inline int Obj_Create(uint8_t type, ushort id, int roomnum, vector *pos, const matrix *orient = NULL, int parent_handle = 0, vector *initial_velocity = NULL) { return Obj_CreateFP(type, id, roomnum, pos, orient, parent_handle, initial_velocity); } @@ -407,8 +407,8 @@ static inline void Obj_WBValue(int obj_handle, char wb_index, char op, char vtyp Obj_WBValueFP(obj_handle, wb_index, op, vtype, ptr, g_index); } -// ubyte Scrpt_TimerExists(int handle); -typedef ubyte (*Scrpt_TimerExists_fp)(int handle); +// uint8_t Scrpt_TimerExists(int handle); +typedef uint8_t (*Scrpt_TimerExists_fp)(int handle); OSIRISEXTERN Scrpt_TimerExists_fp Scrpt_TimerExists; typedef void (*Matcen_Reset_fp)(int handle); @@ -423,10 +423,10 @@ OSIRISEXTERN Matcen_Create_fp Matcen_Create; typedef int (*Matcen_FindID_fp)(char *str); OSIRISEXTERN Matcen_FindID_fp Matcen_FindID; -// void Msn_FlagSet(int flag,ubyte value); +// void Msn_FlagSet(int flag,uint8_t value); // Sets/Clears mission flags. flag is which mission flag to set/clear (1-32) // value is 0 to clear, or 1 to set -typedef void (*Msn_FlagSet_fp)(int flag, ubyte value); +typedef void (*Msn_FlagSet_fp)(int flag, uint8_t value); OSIRISEXTERN Msn_FlagSet_fp Msn_FlagSet; // int Msn_FlagGet(int flag); @@ -476,7 +476,7 @@ typedef int (*File_Tell_fp)(void *fileptr); OSIRISEXTERN File_Tell_fp File_Tell; // returns 1 if the file is at the EOF, else 0 (like feof()) -typedef ubyte (*File_eof_fp)(void *fileptr); +typedef uint8_t (*File_eof_fp)(void *fileptr); OSIRISEXTERN File_eof_fp File_eof; typedef void (*Sound_Stop_fp)(int s_handle, bool f_immediately); @@ -567,7 +567,7 @@ OSIRISEXTERN OMMS_Find_fp OMMS_Find; // OMMS_Malloc(). Returns 0 if the handle was invalid, 1 if the information has been filled in; // Pass NULL in for those parameters you don't need information about. typedef char (*OMMS_GetInfo_fp)(OMMSHANDLE handle, uint32_t *mem_size, uint32_t *uid, ushort *reference_count, - ubyte *has_free_been_called); + uint8_t *has_free_been_called); OSIRISEXTERN OMMS_GetInfo_fp OMMS_GetInfo; // Starts an in-game cinematic sequence. text_string is the text to be displayed diff --git a/scripts/testscript.cpp b/scripts/testscript.cpp index 33ea55fe..6e6f7fd7 100644 --- a/scripts/testscript.cpp +++ b/scripts/testscript.cpp @@ -31,11 +31,11 @@ extern "C" { #endif DLLEXPORT char STDCALL InitializeDLL(tOSIRISModuleInit *func_list); DLLEXPORT void STDCALL ShutdownDLL(void); -DLLEXPORT int STDCALL GetGOScriptID(const char *name, ubyte isdoor); +DLLEXPORT int STDCALL GetGOScriptID(const char *name, uint8_t isdoor); DLLEXPORT void STDCALLPTR CreateInstance(int id); DLLEXPORT void STDCALL DestroyInstance(int id, void *ptr); DLLEXPORT short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo *data); -DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state); +DLLEXPORT int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state); #ifdef __cplusplus } #endif @@ -94,7 +94,7 @@ char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) { void STDCALL ShutdownDLL(void) {} -int STDCALL GetGOScriptID(const char *name, ubyte isdoor) { +int STDCALL GetGOScriptID(const char *name, uint8_t isdoor) { for (int i = 0; i < MAX_IDS; i++) { if (!stricmp(name, ScriptInfo[i].name)) { return ScriptInfo[i].id; @@ -156,7 +156,7 @@ short STDCALL CallInstanceEvent(int id, void *ptr, int event, tOSIRISEventInfo * // able to be used. IT IS VERY IMPORTANT WHEN SAVING THE STATE TO RETURN THE NUMBER OF _BYTES_ WROTE // TO THE FILE. When restoring the data, the return value is ignored. saving_state is 1 when you should // write data to the file_ptr, 0 when you should read in the data. -int STDCALL SaveRestoreState(void *file_ptr, ubyte saving_state) { return 0; } +int STDCALL SaveRestoreState(void *file_ptr, uint8_t saving_state) { return 0; } //============================================ // Script Implementation diff --git a/sndlib/ddsoundload.cpp b/sndlib/ddsoundload.cpp index 249babba..1fb46289 100644 --- a/sndlib/ddsoundload.cpp +++ b/sndlib/ddsoundload.cpp @@ -381,7 +381,7 @@ char SoundLoadWaveFile(const char *filename, float percent_volume, int sound_fil SoundFiles[sound_file_index].sample_8bit = (uint8_t *)GlobalAlloc(0, aligned_size); GlobalLock(SoundFiles[sound_file_index].sample_8bit); - cf_ReadBytes((ubyte *)SoundFiles[sound_file_index].sample_8bit, cksize, cfptr); + cf_ReadBytes((uint8_t *)SoundFiles[sound_file_index].sample_8bit, cksize, cfptr); if (aligned_size != cksize) memset(SoundFiles[sound_file_index].sample_8bit + cksize, 128, num_needed); diff --git a/sndlib/ds3dlib_internal.h b/sndlib/ds3dlib_internal.h index 377f1385..95face51 100644 --- a/sndlib/ds3dlib_internal.h +++ b/sndlib/ds3dlib_internal.h @@ -71,13 +71,13 @@ class win_llsSystem; typedef struct DSLOOPSTREAM { - ubyte method; // method 0 for streamed method, 1 for emulated method - ubyte playing; - ubyte please_close; + uint8_t method; // method 0 for streamed method, 1 for emulated method + uint8_t playing; + uint8_t please_close; union // dependant on method. { - ubyte close_on_next; + uint8_t close_on_next; int8_t loop_step; // method 1, = 0 for start loop, 1 = mid loop, 2 = end loop. }; @@ -92,7 +92,7 @@ typedef struct DSLOOPSTREAM { DWORD half_buffer_point; DWORD last_half; int num_written; - ubyte time_slice; + uint8_t time_slice; bool kill_me; bool f_sample_16bit; char silence_byte; diff --git a/sndlib/dsound3d.cpp b/sndlib/dsound3d.cpp index b1554be6..924a6bba 100644 --- a/sndlib/dsound3d.cpp +++ b/sndlib/dsound3d.cpp @@ -64,7 +64,7 @@ static struct t_sb_loop_thread_data { bool thread_alive; } m_ds; -static ubyte m_sb_cur_timeslice; +static uint8_t m_sb_cur_timeslice; //////////////////////////////////////////////////////////////////////////////// // DSLOOP_STREAM_METHOD @@ -227,7 +227,7 @@ void __cdecl sb_loop_thread(void *user_ptr) { sound_buffer_cache *sndcache; DWORD playp, writep, whichhalf; int i; - ubyte iteration; + uint8_t iteration; // validate thread m_ds.m_ll_sndsys = (win_llsSystem *)user_ptr; diff --git a/sndlib/hlsoundlib.h b/sndlib/hlsoundlib.h index 857ad2d3..14dd9a23 100644 --- a/sndlib/hlsoundlib.h +++ b/sndlib/hlsoundlib.h @@ -254,7 +254,7 @@ class hlsSystem { int m_sounds_played; bool m_pause_new; - ubyte m_cur_environment; // current environment being played. + uint8_t m_cur_environment; // current environment being played. int n_lls_sounds; // number of sounds that we want the low level mixer to mix. bool Emulate3dSound(int sound_obj_index); diff --git a/sndlib/ssl_lib.h b/sndlib/ssl_lib.h index bbafd35e..12813691 100644 --- a/sndlib/ssl_lib.h +++ b/sndlib/ssl_lib.h @@ -294,8 +294,8 @@ typedef struct { int m_stream_bufsize; // passed in void *user_data; // this is passed to the stream callback by the caller that defined this. - ubyte sample_skip_interval; // Allows us to skip samples (i.e. simulate lower sampling rates) - ubyte priority; // priority of sound. + uint8_t sample_skip_interval; // Allows us to skip samples (i.e. simulate lower sampling rates) + uint8_t priority; // priority of sound. ushort m_stream_format; // passed in // internal data. diff --git a/stream_audio/osfarchive.cpp b/stream_audio/osfarchive.cpp index 792b021a..6d080ca3 100644 --- a/stream_audio/osfarchive.cpp +++ b/stream_audio/osfarchive.cpp @@ -95,7 +95,7 @@ bool OSFArchive::Open(const char *filename, bool write) { // okay, if we are in read mode, then we read in the header NOW memset(tag, 0, sizeof(tag)); cfseek(m_fp, -OSF_HDR_SIZE, SEEK_END); - cf_ReadBytes((ubyte *)tag, strlen(OSF_TAG), m_fp); + cf_ReadBytes((uint8_t *)tag, strlen(OSF_TAG), m_fp); if (strcmp(OSF_TAG, tag) != 0) { mprintf((0, "Illegal OSF file format for %s.\n", filename)); cfclose(m_fp); @@ -104,9 +104,9 @@ bool OSFArchive::Open(const char *filename, bool write) { } // read in rest of header. - m_type = (ubyte)cf_ReadByte(m_fp); - m_comp = (ubyte)cf_ReadByte(m_fp); - m_flags = (ubyte)cf_ReadByte(m_fp); + m_type = (uint8_t)cf_ReadByte(m_fp); + m_comp = (uint8_t)cf_ReadByte(m_fp); + m_flags = (uint8_t)cf_ReadByte(m_fp); m_rate = (uint32_t)cf_ReadByte(m_fp); if (m_type == OSF_DIGITAL_STRM) { @@ -130,7 +130,7 @@ bool OSFArchive::Open(const char *filename, bool write) { m_length = (uint32_t)cf_ReadInt(m_fp); cfseek(m_fp, -OSF_HDR_TITLE_OFS, SEEK_END); - if (!cf_ReadBytes((ubyte *)m_name, OSF_HDR_TITLE_LEN, m_fp)) { + if (!cf_ReadBytes((uint8_t *)m_name, OSF_HDR_TITLE_LEN, m_fp)) { mprintf((0, "Stream title not found for %s.\n", filename)); cfclose(m_fp); m_fp = NULL; @@ -174,7 +174,7 @@ void OSFArchive::Rewind() { } // write out operations. -bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, uint32_t length, void *hdr, const char *name) { +bool OSFArchive::SaveHeader(uint8_t type, uint8_t comp, uint8_t flags, uint32_t rate, uint32_t length, void *hdr, const char *name) { char chbuf[OSF_HDR_SIZE]; int hdrstart, hdrcur; @@ -184,12 +184,12 @@ bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, // write out data. try { char osftitle[OSF_HDR_TITLE_LEN]; - memset((ubyte *)chbuf, 0, OSF_HDR_SIZE); - cf_WriteBytes((ubyte *)chbuf, OSF_HDR_SIZE, m_fp); + memset((uint8_t *)chbuf, 0, OSF_HDR_SIZE); + cf_WriteBytes((uint8_t *)chbuf, OSF_HDR_SIZE, m_fp); cfseek(m_fp, -OSF_HDR_SIZE, SEEK_CUR); hdrstart = cftell(m_fp); - if (!cf_WriteBytes((ubyte *)OSF_TAG, strlen(OSF_TAG), m_fp)) + if (!cf_WriteBytes((uint8_t *)OSF_TAG, strlen(OSF_TAG), m_fp)) return false; cf_WriteByte(m_fp, (int8_t)type); @@ -215,7 +215,7 @@ bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, cfseek(m_fp, OSF_HDR_TITLE_OFS - (hdrcur - hdrstart), SEEK_CUR); strncpy(osftitle, name, OSF_HDR_TITLE_LEN); osftitle[OSF_HDR_TITLE_LEN - 1] = 0; - if (!cf_WriteBytes((ubyte *)name, OSF_HDR_TITLE_LEN, m_fp)) + if (!cf_WriteBytes((uint8_t *)name, OSF_HDR_TITLE_LEN, m_fp)) return false; } catch (...) { return false; @@ -224,10 +224,10 @@ bool OSFArchive::SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, return true; } -bool OSFArchive::WriteBlock(ubyte *blk, int size) { return (cf_WriteBytes(blk, size, m_fp) < size) ? false : true; } +bool OSFArchive::WriteBlock(uint8_t *blk, int size) { return (cf_WriteBytes(blk, size, m_fp) < size) ? false : true; } // read in operations. -int OSFArchive::Read(ubyte *blk, int size) { +int OSFArchive::Read(uint8_t *blk, int size) { int retval; try { retval = cf_ReadBytes(blk, size, m_fp); diff --git a/stream_audio/streamaudio.cpp b/stream_audio/streamaudio.cpp index a51d4a18..c04ba56f 100644 --- a/stream_audio/streamaudio.cpp +++ b/stream_audio/streamaudio.cpp @@ -432,7 +432,7 @@ bool AudioStream::IsReady() { return false; } ////////////////////////////////////////////////////////////////////////////// -bool AudioStream::ReopenDigitalStream(ubyte fbufidx, int nbufs) { +bool AudioStream::ReopenDigitalStream(uint8_t fbufidx, int nbufs) { const tOSFDigiHdr *digihdr = (const tOSFDigiHdr *)m_archive.StreamHeader(); m_bytesleft = m_archive.StreamLength(); @@ -540,7 +540,7 @@ bool AudioStream::ReopenDigitalStream(ubyte fbufidx, int nbufs) { if (m_buffer[m_fbufidx].data) { mem_free(m_buffer[m_fbufidx].data); } - m_buffer[m_fbufidx].data = (ubyte *)mem_malloc(m_bufsize); + m_buffer[m_fbufidx].data = (uint8_t *)mem_malloc(m_bufsize); } m_buffer[m_fbufidx].nbytes = AudioStream::ReadFileData(m_fbufidx, m_bufsize); m_buffer[m_fbufidx].flags = 0; @@ -757,7 +757,7 @@ void AudioStream::Reset() { // invoked by AudioStreamCB. #pragma optimize("", off) void *AudioStream::StreamCallback(int *size) { - ubyte nextbuffer = (m_sbufidx + 1) % STRM_BUFCOUNT; + uint8_t nextbuffer = (m_sbufidx + 1) % STRM_BUFCOUNT; void *data = NULL; // we're not done yet. // adjust sound buffer to the next buffer @@ -871,7 +871,7 @@ void AudioStream::UpdateData() { if (m_buffer[m_fbufidx].data) { mem_free(m_buffer[m_fbufidx].data); } - m_buffer[m_fbufidx].data = (ubyte *)mem_malloc(m_bufsize); + m_buffer[m_fbufidx].data = (uint8_t *)mem_malloc(m_bufsize); } m_buffer[m_fbufidx].nbytes = AudioStream::ReadFileData(m_fbufidx, m_bufsize); m_buffer[m_fbufidx].flags = 0; @@ -922,7 +922,7 @@ int ADecodeFileRead(void *data, void *buf, unsigned qty) { stream->m_bytesleft -= iqty; } - return stream->m_archive.Read((ubyte *)buf, iqty); + return stream->m_archive.Read((uint8_t *)buf, iqty); } // Router for stream callbacks. diff --git a/stream_audio/streamaudio.h b/stream_audio/streamaudio.h index bf6c63a4..0ddc6631 100644 --- a/stream_audio/streamaudio.h +++ b/stream_audio/streamaudio.h @@ -180,9 +180,9 @@ typedef struct tOSFDigiHdr // this struct belongs to OSF_DIGITAL_STRM class OSFArchive { CFILE *m_fp; uint32_t m_length; // file information stored such as length - ubyte m_type; // stream type - ubyte m_comp; // compression type - ubyte m_flags; // format + uint8_t m_type; // stream type + uint8_t m_comp; // compression type + uint8_t m_flags; // format uint32_t m_rate; // frequency bool m_writemode; // are we in write mode? union { @@ -198,14 +198,14 @@ public: bool Opened() const { return m_fp ? true : false; }; void Rewind(); // write out operations. - bool SaveHeader(ubyte type, ubyte comp, ubyte flags, uint32_t rate, uint32_t length, void *hdr, const char *name); - bool WriteBlock(ubyte *blk, int size); + bool SaveHeader(uint8_t type, uint8_t comp, uint8_t flags, uint32_t rate, uint32_t length, void *hdr, const char *name); + bool WriteBlock(uint8_t *blk, int size); // read in operations. - int Read(ubyte *blk, int size); + int Read(uint8_t *blk, int size); // get archive info. - ubyte StreamType() const { return m_type; }; - ubyte StreamComp() const { return m_comp; }; - ubyte StreamFormat() const { return m_flags; }; + uint8_t StreamType() const { return m_type; }; + uint8_t StreamComp() const { return m_comp; }; + uint8_t StreamFormat() const { return m_flags; }; uint32_t StreamRate() const { return m_rate; }; uint32_t StreamLength() const { return m_length; }; const char *StreamName() const { return (const char *)m_name; }; @@ -236,7 +236,7 @@ class AudioStream { OSFArchive m_archive; // audio stream archive object. AudioDecoder::IAudioDecoder *m_decoder; // audio codec object struct { // mixing buffers - ubyte *data; + uint8_t *data; int nbytes; // number of bytes of valid data. int flags; int id; @@ -245,10 +245,10 @@ class AudioStream { float m_measure_timer; // timer for measure checking. float m_measure_time; // amount of time per measure. float m_last_frametime; - ubyte m_sbufidx; // stream position markers - ubyte m_fbufidx; // file position markers - ubyte m_curbufidx; // current buffer in measure index - ubyte m_playcount; + uint8_t m_sbufidx; // stream position markers + uint8_t m_fbufidx; // file position markers + uint8_t m_curbufidx; // current buffer in measure index + uint8_t m_playcount; bool m_readahead; // if stream is currently reading from disk bool m_readahead_finished_loop; // if a loop's readahead has finished short m_nbufs; // number of buffers streamed so far. @@ -278,7 +278,7 @@ private: void End(); // cleans up after a stop. void Reset(); // resets to start of stream. bool OpenDigitalStream(); // opens and prepares a digital stream - bool ReopenDigitalStream(ubyte fbufidx, int nbufs); + bool ReopenDigitalStream(uint8_t fbufidx, int nbufs); private: // attach a low level sound system to all streams. diff --git a/ui/UIConsole.cpp b/ui/UIConsole.cpp index 1f7196a2..967f19c8 100644 --- a/ui/UIConsole.cpp +++ b/ui/UIConsole.cpp @@ -136,7 +136,7 @@ void UIConsoleGadget::OnDestroy() { // functions void UIConsoleGadget::puts(ddgr_color col, const char *str) { int len = strlen(str); - ubyte r = GR_COLOR_RED(col), g = GR_COLOR_GREEN(col), b = GR_COLOR_BLUE(col); + uint8_t r = GR_COLOR_RED(col), g = GR_COLOR_GREEN(col), b = GR_COLOR_BLUE(col); char *linebuf; if (len >= m_PutsBufLen) { diff --git a/ui/UIDraw.cpp b/ui/UIDraw.cpp index 7e960c9f..cceced67 100644 --- a/ui/UIDraw.cpp +++ b/ui/UIDraw.cpp @@ -90,7 +90,7 @@ static int m_UIDrawLeft; static int m_UIDrawTop; static int m_UIDrawRight; static int m_UIDrawBottom; -static ubyte m_UIDrawAlpha, m_UICharAlpha; +static uint8_t m_UIDrawAlpha, m_UICharAlpha; static int m_UITextFlags = 0; ////////////////////////////////////////////////////////////////////////////// @@ -121,7 +121,7 @@ void ui_SetTextClip(int left, int top, int right, int bottom) { grtext_SetParame void ui_ResetTextClip() { grtext_SetParameters(m_UIDrawLeft, m_UIDrawTop, m_UIDrawRight, m_UIDrawBottom); } // draw primatives -void ui_DrawSetAlpha(ubyte alpha) { m_UIDrawAlpha = alpha; } +void ui_DrawSetAlpha(uint8_t alpha) { m_UIDrawAlpha = alpha; } void ui_DrawLine(ddgr_color color, int x1, int y1, int x2, int y2) { if (color == TRANSPARENT_COLOR32) @@ -187,7 +187,7 @@ void ui_DrawRect(ddgr_color color, int l, int t, int r, int b) { } // draws all textures derived from ui_bm_handle. -void ui_DrawBitmap(UIBitmapItem *bi, int x, int y, ubyte alpha) { +void ui_DrawBitmap(UIBitmapItem *bi, int x, int y, uint8_t alpha) { if (bi->is_chunked()) { chunked_bitmap *chunk = bi->get_chunked_bitmap(); rend_DrawChunkedBitmap(chunk, x, y, alpha); @@ -245,7 +245,7 @@ int ui_DrawGetFont() { return grtext_GetFont(); } int ui_GetFontHeight() { return grfont_GetHeight(grtext_GetFont()); } -void ui_SetCharAlpha(ubyte alpha) { m_UICharAlpha = alpha; } +void ui_SetCharAlpha(uint8_t alpha) { m_UICharAlpha = alpha; } int ui_GetTextWidth(const char *text) { return grtext_GetLineWidth((char *)text); } diff --git a/ui/UIListBox.cpp b/ui/UIListBox.cpp index 9ef8c50f..7072ef3f 100644 --- a/ui/UIListBox.cpp +++ b/ui/UIListBox.cpp @@ -631,7 +631,7 @@ void UIListBox::OnDraw() { // draw all items in box that can be visible. int x, y, i; - ubyte alpha; + uint8_t alpha; x = m_TextOffX; y = m_TextOffY; @@ -666,7 +666,7 @@ void UIListBox::OnDraw() { // ui_DrawRect(m_HiliteColor, x,y,m_W-m_TextOffX,y+m_ItemList[i]->height()+2); // } - m_ItemList[i]->set_alpha((ubyte)alpha); + m_ItemList[i]->set_alpha((uint8_t)alpha); if (m_SelectedIndex == i) { ddgr_color old_color = m_ItemList[i]->get_color(); m_ItemList[i]->set_color(m_SelectColor); diff --git a/ui/UIRes.cpp b/ui/UIRes.cpp index 3f9c4177..884f7408 100644 --- a/ui/UIRes.cpp +++ b/ui/UIRes.cpp @@ -47,7 +47,7 @@ int UITextItem::m_Sat = 0; int UITextItem::m_DefaultFont = 0; char UITextItem::dummy_str[4] = ""; -UITextItem::UITextItem(const char *text, ddgr_color color, ubyte alpha) { +UITextItem::UITextItem(const char *text, ddgr_color color, uint8_t alpha) { int slen = strlen(text); if (slen > 0) { m_Text = mem_strdup(text); @@ -66,7 +66,7 @@ UITextItem::UITextItem(const char *text, ddgr_color color, ubyte alpha) { m_Font = m_DefaultFont; } -UITextItem::UITextItem(int font, const char *text, ddgr_color color, ubyte alpha) { +UITextItem::UITextItem(int font, const char *text, ddgr_color color, uint8_t alpha) { int slen = strlen(text); if (slen > 0) { m_Text = mem_strdup(text); @@ -169,13 +169,13 @@ const UITextItem &UITextItem::operator=(const UITextItem &item) { #define UISTIF_INCREASING 0x80000000 -UISnazzyTextItem::UISnazzyTextItem(unsigned flags, const char *text, ddgr_color color, ubyte alpha) +UISnazzyTextItem::UISnazzyTextItem(unsigned flags, const char *text, ddgr_color color, uint8_t alpha) : UITextItem(text, color, alpha) { m_flags = 0; // must do, so that set_flags works. set_flags(flags); } -UISnazzyTextItem::UISnazzyTextItem(unsigned flags, int font, const char *text, ddgr_color color, ubyte alpha) +UISnazzyTextItem::UISnazzyTextItem(unsigned flags, int font, const char *text, ddgr_color color, uint8_t alpha) : UITextItem(font, text, color, alpha) { m_flags = 0; // must do, so that set_flags works. set_flags(flags); @@ -232,7 +232,7 @@ bool UISnazzyTextItem::draw(int x, int y, tUIDrawClass draw_class) { b2 = b2 - b; set_color(GR_RGB(r + (int)(r2 * m_data.f), g + (int)(g2 * m_data.f), b + (int)(b2 * m_data.f))); - // set_alpha((ubyte)(m_data.f*m_internaldata.i)); + // set_alpha((uint8_t)(m_data.f*m_internaldata.i)); // mprintf((0, "%x\n", (unsigned)get_color())); } diff --git a/unzip/unzip.cpp b/unzip/unzip.cpp index 75ae125f..729ceb24 100644 --- a/unzip/unzip.cpp +++ b/unzip/unzip.cpp @@ -96,11 +96,11 @@ #define LFH_NAME 0x1e ushort get_buffer_short(char *buf) { - ubyte *ubuf = (ubyte *)buf; + uint8_t *ubuf = (uint8_t *)buf; return ((ushort)ubuf[1] << 8) | (ushort)ubuf[0]; } uint32_t get_buffer_int(char *buf) { - ubyte *ubuf = (ubyte *)buf; + uint8_t *ubuf = (uint8_t *)buf; return ((uint32_t)ubuf[3] << 24) | ((uint32_t)ubuf[2] << 16) | ((uint32_t)ubuf[1] << 8) | (uint32_t)ubuf[0]; } @@ -382,7 +382,7 @@ int ZIP::ReadFile(zipentry *ent, char *data) { } // inflate the file - if (InflateFile(m_fp, ent->compressed_size, (ubyte *)data, ent->uncompressed_size)) { + if (InflateFile(m_fp, ent->compressed_size, (uint8_t *)data, ent->uncompressed_size)) { return -6; } @@ -481,7 +481,7 @@ int ZIP::ReadZipDataToFile(zipentry *ent, FILE *file) { if (err != 0) return -2; - ubyte data[DATA_CHUNK_SIZE]; + uint8_t data[DATA_CHUNK_SIZE]; int size_remaining, amount; size_remaining = ent->compressed_size; @@ -526,7 +526,7 @@ int ZIP::SeekToCompressedData(zipentry *ent) { } // uses zlib to inflate the given data -int ZIP::InflateFile(FILE *in_file, unsigned in_size, ubyte *out_data, unsigned out_size) { +int ZIP::InflateFile(FILE *in_file, unsigned in_size, uint8_t *out_data, unsigned out_size) { int err; uint8_t *in_buffer; z_stream d_stream; @@ -550,7 +550,7 @@ int ZIP::InflateFile(FILE *in_file, unsigned in_size, ubyte *out_data, unsigned return -1; } - in_buffer = (ubyte *)malloc(INFLATE_INPUT_BUFFER_MAX + 1); + in_buffer = (uint8_t *)malloc(INFLATE_INPUT_BUFFER_MAX + 1); if (!in_buffer) return -1; @@ -591,7 +591,7 @@ int ZIP::InflateFile(FILE *in_file, unsigned in_size, ubyte *out_data, unsigned // uses zlib to inflate the given data int ZIP::InflateFileToFile(FILE *in_file, unsigned in_size, FILE *file, unsigned out_size) { - ubyte out_data[DATA_CHUNK_SIZE]; + uint8_t out_data[DATA_CHUNK_SIZE]; int err; uint32_t last_out; uint8_t *in_buffer; @@ -619,7 +619,7 @@ int ZIP::InflateFileToFile(FILE *in_file, unsigned in_size, FILE *file, unsigned return -1; } - in_buffer = (ubyte *)malloc(DATA_CHUNK_SIZE + 1); + in_buffer = (uint8_t *)malloc(DATA_CHUNK_SIZE + 1); if (!in_buffer) return -1; diff --git a/win32/WinController.cpp b/win32/WinController.cpp index f35a0ad7..37744f1c 100644 --- a/win32/WinController.cpp +++ b/win32/WinController.cpp @@ -445,7 +445,7 @@ bool gameWinController::get_packet(int id, ct_packet *packet, ct_format alt_form // check if the element's controller is valid. for (i = 0; i < CTLBINDS_PER_FUNC; i++) { - ubyte value = m_ElementList[id].value[i]; + uint8_t value = m_ElementList[id].value[i]; int8_t controller = m_ElementList[id].ctl[i]; if (controller == -1 || m_ControlList[controller].id == CTID_INVALID) { @@ -683,7 +683,7 @@ ct_config_data gameWinController::get_controller_value(ct_type type_req) { void gameWinController::enable_function(int id, bool enable) { m_ElementList[id].enabled = enable; } // returns information about a requested function -void gameWinController::get_controller_function(int id, ct_type *type, ct_config_data *value, ubyte *flags) { +void gameWinController::get_controller_function(int id, ct_type *type, ct_config_data *value, uint8_t *flags) { type[0] = m_ElementList[id].ctype[0]; type[1] = m_ElementList[id].ctype[1]; *value = makeword(CONTROLLER_CTL_INFO(m_ElementList[id].ctl[0], m_ElementList[id].ctl[1]), @@ -693,7 +693,7 @@ void gameWinController::get_controller_function(int id, ct_type *type, ct_config } // sets the configuration of a function -void gameWinController::set_controller_function(int id, const ct_type *type, ct_config_data value, const ubyte *flags) { +void gameWinController::set_controller_function(int id, const ct_type *type, ct_config_data value, const uint8_t *flags) { ct_element elem; if (id >= CT_MAX_ELEMENTS) @@ -811,7 +811,7 @@ unsigned gameWinController::get_joy_raw_values(int *x, int *y) { } // note controller is index into ControlList. -float gameWinController::get_axis_value(int8_t controller, ubyte axis, ct_format format, bool invert) { +float gameWinController::get_axis_value(int8_t controller, uint8_t axis, ct_format format, bool invert) { if (controller <= NULL_WINCONTROLLER || controller >= CT_MAX_CONTROLLERS) return 0.0f; @@ -977,7 +977,7 @@ float gameWinController::get_axis_value(int8_t controller, ubyte axis, ct_format return val; } -float gameWinController::get_button_value(int8_t controller, ct_format format, ubyte button) { +float gameWinController::get_button_value(int8_t controller, ct_format format, uint8_t button) { float val = (float)0.0; if (controller <= NULL_WINCONTROLLER || controller >= CT_MAX_CONTROLLERS) { @@ -1050,7 +1050,7 @@ float gameWinController::get_button_value(int8_t controller, ct_format format, u } // do some pov stuff -float gameWinController::get_pov_value(int8_t controller, ct_format format, ubyte pov_number, ubyte pov) { +float gameWinController::get_pov_value(int8_t controller, ct_format format, uint8_t pov_number, uint8_t pov) { float val = (float)0.0; if (controller <= NULL_WINCONTROLLER || controller >= CT_MAX_CONTROLLERS) { @@ -1259,7 +1259,7 @@ void gameWinController::assign_element(int id, ct_element *elem) { } } -int8_t gameWinController::get_axis_controller(ubyte axis) { +int8_t gameWinController::get_axis_controller(uint8_t axis) { // start from controller 2 because 0, and 1 are reserved for keyboard and mouse if (axis == NULL_BINDING) return NULL_WINCONTROLLER; @@ -1271,7 +1271,7 @@ int8_t gameWinController::get_axis_controller(ubyte axis) { return NULL_WINCONTROLLER; } -int8_t gameWinController::get_button_controller(ubyte btn) { +int8_t gameWinController::get_button_controller(uint8_t btn) { unsigned mask; // buttons range from 1-CT_MAX_BUTTONS @@ -1295,7 +1295,7 @@ int8_t gameWinController::get_button_controller(ubyte btn) { } // returns the controller with a pov hat -int8_t gameWinController::get_pov_controller(ubyte pov) { +int8_t gameWinController::get_pov_controller(uint8_t pov) { // start from controller 2 because 0, and 1 are reserved for keyboard and mouse ushort pov_flag = CTF_POV << (pov); @@ -1486,7 +1486,7 @@ void gameWinController::mouse_geteval() { } // gets sensitivity of axis item -float gameWinController::get_axis_sensitivity(ct_type axis_type, ubyte axis) { +float gameWinController::get_axis_sensitivity(ct_type axis_type, uint8_t axis) { axis--; ASSERT(axis < CT_NUM_AXES); @@ -1505,7 +1505,7 @@ float gameWinController::get_axis_sensitivity(ct_type axis_type, ubyte axis) { } // sets sensitivity of axis item -void gameWinController::set_axis_sensitivity(ct_type axis_type, ubyte axis, float val) { +void gameWinController::set_axis_sensitivity(ct_type axis_type, uint8_t axis, float val) { int i; axis--; @@ -1551,7 +1551,7 @@ char Ctltext_PovBindings[][16] = {"", "pov-U", "pov-R", "pov-D", "pov-L"}; #define NUM_BTNBINDSTRINGS (sizeof(Ctltext_BtnBindings) / sizeof(Ctltext_AxisBindings[0])) // retrieves binding text for desired function, binding, etc. -const char *gameWinController::get_binding_text(ct_type type, ubyte ctrl, ubyte bind) { +const char *gameWinController::get_binding_text(ct_type type, uint8_t ctrl, uint8_t bind) { static char binding_text[16]; const char *str;