From e84bece8ebf07d943bd5327ccee2226a9b8244bb Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 22 Dec 2007 04:00:25 +0000 Subject: [PATCH] - Fixed: TEAMINFO broke bot parsing for bots with invalid team names by redefining TEAM_None from 255 to -1. SVN r616 (trunk) --- docs/rh-log.txt | 8 +++++++- src/b_game.cpp | 4 ++-- src/d_main.cpp | 1 - src/v_video.cpp | 4 ---- src/v_video.h | 7 ++----- src/win32/fb_d3d9.cpp | 26 ++++++-------------------- src/win32/win32iface.h | 3 +-- 7 files changed, 18 insertions(+), 35 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 06b2c6b71c..ba467e2c74 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,7 @@ +December 21, 2007 +- Fixed: TEAMINFO broke bot parsing for bots with invalid team names by + redefining TEAM_None from 255 to -1. + December 21, 2007 (Changes by Graf Zahl) - Added Karate Chris's fix for TEAMINFO definitions with just one team. @@ -24,7 +28,9 @@ December 20, 2007 (Changes by Graf Zahl) December 19, 2007 - Added a framework for drawing the 2D screen elements with Direct3D textures. They are not actually drawn with it yet, nor is it complete, but it's - something to start with. + something to start with. While doing this, I noticed the DTA_Shadow stuff + doesn't do anything. I'll probably remove them rather than fix them, since + it's easier to draw the shadow with a separate DrawTexture call. - Split up DCanvas::DrawTexture() into more pieces to make it easier to virtualize. - Removed support for non-32-bit palette textures from D3DFB. What kind of diff --git a/src/b_game.cpp b/src/b_game.cpp index e9b7508412..8d17542796 100644 --- a/src/b_game.cpp +++ b/src/b_game.cpp @@ -587,7 +587,7 @@ bool DCajunMaster::LoadBots () case BOTCFG_TEAM: { - char teamstr[4]; + char teamstr[16]; unsigned int teamnum; SC_MustGetString (); @@ -612,7 +612,7 @@ bool DCajunMaster::LoadBots () } } appendinfo (newinfo->info, "team"); - sprintf (teamstr, "%u", teamnum); + sprintf (teamstr, "%d", teamnum); appendinfo (newinfo->info, teamstr); gotteam = true; break; diff --git a/src/d_main.cpp b/src/d_main.cpp index 1b6705ec7b..6d5deef9f0 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -646,7 +646,6 @@ void D_Display (bool screenshot) DTA_FillColor, MAKEARGB(ColorMatcher.Pick(254,254,0),254,254,0), DTA_AlphaChannel, true, TAG_DONE); - screen->End2D(); #endif screen->Update (); // page flip or blit buffer } diff --git a/src/v_video.cpp b/src/v_video.cpp index 53be5d75ef..7d49865ea9 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -783,10 +783,6 @@ void DFrameBuffer::Begin2D () { } -void DFrameBuffer::End2D () -{ -} - FNativeTexture *DFrameBuffer::CreateTexture(FTexture *gametex) { return NULL; diff --git a/src/v_video.h b/src/v_video.h index 52566c305d..05c3c41242 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -173,7 +173,7 @@ public: virtual void SetFont (FFont *font); // 2D Texture drawing - virtual void STACK_ARGS DrawTexture (FTexture *img, int x, int y, int tags, ...); + void STACK_ARGS DrawTexture (FTexture *img, int x, int y, int tags, ...); void FillBorder (FTexture *img); // Fills the border around a 4:3 part of the screen on non-4:3 displays // 2D Text drawing @@ -305,10 +305,7 @@ public: // the scene, and it doesn't present the image yet. virtual void Begin2D(); - // DrawTexture calls between Begin2D/End2D now use native textures. - - // Finish 2D drawing operations. - virtual void End2D(); + // DrawTexture calls after Begin2D use native textures. // Create a native texture from a game texture. virtual FNativeTexture *CreateTexture(FTexture *gametex); diff --git a/src/win32/fb_d3d9.cpp b/src/win32/fb_d3d9.cpp index 9fdebaebe0..f6408bc3d7 100644 --- a/src/win32/fb_d3d9.cpp +++ b/src/win32/fb_d3d9.cpp @@ -803,17 +803,14 @@ void D3DFB::Unlock () // When In2D == 0: Copy buffer to screen and present // When In2D == 1: Copy buffer to screen but do not present -// When In2D == 2: Do nothing -// When In2D == 3: Present and set In2D to 0 +// When In2D == 2: Present and set In2D to 0 void D3DFB::Update () { - assert(In2D != 2); - - if (In2D == 3) + if (In2D == 2) { D3DDevice->EndScene(); D3DDevice->Present(NULL, NULL, NULL, NULL); - In2D = false; + In2D = 0; return; } @@ -1290,14 +1287,6 @@ void D3DFB::Begin2D() //D3DDevice->SetTexture(1, PaletteTexture); } -void D3DFB::End2D() -{ - if (In2D == 2) - { - In2D = 3; - } -} - FNativeTexture *D3DFB::CreateTexture(FTexture *gametex) { return new D3DTex(gametex, D3DDevice); @@ -1305,21 +1294,18 @@ FNativeTexture *D3DFB::CreateTexture(FTexture *gametex) //========================================================================== // -// D3DFB :: DrawTexture +// D3DFB :: DrawTextureV // // If not in 2D mode, just call the normal software version. // If in 2D mode, then use Direct3D calls to perform the drawing. // //========================================================================== -void STACK_ARGS D3DFB::DrawTexture (FTexture *img, int x, int y, int tags_first, ...) +void STACK_ARGS D3DFB::DrawTextureV (FTexture *img, int x, int y, uint32 tags_first, va_list tags) { - va_list tags; - va_start(tags, tags_first); - if (In2D < 2) { - DrawTextureV(img, x, y, tags_first, tags); + Super::DrawTextureV(img, x, y, tags_first, tags); return; } diff --git a/src/win32/win32iface.h b/src/win32/win32iface.h index 05117c9729..9946003f60 100644 --- a/src/win32/win32iface.h +++ b/src/win32/win32iface.h @@ -231,10 +231,9 @@ public: void SetVSync (bool vsync); void SetBlendingRect (int x1, int y1, int x2, int y2); void Begin2D (); - void End2D (); FNativeTexture *CreateTexture (FTexture *gametex); FNativeTexture *CreatePalette (FTexture *pal); - void STACK_ARGS DrawTexture (FTexture *img, int x, int y, int tags, ...); + void STACK_ARGS DrawTextureV (FTexture *img, int x, int y, uint32 tag, va_list tags); HRESULT GetHR (); private: