From 9b87a167d750cca46fc6f1cf48869e0d7f04b18d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 9 Mar 2017 20:19:55 +0100 Subject: [PATCH] - replaced a large batch of DWORDs. Most of those which still rely on ZDoom's own definition should be gone, unfortunately the code in files that include Windows headers is a gigantic mess with DWORDs being longs there intead of ints, so this needs to be done with care. DWORD should only remain where the Windows type is actually wanted. --- src/f_wipe.cpp | 24 +++++------ src/gl/data/gl_data.cpp | 2 +- src/gl/data/gl_portaldata.cpp | 4 +- src/gl/data/gl_setup.cpp | 10 ++--- src/gl/scene/gl_bsp.cpp | 2 +- src/gl/scene/gl_renderhacks.cpp | 44 +++++++++---------- src/gl/scene/gl_sprite.cpp | 4 +- src/gl/system/gl_wipe.cpp | 2 +- src/gl/textures/gl_material.cpp | 6 +-- src/gl/textures/gl_texture.cpp | 10 ++--- src/gl/utility/gl_clock.cpp | 2 +- src/oplsynth/opl_mus_player.cpp | 22 +++++----- src/posix/cocoa/i_system.mm | 4 +- src/posix/cocoa/i_video.mm | 6 +-- src/posix/cocoa/st_console.mm | 2 +- src/posix/i_system.h | 2 +- src/posix/sdl/hardware.cpp | 4 +- src/posix/sdl/i_system.cpp | 4 +- src/posix/sdl/i_timer.cpp | 10 ++--- src/r_data/colormaps.cpp | 12 +++--- src/r_data/colormaps.h | 4 +- src/r_data/r_translate.h | 6 +-- src/r_data/sprites.cpp | 12 +++--- src/r_data/voxels.cpp | 4 +- src/r_sky.cpp | 2 +- src/r_sky.h | 2 +- src/r_state.h | 2 +- src/swrenderer/r_swcanvas.cpp | 16 +++---- src/swrenderer/scene/r_portal.cpp | 4 +- src/textures/buildtexture.cpp | 16 +++---- src/textures/texture.cpp | 6 +-- src/textures/textures.h | 20 ++++----- src/textures/warptexture.cpp | 8 ++-- src/timidity/instrum_sf2.cpp | 70 +++++++++++++++---------------- src/timidity/sf2.h | 18 ++++---- src/v_draw.cpp | 6 +-- src/v_video.cpp | 20 ++++----- src/v_video.h | 22 +++++----- 38 files changed, 207 insertions(+), 207 deletions(-) diff --git a/src/f_wipe.cpp b/src/f_wipe.cpp index e2a4f68402..95f170a85a 100644 --- a/src/f_wipe.cpp +++ b/src/f_wipe.cpp @@ -304,10 +304,10 @@ bool wipe_doBurn (int ticks) else { int bglevel = 64-fglevel; - DWORD *fg2rgb = Col2RGB8[fglevel]; - DWORD *bg2rgb = Col2RGB8[bglevel]; - DWORD fg = fg2rgb[fromnew[x]]; - DWORD bg = bg2rgb[fromold[x]]; + uint32_t *fg2rgb = Col2RGB8[fglevel]; + uint32_t *bg2rgb = Col2RGB8[bglevel]; + uint32_t fg = fg2rgb[fromnew[x]]; + uint32_t bg = bg2rgb[fromold[x]]; fg = (fg+bg) | 0x1f07c1f; to[x] = RGB32k.All[fg & (fg>>15)]; done = false; @@ -343,8 +343,8 @@ bool wipe_doBurn (int ticks) const PalEntry* pal = GPalette.BaseColors; - DWORD fg = fromnew[x]; - DWORD bg = fromold[x]; + uint32_t fg = fromnew[x]; + uint32_t bg = fromold[x]; int r = MIN((pal[fg].r * fglevel + pal[bg].r * bglevel) >> 8, 63); int g = MIN((pal[fg].g * fglevel + pal[bg].g * bglevel) >> 8, 63); int b = MIN((pal[fg].b * fglevel + pal[bg].b * bglevel) >> 8, 63); @@ -386,8 +386,8 @@ bool wipe_doFade (int ticks) { int x, y; int bglevel = 64 - fade; - DWORD *fg2rgb = Col2RGB8[fade]; - DWORD *bg2rgb = Col2RGB8[bglevel]; + uint32_t *fg2rgb = Col2RGB8[fade]; + uint32_t *bg2rgb = Col2RGB8[bglevel]; uint8_t *fromnew = (uint8_t *)wipe_scr_end; uint8_t *fromold = (uint8_t *)wipe_scr_start; uint8_t *to = screen->GetBuffer(); @@ -399,8 +399,8 @@ bool wipe_doFade (int ticks) { for (x = 0; x < SCREENWIDTH; x++) { - DWORD fg = fg2rgb[fromnew[x]]; - DWORD bg = bg2rgb[fromold[x]]; + uint32_t fg = fg2rgb[fromnew[x]]; + uint32_t bg = bg2rgb[fromold[x]]; fg = (fg+bg) | 0x1f07c1f; to[x] = RGB32k.All[fg & (fg>>15)]; } @@ -415,8 +415,8 @@ bool wipe_doFade (int ticks) { for (x = 0; x < SCREENWIDTH; x++) { - DWORD fg = fromnew[x]; - DWORD bg = fromold[x]; + uint32_t fg = fromnew[x]; + uint32_t bg = fromold[x]; int r = MIN((pal[fg].r * (64-bglevel) + pal[bg].r * bglevel) >> 8, 63); int g = MIN((pal[fg].g * (64-bglevel) + pal[bg].g * bglevel) >> 8, 63); int b = MIN((pal[fg].b * (64-bglevel) + pal[bg].b * bglevel) >> 8, 63); diff --git a/src/gl/data/gl_data.cpp b/src/gl/data/gl_data.cpp index a0bbd80029..a830e23a76 100644 --- a/src/gl/data/gl_data.cpp +++ b/src/gl/data/gl_data.cpp @@ -590,7 +590,7 @@ CCMD(dumpgeometry) subsector_t * sub = sector.subsectors[j]; Printf(PRINT_LOG, " Subsector %d - real sector = %d - %s\n", int(sub-subsectors), sub->sector->sectornum, sub->hacked&1? "hacked":""); - for(DWORD k=0;knumlines;k++) + for(uint32_t k=0;knumlines;k++) { seg_t * seg = sub->firstline + k; if (seg->linedef) diff --git a/src/gl/data/gl_portaldata.cpp b/src/gl/data/gl_portaldata.cpp index 725eebbef5..17a31d5bed 100644 --- a/src/gl/data/gl_portaldata.cpp +++ b/src/gl/data/gl_portaldata.cpp @@ -325,9 +325,9 @@ void gl_BuildPortalCoverage(FPortalCoverage *coverage, subsector_t *subsector, c build.center.y = xs_CRoundToInt(centery / subsector->numlines); build.CollectNode(nodes + numnodes - 1, shape); - coverage->subsectors = new DWORD[build.collect.Size()]; + coverage->subsectors = new uint32_t[build.collect.Size()]; coverage->sscount = build.collect.Size(); - memcpy(coverage->subsectors, &build.collect[0], build.collect.Size() * sizeof(DWORD)); + memcpy(coverage->subsectors, &build.collect[0], build.collect.Size() * sizeof(uint32_t)); } //========================================================================== diff --git a/src/gl/data/gl_setup.cpp b/src/gl/data/gl_setup.cpp index c34b149d58..ade8303aa4 100644 --- a/src/gl/data/gl_setup.cpp +++ b/src/gl/data/gl_setup.cpp @@ -67,7 +67,7 @@ static void DoSetMapSection(subsector_t *sub, int num) for (unsigned a = 0; a < MapSectionCollector.Size(); a++) { sub = MapSectionCollector[a]; - for (DWORD i = 0; i < sub->numlines; i++) + for (uint32_t i = 0; i < sub->numlines; i++) { seg_t * seg = sub->firstline + i; @@ -126,7 +126,7 @@ static int MergeMapSections(int num) cvertex_t vt; // first step: Set mapsection for all vertex positions. - for(DWORD i=0;i<(DWORD)numsegs;i++) + for(uint32_t i=0;i<(uint32_t)numsegs;i++) { seg_t * seg = &segs[i]; int section = seg->Subsector->mapsection; @@ -138,7 +138,7 @@ static int MergeMapSections(int num) } // second step: Check if any seg references more than one mapsection, either by subsector or by vertex - for(DWORD i=0;i<(DWORD)numsegs;i++) + for(uint32_t i=0;i<(uint32_t)numsegs;i++) { seg_t * seg = &segs[i]; int section = seg->Subsector->mapsection; @@ -219,7 +219,7 @@ static void SetMapSections() static void SpreadHackedFlag(subsector_t * sub) { // The subsector pointer hasn't been set yet! - for(DWORD i=0;inumlines;i++) + for(uint32_t i=0;inumlines;i++) { seg_t * seg = sub->firstline + i; @@ -276,7 +276,7 @@ static void PrepareSectorData() if (subsectors[i].sector == subsectors[i].render_sector) { seg_t * seg = subsectors[i].firstline; - for(DWORD j=0;jProcessParticle(&Particles[i], fakesector); } diff --git a/src/gl/scene/gl_renderhacks.cpp b/src/gl/scene/gl_renderhacks.cpp index 4dd7b7d819..6b47e704d8 100644 --- a/src/gl/scene/gl_renderhacks.cpp +++ b/src/gl/scene/gl_renderhacks.cpp @@ -260,13 +260,13 @@ bool FDrawInfo::DoOneSectorUpper(subsector_t * subsec, float Planez) { // Is there a one-sided wall in this sector? // Do this first to avoid unnecessary recursion - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { if (subsec->firstline[i].backsector == NULL) return false; if (subsec->firstline[i].PartnerSeg == NULL) return false; } - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { seg_t * seg = subsec->firstline + i; subsector_t * backsub = seg->PartnerSeg->Subsector; @@ -318,13 +318,13 @@ bool FDrawInfo::DoOneSectorLower(subsector_t * subsec, float Planez) { // Is there a one-sided wall in this subsector? // Do this first to avoid unnecessary recursion - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { if (subsec->firstline[i].backsector == NULL) return false; if (subsec->firstline[i].PartnerSeg == NULL) return false; } - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { seg_t * seg = subsec->firstline + i; subsector_t * backsub = seg->PartnerSeg->Subsector; @@ -377,13 +377,13 @@ bool FDrawInfo::DoFakeBridge(subsector_t * subsec, float Planez) { // Is there a one-sided wall in this sector? // Do this first to avoid unnecessary recursion - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { if (subsec->firstline[i].backsector == NULL) return false; if (subsec->firstline[i].PartnerSeg == NULL) return false; } - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { seg_t * seg = subsec->firstline + i; subsector_t * backsub = seg->PartnerSeg->Subsector; @@ -430,13 +430,13 @@ bool FDrawInfo::DoFakeCeilingBridge(subsector_t * subsec, float Planez) { // Is there a one-sided wall in this sector? // Do this first to avoid unnecessary recursion - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { if (subsec->firstline[i].backsector == NULL) return false; if (subsec->firstline[i].PartnerSeg == NULL) return false; } - for (DWORD i = 0; i < subsec->numlines; i++) + for (uint32_t i = 0; i < subsec->numlines; i++) { seg_t * seg = subsec->firstline + i; subsector_t * backsub = seg->PartnerSeg->Subsector; @@ -732,7 +732,7 @@ bool FDrawInfo::CheckAnchorFloor(subsector_t * sub) if (sub->hacked==3) return true; if (sub->flags & SSECF_DEGENERATE) return false; - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (!seg->PartnerSeg) return true; @@ -781,7 +781,7 @@ bool FDrawInfo::CollectSubsectorsFloor(subsector_t * sub, sector_t * anchor) if (!(sub->flags & SSECF_DEGENERATE)) { // Is not being rendered so don't bother. - if (!(ss_renderflags[DWORD(sub - subsectors)] & SSRF_PROCESSED)) return true; + if (!(ss_renderflags[uint32_t(sub - subsectors)] & SSRF_PROCESSED)) return true; if (sub->render_sector->GetTexture(sector_t::floor) != anchor->GetTexture(sector_t::floor) || sub->render_sector->GetPlaneTexZ(sector_t::floor) != anchor->GetPlaneTexZ(sector_t::floor) || @@ -794,7 +794,7 @@ bool FDrawInfo::CollectSubsectorsFloor(subsector_t * sub, sector_t * anchor) // We can assume that all segs in this subsector are connected to a subsector that has // to be checked as well - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -838,7 +838,7 @@ bool FDrawInfo::CheckAnchorCeiling(subsector_t * sub) if (sub->hacked==3) return true; if (sub->flags & SSECF_DEGENERATE) return false; - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (!seg->PartnerSeg) return true; @@ -883,7 +883,7 @@ bool FDrawInfo::CollectSubsectorsCeiling(subsector_t * sub, sector_t * anchor) if (!(sub->flags & SSECF_DEGENERATE)) { // Is not being rendererd so don't bother. - if (!(ss_renderflags[DWORD(sub-subsectors)]&SSRF_PROCESSED)) return true; + if (!(ss_renderflags[uint32_t(sub-subsectors)]&SSRF_PROCESSED)) return true; if (sub->render_sector->GetTexture(sector_t::ceiling) != anchor->GetTexture(sector_t::ceiling) || sub->render_sector->GetPlaneTexZ(sector_t::ceiling) != anchor->GetPlaneTexZ(sector_t::ceiling) || @@ -895,7 +895,7 @@ bool FDrawInfo::CollectSubsectorsCeiling(subsector_t * sub, sector_t * anchor) // We can assume that all segs in this subsector are connected to a subsector that has // to be checked as well - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -1037,7 +1037,7 @@ void FDrawInfo::CollectSectorStacksCeiling(subsector_t * sub, sector_t * anchor) if (sub->render_sector->GetGLPortal(sector_t::ceiling) != nullptr) return; // Don't bother processing unrendered subsectors - if (sub->numlines>2 && !(ss_renderflags[DWORD(sub-subsectors)]&SSRF_PROCESSED)) return; + if (sub->numlines>2 && !(ss_renderflags[uint32_t(sub-subsectors)]&SSRF_PROCESSED)) return; // Must be the exact same visplane sector_t * me = gl_FakeFlat(sub->render_sector, &fakesec, false); @@ -1053,7 +1053,7 @@ void FDrawInfo::CollectSectorStacksCeiling(subsector_t * sub, sector_t * anchor) HandledSubsectors.Push (sub); - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -1080,7 +1080,7 @@ void FDrawInfo::CollectSectorStacksFloor(subsector_t * sub, sector_t * anchor) if (sub->render_sector->GetGLPortal(sector_t::floor) != nullptr) return; // Don't bother processing unrendered subsectors - if (sub->numlines>2 && !(ss_renderflags[DWORD(sub-subsectors)]&SSRF_PROCESSED)) return; + if (sub->numlines>2 && !(ss_renderflags[uint32_t(sub-subsectors)]&SSRF_PROCESSED)) return; // Must be the exact same visplane sector_t * me = gl_FakeFlat(sub->render_sector, &fakesec, false); @@ -1096,7 +1096,7 @@ void FDrawInfo::CollectSectorStacksFloor(subsector_t * sub, sector_t * anchor) HandledSubsectors.Push (sub); - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -1130,7 +1130,7 @@ void FDrawInfo::ProcessSectorStacks() if (ss_renderflags[sub-subsectors] & SSRF_PROCESSED) { HandledSubsectors.Clear(); - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -1143,7 +1143,7 @@ void FDrawInfo::ProcessSectorStacks() for(unsigned int j=0;jportalcoverage[sector_t::ceiling].subsectors == NULL) { @@ -1174,7 +1174,7 @@ void FDrawInfo::ProcessSectorStacks() if (ss_renderflags[sub-subsectors] & SSRF_PROCESSED) { HandledSubsectors.Clear(); - for(DWORD j=0;jnumlines;j++) + for(uint32_t j=0;jnumlines;j++) { seg_t * seg = sub->firstline + j; if (seg->PartnerSeg) @@ -1188,7 +1188,7 @@ void FDrawInfo::ProcessSectorStacks() for(unsigned int j=0;jportalcoverage[sector_t::floor].subsectors == NULL) { diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index 30b7344b0e..e87737da06 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -162,7 +162,7 @@ void GLSprite::CalculateVertices(FVector3 *v) // [fgsfds] check sprite type mask - DWORD spritetype = (DWORD)-1; + uint32_t spritetype = (uint32_t)-1; if (actor != nullptr) spritetype = actor->renderflags & RF_SPRITETYPEMASK; // [Nash] is a flat sprite @@ -758,7 +758,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal) topclip = rendersector->PortalBlocksMovement(sector_t::ceiling) ? LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::ceiling); bottomclip = rendersector->PortalBlocksMovement(sector_t::floor) ? -LARGE_VALUE : rendersector->GetPortalPlaneZ(sector_t::floor); - DWORD spritetype = (thing->renderflags & RF_SPRITETYPEMASK); + uint32_t spritetype = (thing->renderflags & RF_SPRITETYPEMASK); x = thingpos.X; z = thingpos.Z; y = thingpos.Y; diff --git a/src/gl/system/gl_wipe.cpp b/src/gl/system/gl_wipe.cpp index 33d8a8ddf7..88b9ef0157 100644 --- a/src/gl/system/gl_wipe.cpp +++ b/src/gl/system/gl_wipe.cpp @@ -527,7 +527,7 @@ bool OpenGLFrameBuffer::Wiper_Burn::Run(int ticks, OpenGLFrameBuffer *fb) uint8_t rgb_buffer[WIDTH*HEIGHT*4]; const uint8_t *src = BurnArray; - DWORD *dest = (DWORD *)rgb_buffer; + uint32_t *dest = (uint32_t *)rgb_buffer; for (int y = HEIGHT; y != 0; --y) { for (int x = WIDTH; x != 0; --x) diff --git a/src/gl/textures/gl_material.cpp b/src/gl/textures/gl_material.cpp index 1ebc1c4885..e2be0b35b4 100644 --- a/src/gl/textures/gl_material.cpp +++ b/src/gl/textures/gl_material.cpp @@ -130,7 +130,7 @@ unsigned char *FGLTexture::LoadHiresTexture(FTexture *tex, int *width, int *heig { // This is a crappy Doomsday color keyed image // We have to remove the key manually. :( - DWORD * dwdata=(DWORD*)buffer; + uint32_t * dwdata=(uint32_t*)buffer; for (int i=(w*h);i>0;i--) { if (dwdata[i]==0xffffff00 || dwdata[i]==0xffff00ff) dwdata[i]=0; @@ -285,7 +285,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla if (translation <= 0) translation = -translation; else { - alphatrans = (gl.legacyMode && DWORD(translation) == TRANSLATION(TRANSLATION_Standard, 8)); + alphatrans = (gl.legacyMode && uint32_t(translation) == TRANSLATION(TRANSLATION_Standard, 8)); translation = GLTranslationPalette::GetInternalTranslation(translation); } @@ -319,7 +319,7 @@ const FHardwareTexture *FGLTexture::Bind(int texunit, int clampmode, int transla // need to do software warping FWarpTexture *wt = static_cast(tex); unsigned char *warpbuffer = new unsigned char[w*h*4]; - WarpBuffer((DWORD*)warpbuffer, (const DWORD*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, r_FrameTime, wt->Speed, tex->bWarped); + WarpBuffer((uint32_t*)warpbuffer, (const uint32_t*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, r_FrameTime, wt->Speed, tex->bWarped); delete[] buffer; buffer = warpbuffer; wt->GenTime = r_FrameTime; diff --git a/src/gl/textures/gl_texture.cpp b/src/gl/textures/gl_texture.cpp index c87db7e3d3..43aa404b75 100644 --- a/src/gl/textures/gl_texture.cpp +++ b/src/gl/textures/gl_texture.cpp @@ -167,7 +167,7 @@ void gl_GenerateGlobalBrightmapFromColormap() // component becomes one. // //=========================================================================== -static PalEntry averageColor(const DWORD *data, int size, int maxout) +static PalEntry averageColor(const uint32_t *data, int size, int maxout) { int i; unsigned int r, g, b; @@ -311,7 +311,7 @@ void FTexture::GetGlowColor(float *data) if (buffer) { - gl_info.GlowColor = averageColor((DWORD *) buffer, w*h, 153); + gl_info.GlowColor = averageColor((uint32_t *) buffer, w*h, 153); delete[] buffer; } @@ -426,10 +426,10 @@ void FTexture::CheckTrans(unsigned char * buffer, int size, int trans) gl_info.mIsTransparent = trans; if (trans == -1) { - DWORD * dwbuf = (DWORD*)buffer; + uint32_t * dwbuf = (uint32_t*)buffer; for(int i=0;i>24; + uint32_t alpha = dwbuf[i]>>24; if (alpha != 0xff && alpha != 0) { @@ -457,7 +457,7 @@ void FTexture::CheckTrans(unsigned char * buffer, int size, int trans) #define SOME_MASK 0x00ffffff #endif -#define CHKPIX(ofs) (l1[(ofs)*4+MSB]==255 ? (( ((DWORD*)l1)[0] = ((DWORD*)l1)[ofs]&SOME_MASK), trans=true ) : false) +#define CHKPIX(ofs) (l1[(ofs)*4+MSB]==255 ? (( ((uint32_t*)l1)[0] = ((uint32_t*)l1)[ofs]&SOME_MASK), trans=true ) : false) bool FTexture::SmoothEdges(unsigned char * buffer,int w, int h) { diff --git a/src/gl/utility/gl_clock.cpp b/src/gl/utility/gl_clock.cpp index 470ba3fda6..7f41431b4f 100644 --- a/src/gl/utility/gl_clock.cpp +++ b/src/gl/utility/gl_clock.cpp @@ -104,7 +104,7 @@ void gl_CalculateCPUSpeed () do { QueryPerformanceCounter (&count2); - } while ((DWORD)((unsigned __int64)count2.QuadPart - (unsigned __int64)count1.QuadPart) < minDiff); + } while ((uint32_t)((uint64_t)count2.QuadPart - (uint64_t)count1.QuadPart) < minDiff); ClockCalibration = __rdtsc() - ClockCalibration; QueryPerformanceCounter (&count2); SetPriorityClass (GetCurrentProcess (), NORMAL_PRIORITY_CLASS); diff --git a/src/oplsynth/opl_mus_player.cpp b/src/oplsynth/opl_mus_player.cpp index 5c8d2d2a5b..55dd132cef 100644 --- a/src/oplsynth/opl_mus_player.cpp +++ b/src/oplsynth/opl_mus_player.cpp @@ -75,8 +75,8 @@ fail: delete[] scoredata; } // Check for RDosPlay raw OPL format - if (((DWORD *)scoredata)[0] == MAKE_ID('R','A','W','A') && - ((DWORD *)scoredata)[1] == MAKE_ID('D','A','T','A')) + if (((uint32_t *)scoredata)[0] == MAKE_ID('R','A','W','A') && + ((uint32_t *)scoredata)[1] == MAKE_ID('D','A','T','A')) { RawPlayer = RDosPlay; if (*(uint16_t *)(scoredata + 8) == 0) @@ -86,16 +86,16 @@ fail: delete[] scoredata; SamplesPerTick = LittleShort(*(uint16_t *)(scoredata + 8)) / ADLIB_CLOCK_MUL; } // Check for DosBox OPL dump - else if (((DWORD *)scoredata)[0] == MAKE_ID('D','B','R','A') && - ((DWORD *)scoredata)[1] == MAKE_ID('W','O','P','L')) + else if (((uint32_t *)scoredata)[0] == MAKE_ID('D','B','R','A') && + ((uint32_t *)scoredata)[1] == MAKE_ID('W','O','P','L')) { if (LittleShort(((uint16_t *)scoredata)[5]) == 1) { RawPlayer = DosBox1; SamplesPerTick = OPL_SAMPLE_RATE / 1000; - ScoreLen = MIN(ScoreLen - 24, LittleLong(((DWORD *)scoredata)[4])) + 24; + ScoreLen = MIN(ScoreLen - 24, LittleLong(((uint32_t *)scoredata)[4])) + 24; } - else if (((DWORD *)scoredata)[2] == MAKE_ID(2,0,0,0)) + else if (((uint32_t *)scoredata)[2] == MAKE_ID(2,0,0,0)) { bool okay = true; if (scoredata[21] != 0) @@ -113,7 +113,7 @@ fail: delete[] scoredata; RawPlayer = DosBox2; SamplesPerTick = OPL_SAMPLE_RATE / 1000; int headersize = 0x1A + scoredata[0x19]; - ScoreLen = MIN(ScoreLen - headersize, LittleLong(((DWORD *)scoredata)[3]) * 2) + headersize; + ScoreLen = MIN(ScoreLen - headersize, LittleLong(((uint32_t *)scoredata)[3]) * 2) + headersize; } else { @@ -122,7 +122,7 @@ fail: delete[] scoredata; } } // Check for modified IMF format (includes a header) - else if (((DWORD *)scoredata)[0] == MAKE_ID('A','D','L','I') && + else if (((uint32_t *)scoredata)[0] == MAKE_ID('A','D','L','I') && scoredata[4] == 'B' && scoredata[5] == 1) { int songlen; @@ -143,7 +143,7 @@ fail: delete[] scoredata; scoredata = NULL; return; } - songlen = LittleLong(*(DWORD *)score); + songlen = LittleLong(*(uint32_t *)score); if (songlen != 0 && (songlen +=4) < ScoreLen - (score - scoredata)) { ScoreLen = songlen + int(score - scoredata); @@ -207,7 +207,7 @@ void OPLmusicFile::Restart () while (*score++ != '\0') {} } score++; // Skip unknown byte - if (*(DWORD *)score != 0) + if (*(uint32_t *)score != 0) { score += 4; // Skip song length } @@ -487,7 +487,7 @@ int OPLmusicFile::PlayTick () delay = 0; while (delay == 0 && score + 4 - scoredata <= ScoreLen) { - if (*(DWORD *)score == 0xFFFFFFFF) + if (*(uint32_t *)score == 0xFFFFFFFF) { // This is a special value that means to end the song. return 0; } diff --git a/src/posix/cocoa/i_system.mm b/src/posix/cocoa/i_system.mm index 35b71c64b8..f36caca248 100644 --- a/src/posix/cocoa/i_system.mm +++ b/src/posix/cocoa/i_system.mm @@ -53,7 +53,7 @@ EXTERN_CVAR(String, language) -DWORD LanguageIDs[4]; +uint32_t LanguageIDs[4]; int (*I_GetTime)(bool saveMS); @@ -88,7 +88,7 @@ void SetLanguageIDs() { size_t langlen = strlen(language); - DWORD lang = (langlen < 2 || langlen > 3) + uint32_t lang = (langlen < 2 || langlen > 3) ? MAKE_ID('e', 'n', 'u', '\0') : MAKE_ID(language[0], language[1], language[2], '\0'); diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index 1e894c8715..906fc413df 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -1376,7 +1376,7 @@ void I_ClosestResolution(int *width, int *height, int bits) int twidth, theight; int cwidth = 0, cheight = 0; int iteration; - DWORD closest = DWORD(-1); + uint32_t closest = uint32_t(-1); for (iteration = 0; iteration < 2; ++iteration) { @@ -1394,7 +1394,7 @@ void I_ClosestResolution(int *width, int *height, int bits) continue; } - const DWORD dist = (twidth - *width) * (twidth - *width) + const uint32_t dist = (twidth - *width) * (twidth - *width) + (theight - *height) * (theight - *height); if (dist < closest) @@ -1405,7 +1405,7 @@ void I_ClosestResolution(int *width, int *height, int bits) } } - if (closest != DWORD(-1)) + if (closest != uint32_t(-1)) { *width = cwidth; *height = cheight; diff --git a/src/posix/cocoa/st_console.mm b/src/posix/cocoa/st_console.mm index e1d405f59f..67f906c691 100644 --- a/src/posix/cocoa/st_console.mm +++ b/src/posix/cocoa/st_console.mm @@ -53,7 +53,7 @@ static NSColor* RGB(const PalEntry& color) return RGB(color.r, color.g, color.b); } -static NSColor* RGB(const DWORD color) +static NSColor* RGB(const uint32_t color) { return RGB(PalEntry(color)); } diff --git a/src/posix/i_system.h b/src/posix/i_system.h index e4369d7496..2110007cfd 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -43,7 +43,7 @@ enum LANGIDX_SysPreferred, LANGIDX_SysDefault }; -extern DWORD LanguageIDs[4]; +extern uint32_t LanguageIDs[4]; extern void SetLanguageIDs (); // Called by DoomMain. diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index 16c1ff1c8c..e512adb736 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -195,7 +195,7 @@ void I_ClosestResolution (int *width, int *height, int bits) int twidth, theight; int cwidth = 0, cheight = 0; int iteration; - DWORD closest = 4294967295u; + uint32_t closest = 4294967295u; for (iteration = 0; iteration < 2; iteration++) { @@ -208,7 +208,7 @@ void I_ClosestResolution (int *width, int *height, int bits) if (iteration == 0 && (twidth < *width || theight < *height)) continue; - DWORD dist = (twidth - *width) * (twidth - *width) + uint32_t dist = (twidth - *width) * (twidth - *width) + (theight - *height) * (theight - *height); if (dist < closest) diff --git a/src/posix/sdl/i_system.cpp b/src/posix/sdl/i_system.cpp index 8e4e63c4fc..e00f137a7a 100644 --- a/src/posix/sdl/i_system.cpp +++ b/src/posix/sdl/i_system.cpp @@ -84,7 +84,7 @@ int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad); int I_PickIWad_Cocoa (WadStuff *wads, int numwads, bool showwin, int defaultiwad); #endif -DWORD LanguageIDs[4]; +uint32_t LanguageIDs[4]; int (*I_GetTime) (bool saveMS); int (*I_WaitForTic) (int); @@ -123,7 +123,7 @@ void SetLanguageIDs () { size_t langlen = strlen(language); - DWORD lang = (langlen < 2 || langlen > 3) ? + uint32_t lang = (langlen < 2 || langlen > 3) ? MAKE_ID('e','n','u','\0') : MAKE_ID(language[0],language[1],language[2],'\0'); diff --git a/src/posix/sdl/i_timer.cpp b/src/posix/sdl/i_timer.cpp index bf02415eea..aad0192828 100644 --- a/src/posix/sdl/i_timer.cpp +++ b/src/posix/sdl/i_timer.cpp @@ -13,14 +13,14 @@ #include "templates.h" -static DWORD TicStart; -static DWORD BaseTime; +static uint32_t TicStart; +static uint32_t BaseTime; static int TicFrozen; // Signal based timer. static Semaphore timerWait; static int tics; -static DWORD sig_start; +static uint32_t sig_start; void I_SelectTimer(); @@ -54,7 +54,7 @@ int I_GetTimePolled (bool saveMS) return TicFrozen; } - DWORD tm = SDL_GetTicks(); + uint32_t tm = SDL_GetTicks(); if (saveMS) { @@ -179,7 +179,7 @@ void I_SelectTimer() // Returns the fractional amount of a tic passed since the most recent tic double I_GetTimeFrac (uint32_t *ms) { - DWORD now = SDL_GetTicks (); + uint32_t now = SDL_GetTicks (); if (ms) *ms = TicStart + (1000 / TICRATE); if (TicStart == 0) { diff --git a/src/r_data/colormaps.cpp b/src/r_data/colormaps.cpp index 209221d934..eca7767162 100644 --- a/src/r_data/colormaps.cpp +++ b/src/r_data/colormaps.cpp @@ -292,7 +292,7 @@ void FDynamicColormap::BuildLights () Fade.r, Fade.g, Fade.b, l * (256 / NUMCOLORMAPS)); shade = Maps + 256*l; - if ((DWORD)Color == MAKERGB(255,255,255)) + if ((uint32_t)Color == MAKERGB(255,255,255)) { // White light, so we can just pick the colors directly for (c = 0; c < 256; c++) { @@ -485,9 +485,9 @@ void R_InitColormaps () cm.blend = 0; fakecmaps.Push(cm); - DWORD NumLumps = Wads.GetNumLumps(); + uint32_t NumLumps = Wads.GetNumLumps(); - for (DWORD i = 0; i < NumLumps; i++) + for (uint32_t i = 0; i < NumLumps; i++) { if (Wads.GetLumpNamespace(i) == ns_colormaps) { @@ -650,7 +650,7 @@ static bool R_CheckForFixedLights(const uint8_t *colormaps) // //========================================================================== -DWORD R_ColormapNumForName (const char *name) +uint32_t R_ColormapNumForName (const char *name) { if (strnicmp (name, "COLORMAP", 8)) { // COLORMAP always returns 0 @@ -674,8 +674,8 @@ DWORD R_ColormapNumForName (const char *name) // //========================================================================== -DWORD R_BlendForColormap (DWORD map) +uint32_t R_BlendForColormap (uint32_t map) { return APART(map) ? map : - map < fakecmaps.Size() ? DWORD(fakecmaps[map].blend) : 0; + map < fakecmaps.Size() ? uint32_t(fakecmaps[map].blend) : 0; } \ No newline at end of file diff --git a/src/r_data/colormaps.h b/src/r_data/colormaps.h index 4154a4189f..6caccdf30d 100644 --- a/src/r_data/colormaps.h +++ b/src/r_data/colormaps.h @@ -6,9 +6,9 @@ struct FSWColormap; void R_InitColormaps (); void R_DeinitColormaps (); -DWORD R_ColormapNumForName(const char *name); // killough 4/4/98 +uint32_t R_ColormapNumForName(const char *name); // killough 4/4/98 void R_SetDefaultColormap (const char *name); // [RH] change normal fadetable -DWORD R_BlendForColormap (DWORD map); // [RH] return calculated blend for a colormap +uint32_t R_BlendForColormap (uint32_t map); // [RH] return calculated blend for a colormap extern FSWColormap realcolormaps; // [RH] make the colormaps externally visible extern size_t numfakecmaps; diff --git a/src/r_data/r_translate.h b/src/r_data/r_translate.h index bd13550cc2..f3c2c55c36 100644 --- a/src/r_data/r_translate.h +++ b/src/r_data/r_translate.h @@ -81,15 +81,15 @@ extern TAutoGrowArray translationtables[NUM_TRANS #define TRANSLATION_MASK ((1<> TRANSLATION_SHIFT; } -inline int GetTranslationIndex(DWORD trans) +inline int GetTranslationIndex(uint32_t trans) { return (trans&TRANSLATION_MASK); } diff --git a/src/r_data/sprites.cpp b/src/r_data/sprites.cpp index d4c0465125..d932e6377b 100644 --- a/src/r_data/sprites.cpp +++ b/src/r_data/sprites.cpp @@ -21,7 +21,7 @@ void gl_InitModels(); // and range check thing_t sprites patches TArray sprites; TArray SpriteFrames; -DWORD NumStdSprites; // The first x sprites that don't belong to skins. +uint32_t NumStdSprites; // The first x sprites that don't belong to skins. struct spriteframewithrotate : public spriteframe_t { @@ -262,7 +262,7 @@ void R_InitSpriteDefs () char Frame; } *vhashes; unsigned int i, j, smax, vmax; - DWORD intname; + uint32_t intname; spriteframewithrotate sprtemp[MAX_SPRITE_FRAMES]; @@ -510,7 +510,7 @@ void R_InitSkins (void) spritedef_t temp; int sndlumps[NUMSKINSOUNDS]; char key[65]; - DWORD intname, crouchname; + uint32_t intname, crouchname; unsigned i; int j, k, base; int lastlump; @@ -574,13 +574,13 @@ void R_InitSkins (void) { for (j = 3; j >= 0; j--) sc.String[j] = toupper (sc.String[j]); - intname = *((DWORD *)sc.String); + intname = *((uint32_t *)sc.String); } else if (0 == stricmp (key, "crouchsprite")) { for (j = 3; j >= 0; j--) sc.String[j] = toupper (sc.String[j]); - crouchname = *((DWORD *)sc.String); + crouchname = *((uint32_t *)sc.String); } else if (0 == stricmp (key, "face")) { @@ -787,7 +787,7 @@ void R_InitSkins (void) for (k = base + 1; Wads.GetLumpNamespace(k) == basens; k++) { char lname[9]; - DWORD lnameint; + uint32_t lnameint; Wads.GetLumpName (lname, k); memcpy(&lnameint, lname, 4); if (lnameint == intname) diff --git a/src/r_data/voxels.cpp b/src/r_data/voxels.cpp index 70fcc9a3b1..e9b30cd79c 100644 --- a/src/r_data/voxels.cpp +++ b/src/r_data/voxels.cpp @@ -482,7 +482,7 @@ void FVoxel::RemovePalette() // //========================================================================== -static bool VOX_ReadSpriteNames(FScanner &sc, TArray &vsprites) +static bool VOX_ReadSpriteNames(FScanner &sc, TArray &vsprites) { vsprites.Clear(); while (sc.GetString()) @@ -644,7 +644,7 @@ void R_InitVoxels() while ((lump = Wads.FindLump("VOXELDEF", &lastlump)) != -1) { FScanner sc(lump); - TArray vsprites; + TArray vsprites; while (VOX_ReadSpriteNames(sc, vsprites)) { diff --git a/src/r_sky.cpp b/src/r_sky.cpp index f2804bad77..ac7db73a40 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -161,7 +161,7 @@ void R_InitSkyMap () // //========================================================================== -void R_UpdateSky (DWORD mstime) +void R_UpdateSky (uint32_t mstime) { // Scroll the sky double ms = (double)mstime * FRACUNIT; diff --git a/src/r_sky.h b/src/r_sky.h index 1328179836..b30acbd7e3 100644 --- a/src/r_sky.h +++ b/src/r_sky.h @@ -38,6 +38,6 @@ extern int freelookviewheight; // Called whenever the sky changes. void R_InitSkyMap (); -void R_UpdateSky (DWORD mstime); +void R_UpdateSky (uint32_t mstime); #endif //__R_SKY_H__ diff --git a/src/r_state.h b/src/r_state.h index 9cd8400b4e..7685405d38 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -40,7 +40,7 @@ extern "C" int viewheight; // Lookup tables for map data. // extern TArray sprites; -extern DWORD NumStdSprites; +extern uint32_t NumStdSprites; extern TArray vertexdatas; diff --git a/src/swrenderer/r_swcanvas.cpp b/src/swrenderer/r_swcanvas.cpp index a105bbc2fb..43f4b8cfd3 100644 --- a/src/swrenderer/r_swcanvas.cpp +++ b/src/swrenderer/r_swcanvas.cpp @@ -549,7 +549,7 @@ void SWCanvas::DrawLine(DCanvas *canvas, int x0, int y0, int x1, int y1, int pal } else { // x-major line - fixed_t errorAdj = (((DWORD)deltaY << 16) / (DWORD)deltaX) & 0xffff; + fixed_t errorAdj = (((uint32_t)deltaY << 16) / (uint32_t)deltaX) & 0xffff; if (WeightingScale == 0) { @@ -634,10 +634,10 @@ void SWCanvas::PUTTRANSDOT(DCanvas *canvas, int xx, int yy, int basecolor, int l else if (!r_blendmethod) { uint8_t *spot = canvas->GetBuffer() + oldyyshifted + xx; - DWORD *bg2rgb = Col2RGB8[1 + level]; - DWORD *fg2rgb = Col2RGB8[63 - level]; - DWORD fg = fg2rgb[basecolor]; - DWORD bg = bg2rgb[*spot]; + uint32_t *bg2rgb = Col2RGB8[1 + level]; + uint32_t *fg2rgb = Col2RGB8[63 - level]; + uint32_t fg = fg2rgb[basecolor]; + uint32_t bg = bg2rgb[*spot]; bg = (fg + bg) | 0x1f07c1f; *spot = RGB32k.All[bg&(bg >> 15)]; } @@ -771,8 +771,8 @@ void SWCanvas::Dim(DCanvas *canvas, PalEntry color, float damount, int x1, int y } else { - DWORD *bg2rgb; - DWORD fg; + uint32_t *bg2rgb; + uint32_t fg; uint8_t *spot = canvas->GetBuffer() + x1 + y1*Pitch; int gap = Pitch - w; @@ -800,7 +800,7 @@ void SWCanvas::Dim(DCanvas *canvas, PalEntry color, float damount, int x1, int y { for (int x = w; x != 0; x--) { - DWORD bg; + uint32_t bg; bg = bg2rgb[(*spot) & 0xff]; bg = (fg + bg) | 0x1f07c1f; diff --git a/src/swrenderer/scene/r_portal.cpp b/src/swrenderer/scene/r_portal.cpp index 7e571635a3..c725af6159 100644 --- a/src/swrenderer/scene/r_portal.cpp +++ b/src/swrenderer/scene/r_portal.cpp @@ -279,7 +279,7 @@ namespace swrenderer // [ZZ] check depth. fill portal with black if it's exceeding the visual recursion limit, and continue like nothing happened. if (depth >= r_portal_recursions) { - uint8_t color = (uint8_t)BestColor((DWORD *)GPalette.BaseColors, 0, 0, 0, 0, 255); + uint8_t color = (uint8_t)BestColor((uint32_t *)GPalette.BaseColors, 0, 0, 0, 0, 255); int spacing = viewport->RenderTarget->GetPitch(); for (int x = pds->x1; x < pds->x2; x++) { @@ -479,7 +479,7 @@ namespace swrenderer if (viewport->RenderTarget->IsBgra()) // Assuming this is just a debug function return; - uint8_t color = (uint8_t)BestColor((DWORD *)GPalette.BaseColors, 255, 0, 0, 0, 255); + uint8_t color = (uint8_t)BestColor((uint32_t *)GPalette.BaseColors, 255, 0, 0, 0, 255); uint8_t* pixels = viewport->RenderTarget->GetBuffer(); // top edge diff --git a/src/textures/buildtexture.cpp b/src/textures/buildtexture.cpp index c561600246..cb7786200c 100644 --- a/src/textures/buildtexture.cpp +++ b/src/textures/buildtexture.cpp @@ -147,12 +147,12 @@ const uint8_t *FBuildTexture::GetColumn (unsigned int column, const Span **spans void FTextureManager::AddTiles (void *tiles) { -// int numtiles = LittleLong(((DWORD *)tiles)[1]); // This value is not reliable - int tilestart = LittleLong(((DWORD *)tiles)[2]); - int tileend = LittleLong(((DWORD *)tiles)[3]); +// int numtiles = LittleLong(((uint32_t *)tiles)[1]); // This value is not reliable + int tilestart = LittleLong(((uint32_t *)tiles)[2]); + int tileend = LittleLong(((uint32_t *)tiles)[3]); const uint16_t *tilesizx = &((const uint16_t *)tiles)[8]; const uint16_t *tilesizy = &tilesizx[tileend - tilestart + 1]; - const DWORD *picanm = (const DWORD *)&tilesizy[tileend - tilestart + 1]; + const uint32_t *picanm = (const uint32_t *)&tilesizy[tileend - tilestart + 1]; uint8_t *tiledata = (uint8_t *)&picanm[tileend - tilestart + 1]; for (int i = tilestart; i <= tileend; ++i) @@ -160,7 +160,7 @@ void FTextureManager::AddTiles (void *tiles) int pic = i - tilestart; int width = LittleShort(tilesizx[pic]); int height = LittleShort(tilesizy[pic]); - DWORD anm = LittleLong(picanm[pic]); + uint32_t anm = LittleLong(picanm[pic]); int xoffs = (int8_t)((anm >> 8) & 255) + width/2; int yoffs = (int8_t)((anm >> 16) & 255) + height/2; int size = width*height; @@ -253,14 +253,14 @@ void FTextureManager::AddTiles (void *tiles) int FTextureManager::CountTiles (void *tiles) { - int version = LittleLong(*(DWORD *)tiles); + int version = LittleLong(*(uint32_t *)tiles); if (version != 1) { return 0; } - int tilestart = LittleLong(((DWORD *)tiles)[2]); - int tileend = LittleLong(((DWORD *)tiles)[3]); + int tilestart = LittleLong(((uint32_t *)tiles)[2]); + int tileend = LittleLong(((uint32_t *)tiles)[3]); return tileend >= tilestart ? tileend - tilestart + 1 : 0; } diff --git a/src/textures/texture.cpp b/src/textures/texture.cpp index fa7d9fec64..74f9cd04be 100644 --- a/src/textures/texture.cpp +++ b/src/textures/texture.cpp @@ -850,7 +850,7 @@ void FTexture::SetScaledSize(int fitwidth, int fitheight) namespace { - PalEntry averageColor(const DWORD *data, int size, int maxout) + PalEntry averageColor(const uint32_t *data, int size, int maxout) { int i; unsigned int r, g, b; @@ -901,10 +901,10 @@ PalEntry FTexture::GetSkyCapColor(bool bottom) const uint32_t *buffer = (const uint32_t *)bitmap.GetPixels(); if (buffer) { - CeilingSkyColor = averageColor((DWORD *)buffer, w * MIN(30, h), 0); + CeilingSkyColor = averageColor((uint32_t *)buffer, w * MIN(30, h), 0); if (h>30) { - FloorSkyColor = averageColor(((DWORD *)buffer) + (h - 30)*w, w * 30, 0); + FloorSkyColor = averageColor(((uint32_t *)buffer) + (h - 30)*w, w * 30, 0); } else FloorSkyColor = CeilingSkyColor; } diff --git a/src/textures/textures.h b/src/textures/textures.h index 0982f9a8e9..c5a7a9819c 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -57,11 +57,11 @@ struct FAnimDef uint16_t CurFrame; uint8_t AnimType; bool bDiscrete; // taken out of AnimType to have better control - DWORD SwitchTime; // Time to advance to next frame + uint32_t SwitchTime; // Time to advance to next frame struct FAnimFrame { - DWORD SpeedMin; // Speeds are in ms, not tics - DWORD SpeedRange; + uint32_t SpeedMin; // Speeds are in ms, not tics + uint32_t SpeedRange; FTextureID FramePic; } Frames[1]; enum @@ -73,7 +73,7 @@ struct FAnimDef ANIM_Random }; - void SetSwitchTime (DWORD mstime); + void SetSwitchTime (uint32_t mstime); }; struct FSwitchDef @@ -110,7 +110,7 @@ struct patch_t int16_t height; int16_t leftoffset; // pixels to the left of origin int16_t topoffset; // pixels below the origin - DWORD columnofs[]; // only [width] used + uint32_t columnofs[]; // only [width] used // the [0] is &columnofs[width] }; @@ -470,7 +470,7 @@ public: int NumTextures () const { return (int)Textures.Size(); } - void UpdateAnimations (DWORD mstime); + void UpdateAnimations (uint32_t mstime); int GuesstimateNumTextures (); FSwitchDef *FindSwitch (FTextureID texture); @@ -493,7 +493,7 @@ private: void FixAnimations (); void InitAnimated (); void InitAnimDefs (); - FAnimDef *AddSimpleAnim (FTextureID picnum, int animcount, DWORD speedmin, DWORD speedrange=0); + FAnimDef *AddSimpleAnim (FTextureID picnum, int animcount, uint32_t speedmin, uint32_t speedrange=0); FAnimDef *AddComplexAnim (FTextureID picnum, const TArray &frames); void ParseAnim (FScanner &sc, int usetype); FAnimDef *ParseRangeAnim (FScanner &sc, FTextureID picnum, int usetype, bool missing); @@ -501,7 +501,7 @@ private: void ParseWarp(FScanner &sc); void ParseCameraTexture(FScanner &sc); FTextureID ParseFramenum (FScanner &sc, FTextureID basepicnum, int usetype, bool allowMissing); - void ParseTime (FScanner &sc, DWORD &min, DWORD &max); + void ParseTime (FScanner &sc, uint32_t &min, uint32_t &max); FTexture *Texture(FTextureID id) { return Textures[id.GetIndex()].Texture; } void SetTranslation (FTextureID fromtexnum, FTextureID totexnum); void ParseAnimatedDoor(FScanner &sc); @@ -569,7 +569,7 @@ public: void SetSpeed(float fac) { Speed = fac; } FTexture *GetRedirect(bool wantwarped); - DWORD GenTime; + uint32_t GenTime; float Speed; int WidthOffsetMultiplier, HeightOffsetMultiplier; // [mxd] protected: @@ -577,7 +577,7 @@ protected: uint8_t *Pixels; Span **Spans; - virtual void MakeTexture (DWORD time); + virtual void MakeTexture (uint32_t time); int NextPo2 (int v); // [mxd] void SetupMultipliers (int width, int height); // [mxd] }; diff --git a/src/textures/warptexture.cpp b/src/textures/warptexture.cpp index 704effc5c2..c39410522f 100644 --- a/src/textures/warptexture.cpp +++ b/src/textures/warptexture.cpp @@ -85,7 +85,7 @@ bool FWarpTexture::CheckModified () const uint8_t *FWarpTexture::GetPixels () { - DWORD time = r_FrameTime; + uint32_t time = r_FrameTime; if (Pixels == NULL || time != GenTime) { @@ -96,7 +96,7 @@ const uint8_t *FWarpTexture::GetPixels () const uint32_t *FWarpTexture::GetPixelsBgra() { - DWORD time = r_FrameTime; + uint32_t time = r_FrameTime; if (Pixels == NULL || time != GenTime) { MakeTexture(time); @@ -115,7 +115,7 @@ const uint32_t *FWarpTexture::GetPixelsBgra() const uint8_t *FWarpTexture::GetColumn (unsigned int column, const Span **spans_out) { - DWORD time = r_FrameTime; + uint32_t time = r_FrameTime; if (Pixels == NULL || time != GenTime) { @@ -144,7 +144,7 @@ const uint8_t *FWarpTexture::GetColumn (unsigned int column, const Span **spans_ } -void FWarpTexture::MakeTexture(DWORD time) +void FWarpTexture::MakeTexture(uint32_t time) { const uint8_t *otherpix = SourcePic->GetPixels(); diff --git a/src/timidity/instrum_sf2.cpp b/src/timidity/instrum_sf2.cpp index e64bfa3e4e..a2d747b927 100644 --- a/src/timidity/instrum_sf2.cpp +++ b/src/timidity/instrum_sf2.cpp @@ -20,8 +20,8 @@ class CBadVer {}; struct ListHandler { - DWORD ID; - void (*Parser)(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); + uint32_t ID; + void (*Parser)(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); }; enum @@ -155,15 +155,15 @@ static const SFGenComposite DefaultGenerators = -1 // overridingRootKey }; -static void ParseIfil(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseSmpl(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseSm24(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParsePhdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseMod(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseGen(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseInst(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); -static void ParseShdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen); +static void ParseIfil(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseSmpl(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseSm24(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParsePhdr(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseBag(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseMod(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseGen(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseInst(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); +static void ParseShdr(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen); ListHandler INFOHandlers[] = { @@ -218,9 +218,9 @@ static int32_t calc_rate(Renderer *song, int diff, double sec) } -static inline DWORD read_id(FileReader *f) +static inline uint32_t read_id(FileReader *f) { - DWORD id; + uint32_t id; if (f->Read(&id, 4) != 4) { throw CIOErr(); @@ -268,9 +268,9 @@ static inline int read_sword(FileReader *f) return LittleShort(x); } -static inline DWORD read_dword(FileReader *f) +static inline uint32_t read_dword(FileReader *f) { - DWORD x; + uint32_t x; if (f->Read(&x, 4) != 4) { throw CIOErr(); @@ -287,7 +287,7 @@ static inline void read_name(FileReader *f, char name[21]) name[20] = 0; } -static inline void skip_chunk(FileReader *f, DWORD len) +static inline void skip_chunk(FileReader *f, uint32_t len) { // RIFF, like IFF, adds an extra pad byte to the end of // odd-sized chunks so that new chunks are always on even @@ -298,7 +298,7 @@ static inline void skip_chunk(FileReader *f, DWORD len) } } -static void check_list(FileReader *f, DWORD id, DWORD filelen, DWORD &chunklen) +static void check_list(FileReader *f, uint32_t id, uint32_t filelen, uint32_t &chunklen) { if (read_id(f) != ID_LIST) { @@ -315,7 +315,7 @@ static void check_list(FileReader *f, DWORD id, DWORD filelen, DWORD &chunklen) } } -static void ParseIfil(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseIfil(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { uint16_t major, minor; @@ -334,11 +334,11 @@ static void ParseIfil(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) sf2->MinorVersion = minor; } -static void ParseLIST(SFFile *sf2, FileReader *f, DWORD chunklen, ListHandler *handlers) +static void ParseLIST(SFFile *sf2, FileReader *f, uint32_t chunklen, ListHandler *handlers) { ListHandler *handler; - DWORD id; - DWORD len; + uint32_t id; + uint32_t len; chunklen -= 4; while (chunklen > 0) @@ -368,7 +368,7 @@ static void ParseLIST(SFFile *sf2, FileReader *f, DWORD chunklen, ListHandler *h } } -static void ParseINFO(SFFile *sf2, FileReader *f, DWORD chunklen) +static void ParseINFO(SFFile *sf2, FileReader *f, uint32_t chunklen) { sf2->MinorVersion = -1; @@ -380,7 +380,7 @@ static void ParseINFO(SFFile *sf2, FileReader *f, DWORD chunklen) } } -static void ParseSdta(SFFile *sf2, FileReader *f, DWORD chunklen) +static void ParseSdta(SFFile *sf2, FileReader *f, uint32_t chunklen) { ParseLIST(sf2, f, chunklen, SdtaHandlers); if (sf2->SampleDataOffset == 0) @@ -397,7 +397,7 @@ static void ParseSdta(SFFile *sf2, FileReader *f, DWORD chunklen) } } -static void ParseSmpl(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseSmpl(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { // Only use the first smpl chunk. (Or should we reject files with more than one?) if (sf2->SampleDataOffset == 0) @@ -412,7 +412,7 @@ static void ParseSmpl(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) skip_chunk(f, chunklen); } -static void ParseSm24(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseSm24(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { // The sm24 chunk is ignored if the file version is < 2.04 if (sf2->MinorVersion >= 4) @@ -427,12 +427,12 @@ static void ParseSm24(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) skip_chunk(f, chunklen); } -static void ParsePdta(SFFile *sf2, FileReader *f, DWORD chunklen) +static void ParsePdta(SFFile *sf2, FileReader *f, uint32_t chunklen) { ParseLIST(sf2, f, chunklen, PdtaHandlers); } -static void ParsePhdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParsePhdr(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { SFPreset *preset; @@ -470,7 +470,7 @@ static void ParsePhdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) } } -static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseBag(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { SFBag *bags, *bag; uint16_t prev_mod = 0; @@ -532,7 +532,7 @@ static void ParseBag(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) } } -static void ParseMod(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseMod(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { // Section 7.4, page 23: // It [the PMOD sub-chunk] is always a multiple of ten bytes in length, @@ -545,7 +545,7 @@ static void ParseMod(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) skip_chunk(f, chunklen); } -static void ParseGen(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseGen(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { SFGenList *gens, *gen; int numgens; @@ -597,7 +597,7 @@ static void ParseGen(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) } } -static void ParseInst(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseInst(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { int i; SFInst *inst; @@ -632,7 +632,7 @@ static void ParseInst(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) } } -static void ParseShdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) +static void ParseShdr(SFFile *sf2, FileReader *f, uint32_t chunkid, uint32_t chunklen) { int i; SFSample *sample; @@ -694,8 +694,8 @@ static void ParseShdr(SFFile *sf2, FileReader *f, DWORD chunkid, DWORD chunklen) SFFile *ReadSF2(const char *filename, FileReader *f) { SFFile *sf2 = NULL; - DWORD filelen; - DWORD chunklen; + uint32_t filelen; + uint32_t chunklen; try { @@ -1502,7 +1502,7 @@ void SFFile::ApplyGeneratorsToRegion(SFGenComposite *gen, SFSample *sfsamp, Rend void SFFile::LoadSample(SFSample *sample) { FileReader *fp = pathExpander.openFileReader(Filename, NULL); - DWORD i; + uint32_t i; if (fp == NULL) { diff --git a/src/timidity/sf2.h b/src/timidity/sf2.h index be611df9fe..26d413ab56 100644 --- a/src/timidity/sf2.h +++ b/src/timidity/sf2.h @@ -37,11 +37,11 @@ struct SFInst struct SFSample { float *InMemoryData; - DWORD Start; - DWORD End; - DWORD StartLoop; - DWORD EndLoop; - DWORD SampleRate; + uint32_t Start; + uint32_t End; + uint32_t StartLoop; + uint32_t EndLoop; + uint32_t SampleRate; uint8_t OriginalPitch; int8_t PitchCorrection; uint16_t SampleLink; @@ -302,10 +302,10 @@ struct SFFile : public Timidity::FontFile SFSample *Samples; TArray Percussion; int MinorVersion; - DWORD SampleDataOffset; - DWORD SampleDataLSBOffset; - DWORD SizeSampleData; - DWORD SizeSampleDataLSB; + uint32_t SampleDataOffset; + uint32_t SampleDataLSBOffset; + uint32_t SizeSampleData; + uint32_t SizeSampleDataLSB; int NumPresets; int NumPresetBags; int NumPresetGenerators; diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 3ab22f471c..bcfd8f7677 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -323,7 +323,7 @@ static inline FColormapStyle * ListGetColormapStyle(VMVa_List &tags) } template -bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, T& tags, DrawParms *parms, bool fortext) const +bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const { INTBOOL boolval; int intval; @@ -749,8 +749,8 @@ bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, } // explicitly instantiate both versions for v_text.cpp. -template bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, Va_List& tags, DrawParms *parms, bool fortext) const; -template bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, VMVa_List& tags, DrawParms *parms, bool fortext) const; +template bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, Va_List& tags, DrawParms *parms, bool fortext) const; +template bool DCanvas::ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, VMVa_List& tags, DrawParms *parms, bool fortext) const; void DCanvas::VirtualToRealCoords(double &x, double &y, double &w, double &h, double vwidth, double vheight, bool vbottom, bool handleaspect) const diff --git a/src/v_video.cpp b/src/v_video.cpp index 8fc745ddbe..6b3e19330d 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -143,15 +143,15 @@ int DisplayWidth, DisplayHeight, DisplayBits; FFont *SmallFont, *SmallFont2, *BigFont, *ConFont, *IntermissionFont; extern "C" { -DWORD Col2RGB8[65][256]; -DWORD *Col2RGB8_LessPrecision[65]; -DWORD Col2RGB8_Inverse[65][256]; +uint32_t Col2RGB8[65][256]; +uint32_t *Col2RGB8_LessPrecision[65]; +uint32_t Col2RGB8_Inverse[65][256]; ColorTable32k RGB32k; ColorTable256k RGB256k; } -static DWORD Col2RGB8_2[63][256]; +static uint32_t Col2RGB8_2[63][256]; // [RH] The framebuffer is no longer a mere byte array. // There's also only one, not four. @@ -394,7 +394,7 @@ void DCanvas::ReleaseScreenshotBuffer() // //========================================================================== -int V_GetColorFromString (const DWORD *palette, const char *cstr, FScriptPosition *sc) +int V_GetColorFromString (const uint32_t *palette, const char *cstr, FScriptPosition *sc) { int c[3], i, p; char val[3]; @@ -586,7 +586,7 @@ FString V_GetColorStringByName (const char *name, FScriptPosition *sc) // //========================================================================== -int V_GetColor (const DWORD *palette, const char *str, FScriptPosition *sc) +int V_GetColor (const uint32_t *palette, const char *str, FScriptPosition *sc) { FString string = V_GetColorStringByName (str, sc); int res; @@ -602,7 +602,7 @@ int V_GetColor (const DWORD *palette, const char *str, FScriptPosition *sc) return res; } -int V_GetColor(const DWORD *palette, FScanner &sc) +int V_GetColor(const uint32_t *palette, FScanner &sc) { FScriptPosition scc = sc; return V_GetColor(palette, sc.String, &scc); @@ -902,8 +902,8 @@ void DFrameBuffer::DrawRateStuff () // Draws frame time and cumulative fps if (vid_fps) { - DWORD ms = I_FPSTime(); - DWORD howlong = ms - LastMS; + uint32_t ms = I_FPSTime(); + uint32_t howlong = ms - LastMS; if ((signed)howlong >= 0) { char fpsbuff[40]; @@ -923,7 +923,7 @@ void DFrameBuffer::DrawRateStuff () DTA_VirtualHeight, screen->GetHeight() / textScale, DTA_KeepRatio, true, TAG_DONE); - DWORD thisSec = ms/1000; + uint32_t thisSec = ms/1000; if (LastSec < thisSec) { LastCount = FrameCount / (thisSec - LastSec); diff --git a/src/v_video.h b/src/v_video.h index aa21480b3d..e3285f0269 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -59,15 +59,15 @@ class FTexture; // Think of TagItems as an array of the following structure: // // struct TagItem { -// DWORD ti_Tag; -// DWORD ti_Data; +// uint32_t ti_Tag; +// uint32_t ti_Data; // }; #define TAG_DONE (0) /* Used to indicate the end of the Tag list */ #define TAG_END (0) /* Ditto */ /* list pointed to in ti_Data */ -#define TAG_USER ((DWORD)(1u<<30)) +#define TAG_USER ((uint32_t)(1u<<30)) enum { @@ -104,7 +104,7 @@ enum DTA_HUDRulesC, // only used internally for marking HUD_HorizCenter DTA_KeepRatio, // doesn't adjust screen size for DTA_Virtual* if the aspect ratio is not 4:3 DTA_RenderStyle, // same as render style for actors - DTA_ColorOverlay, // DWORD: ARGB to overlay on top of image; limited to black for software + DTA_ColorOverlay, // uint32_t: ARGB to overlay on top of image; limited to black for software DTA_BilinearFilter, // bool: apply bilinear filtering to the image DTA_SpecialColormap,// pointer to FSpecialColormapParameters (likely to be forever hardware-only) DTA_ColormapStyle, // pointer to FColormapStyle (hardware-only) @@ -292,7 +292,7 @@ protected: virtual void DrawTextureParms(FTexture *img, DrawParms &parms); template - bool ParseDrawTextureTags(FTexture *img, double x, double y, DWORD tag, T& tags, DrawParms *parms, bool fortext) const; + bool ParseDrawTextureTags(FTexture *img, double x, double y, uint32_t tag, T& tags, DrawParms *parms, bool fortext) const; DCanvas() {} @@ -489,18 +489,18 @@ extern "C" ColorTable256k RGB256k; // special R10B10G10 format for efficient blending computation. // --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64 // --------rrrr------bbbb------gggg at level 1 -extern "C" DWORD Col2RGB8[65][256]; +extern "C" uint32_t Col2RGB8[65][256]; // Col2RGB8_LessPrecision is the same as Col2RGB8, but the LSB for red // and blue are forced to zero, so if the blend overflows, it won't spill // over into the next component's value. // --RRRRRrrr-#BBBBBbbb-#GGGGGggg-- at level 64 // --------rrr#------bbb#------gggg at level 1 -extern "C" DWORD *Col2RGB8_LessPrecision[65]; +extern "C" uint32_t *Col2RGB8_LessPrecision[65]; // Col2RGB8_Inverse is the same as Col2RGB8_LessPrecision, except the source // palette has been inverted. -extern "C" DWORD Col2RGB8_Inverse[65][256]; +extern "C" uint32_t Col2RGB8_Inverse[65][256]; // "Magic" numbers used during the blending: // --000001111100000111110000011111 = 0x01f07c1f @@ -523,14 +523,14 @@ void V_MarkRect (int x, int y, int width, int height); class FScanner; // Returns the closest color to the one desired. String // should be of the form "rr gg bb". -int V_GetColorFromString (const DWORD *palette, const char *colorstring, FScriptPosition *sc = nullptr); +int V_GetColorFromString (const uint32_t *palette, const char *colorstring, FScriptPosition *sc = nullptr); // Scans through the X11R6RGB lump for a matching color // and returns a color string suitable for V_GetColorFromString. FString V_GetColorStringByName (const char *name, FScriptPosition *sc = nullptr); // Tries to get color by name, then by string -int V_GetColor (const DWORD *palette, const char *str, FScriptPosition *sc = nullptr); -int V_GetColor(const DWORD *palette, FScanner &sc); +int V_GetColor (const uint32_t *palette, const char *str, FScriptPosition *sc = nullptr); +int V_GetColor(const uint32_t *palette, FScanner &sc); void V_DrawFrame (int left, int top, int width, int height); // If the view size is not full screen, draws a border around it.