* (Windows) Mouse-controlled screens in DMODs control better and hide the original mouse cursor
* (Windows) Now remembers screen size and fullscreen mode (don't forget, you can drag the window corners around to customize the screen size as well) * (Windows) Input URL input area gets focus by default when installing a DMOD by URL * (bugfix) Can no longer tap F8 during a game load to load a save state too early which can freeze the game * (bugfix) Fixed issue where 32 bit tilebitmaps would go wonky when reloading the surface * Default color under status bar is now black, fixes issue when transparent colors are used in the stats area, random garbage would show through git-svn-id: svn://rtsoft.com/rtsvn/projects/RTDink@1473 353e56fe-9613-0410-8469-b96ad8e6f29c
This commit is contained in:
parent
f7cc1910ce
commit
e3ad75909f
9 changed files with 500 additions and 279 deletions
|
@ -45,4 +45,12 @@ www.rtsoft.com
|
||||||
|
|
||||||
------ Change log for 1.7.1 ----------
|
------ Change log for 1.7.1 ----------
|
||||||
|
|
||||||
|
(big thanks to Redink1 for most of these bug reports!)
|
||||||
|
|
||||||
* (Windows) Fixed app icon
|
* (Windows) Fixed app icon
|
||||||
|
* (Windows) Mouse-controlled screens in DMODs control better and hide the original mouse cursor
|
||||||
|
* (Windows) Now remembers screen size and fullscreen mode (don't forget, you can drag the window corners around to customize the screen size as well)
|
||||||
|
* (Windows) Input URL input area gets focus by default when installing a DMOD by URL
|
||||||
|
* (bugfix) Can no longer tap F8 during a game load to load a save state too early which can freeze the game
|
||||||
|
* (bugfix) Fixed issue where 32 bit tilebitmaps would go wonky when reloading the surface
|
||||||
|
* Default color under status bar is now black, fixes issue when transparent colors are used in the stats area, random garbage would show through
|
|
@ -25,7 +25,7 @@
|
||||||
#ifdef WINAPI
|
#ifdef WINAPI
|
||||||
|
|
||||||
#include "StackWalker/StackUtils.h"
|
#include "StackWalker/StackUtils.h"
|
||||||
|
extern bool g_bIsFullScreen;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ bool App::Init()
|
||||||
int scaleToX = 480;
|
int scaleToX = 480;
|
||||||
int scaleToY = 320;
|
int scaleToY = 320;
|
||||||
|
|
||||||
if (IsTabletSize())
|
if (IsTabletSize() || IsDesktop)
|
||||||
{
|
{
|
||||||
scaleToX = 1024;
|
scaleToX = 1024;
|
||||||
scaleToY = 768;
|
scaleToY = 768;
|
||||||
|
@ -500,8 +500,27 @@ if (GetEmulatedPlatformID() == PLATFORM_ID_IOS)
|
||||||
//when screen size changes we'll unload surfaces
|
//when screen size changes we'll unload surfaces
|
||||||
GetBaseApp()->m_sig_unloadSurfaces.connect(1, boost::bind(&App::OnUnloadSurfaces, this));
|
GetBaseApp()->m_sig_unloadSurfaces.connect(1, boost::bind(&App::OnUnloadSurfaces, this));
|
||||||
|
|
||||||
|
#ifdef WINAPI
|
||||||
|
int videox = GetApp()->GetVarWithDefault("video_x", uint32(0))->GetUINT32();
|
||||||
|
int videoy = GetApp()->GetVarWithDefault("video_y", uint32(0))->GetUINT32();
|
||||||
|
int fullscreen = GetApp()->GetVarWithDefault("fullscreen", uint32(0))->GetUINT32();
|
||||||
|
|
||||||
|
if (fullscreen)
|
||||||
|
{
|
||||||
|
LogMsg("Setting fullscreen...");
|
||||||
|
//GetMessageManager()->SendGUI(MESSAGE_TYPE_GUI_TOGGLE_FULLSCREEN, 0, 0); //lParam holds a lot of random data about the press, look it up if
|
||||||
|
|
||||||
|
OnFullscreenToggleRequest();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (videox != 0 && videoy != 0)
|
||||||
|
{
|
||||||
|
//remember old setup
|
||||||
|
SetVideoMode(videox, videoy, false, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -685,6 +704,13 @@ void App::OnScreenSizeChange()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WINAPI
|
||||||
|
GetApp()->GetVar("fullscreen")->Set(uint32(g_bIsFullScreen));
|
||||||
|
GetApp()->GetVar("videox")->Set(uint32(GetPrimaryGLX()));
|
||||||
|
GetApp()->GetVar("videoy")->Set(uint32(GetPrimaryGLY()));
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void App::GetServerInfo( string &server, uint32 &port )
|
void App::GetServerInfo( string &server, uint32 &port )
|
||||||
|
@ -834,6 +860,18 @@ bool App::OnPreInitVideo()
|
||||||
// g_winVideoScreenX = 800;
|
// g_winVideoScreenX = 800;
|
||||||
// g_winVideoScreenY = 1280;
|
// g_winVideoScreenY = 1280;
|
||||||
|
|
||||||
|
//windows only
|
||||||
|
VariantDB temp;
|
||||||
|
temp.Load("save.dat");
|
||||||
|
Variant *pVarX = temp.GetVarIfExists("videox");
|
||||||
|
Variant *pVarY = temp.GetVarIfExists("videoy");
|
||||||
|
if (pVarX && pVarY && pVarX->GetUINT32() != 0 && pVarY->GetUINT32() != 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
g_winVideoScreenX = pVarX->GetUINT32();
|
||||||
|
g_winVideoScreenY = pVarY->GetUINT32();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -6,11 +6,17 @@
|
||||||
|
|
||||||
CursorComponent::CursorComponent()
|
CursorComponent::CursorComponent()
|
||||||
{
|
{
|
||||||
|
#ifdef WINAPI
|
||||||
|
ShowCursor(false);
|
||||||
|
#endif
|
||||||
SetName("Cursor");
|
SetName("Cursor");
|
||||||
}
|
}
|
||||||
|
|
||||||
CursorComponent::~CursorComponent()
|
CursorComponent::~CursorComponent()
|
||||||
{
|
{
|
||||||
|
#ifdef WINAPI
|
||||||
|
ShowCursor(true);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorComponent::OnAdd(Entity *pEnt)
|
void CursorComponent::OnAdd(Entity *pEnt)
|
||||||
|
@ -28,6 +34,7 @@ void CursorComponent::OnAdd(Entity *pEnt)
|
||||||
GetParent()->GetFunction("OnInput")->sig_function.connect(1, boost::bind(&CursorComponent::OnInput, this, _1));
|
GetParent()->GetFunction("OnInput")->sig_function.connect(1, boost::bind(&CursorComponent::OnInput, this, _1));
|
||||||
GetParent()->GetParent()->GetFunction("OnKillingControls")->sig_function.connect(1, boost::bind(&CursorComponent::OnKillingControls, this, _1));
|
GetParent()->GetParent()->GetFunction("OnKillingControls")->sig_function.connect(1, boost::bind(&CursorComponent::OnKillingControls, this, _1));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CursorComponent::OnRemove()
|
void CursorComponent::OnRemove()
|
||||||
|
@ -58,11 +65,51 @@ void CursorComponent::OnUpdate(VariantList *pVList)
|
||||||
|
|
||||||
void CursorComponent::OnInput( VariantList *pVList )
|
void CursorComponent::OnInput( VariantList *pVList )
|
||||||
{
|
{
|
||||||
|
|
||||||
//0 = message type, 1 = parent coordinate offset
|
//0 = message type, 1 = parent coordinate offset
|
||||||
CL_Vec2f pt = pVList->Get(1).GetVector2();
|
CL_Vec2f pt = pVList->Get(1).GetVector2();
|
||||||
//pt += GetAlignmentOffset(*m_pSize2d, eAlignment(*m_pAlignment));
|
//pt += GetAlignmentOffset(*m_pSize2d, eAlignment(*m_pAlignment));
|
||||||
|
|
||||||
switch (eMessageType( int(pVList->Get(0).GetFloat())))
|
|
||||||
|
|
||||||
|
if (IsDesktop())
|
||||||
|
{
|
||||||
|
|
||||||
|
//controls for a real mouse
|
||||||
|
|
||||||
|
switch (eMessageType(int(pVList->Get(0).GetFloat())))
|
||||||
|
{
|
||||||
|
case MESSAGE_TYPE_GUI_CLICK_START:
|
||||||
|
//HandleClickStart(pt);
|
||||||
|
OnUpdatePos(pt);
|
||||||
|
g_dglo.m_dirInput[DINK_INPUT_BUTTON1] = true;
|
||||||
|
g_dglo.m_dirInputFinished[DINK_INPUT_BUTTON1] = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case MESSAGE_TYPE_GUI_CLICK_END:
|
||||||
|
if (!m_bDisable)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//HandleClickEnd(pt);
|
||||||
|
break;
|
||||||
|
case MESSAGE_TYPE_GUI_CLICK_MOVE:
|
||||||
|
case MESSAGE_TYPE_GUI_CLICK_MOVE_RAW:
|
||||||
|
OnUpdatePos(pt);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
//controls for a touch screen. Selecting is different
|
||||||
|
|
||||||
|
|
||||||
|
switch (eMessageType(int(pVList->Get(0).GetFloat())))
|
||||||
{
|
{
|
||||||
case MESSAGE_TYPE_GUI_CLICK_START:
|
case MESSAGE_TYPE_GUI_CLICK_START:
|
||||||
//HandleClickStart(pt);
|
//HandleClickStart(pt);
|
||||||
|
@ -83,5 +130,8 @@ void CursorComponent::OnInput( VariantList *pVList )
|
||||||
OnUpdatePos(pt);
|
OnUpdatePos(pt);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,6 +105,11 @@ if (GetEmulatedPlatformID() != PLATFORM_ID_WEBOS)
|
||||||
pButtonEntity->GetComponentByName("InputTextRender")->GetVar("inputType")->Set(uint32(InputTextRenderComponent::INPUT_TYPE_URL));
|
pButtonEntity->GetComponentByName("InputTextRender")->GetVar("inputType")->Set(uint32(InputTextRenderComponent::INPUT_TYPE_URL));
|
||||||
//pButtonEntity->GetComponentByName("InputTextRender")->GetVar("font")->Set(uint32(FONT_LARGE));
|
//pButtonEntity->GetComponentByName("InputTextRender")->GetVar("font")->Set(uint32(FONT_LARGE));
|
||||||
|
|
||||||
|
|
||||||
|
if (IsDesktop())
|
||||||
|
pButtonEntity->GetComponentByName("InputTextRender")->GetFunction("ActivateKeyboard")->sig_function(NULL); //give it focus
|
||||||
|
|
||||||
|
|
||||||
//a way to get our CreateTextBox function called in 500 seconds, but not called if the entity doesn't exist at that time
|
//a way to get our CreateTextBox function called in 500 seconds, but not called if the entity doesn't exist at that time
|
||||||
|
|
||||||
SlideScreen(pBG, true);
|
SlideScreen(pBG, true);
|
||||||
|
|
|
@ -958,6 +958,8 @@ void OnGameMenuRender(VariantList *pVList)
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
|
||||||
|
|
||||||
|
//well, we might as well always clear the BG, because some dmods like redink1 set transparency in the status bar which causes glitches if we don't
|
||||||
|
|
||||||
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
|
if (g_dglo.GetActiveView() != DinkGlobals::VIEW_ZOOMED)
|
||||||
{
|
{
|
||||||
//clear background if needed
|
//clear background if needed
|
||||||
|
@ -1026,18 +1028,27 @@ void OnArcadeInput(VariantList *pVList)
|
||||||
{
|
{
|
||||||
if (bIsDown)
|
if (bIsDown)
|
||||||
{
|
{
|
||||||
|
if (GetDinkGameState() == DINK_GAME_STATE_PLAYING)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
string fName = DinkGetSavePath()+"quicksave.dat";
|
|
||||||
|
string fName = DinkGetSavePath() + "quicksave.dat";
|
||||||
|
|
||||||
if (FileExists(fName))
|
if (FileExists(fName))
|
||||||
{
|
{
|
||||||
LoadStateWithExtra();
|
LoadStateWithExtra();
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ShowQuickMessage("No state to load yet.");
|
ShowQuickMessage("No state to load yet.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ShowQuickMessage("(can't load state yet, still loading game!)");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIRTUAL_KEY_GAME_MAGIC:
|
case VIRTUAL_KEY_GAME_MAGIC:
|
||||||
|
|
|
@ -756,10 +756,35 @@ void DrawCollision()
|
||||||
bool LoadTileScreenIfNeeded(int h, bool &bRequireRebuild)
|
bool LoadTileScreenIfNeeded(int h, bool &bRequireRebuild)
|
||||||
{
|
{
|
||||||
bRequireRebuild = false;
|
bRequireRebuild = false;
|
||||||
if (g_tileScreens[h]) return true; //already loaded
|
|
||||||
string fName = "tiles/ts";
|
string fName = "tiles/ts";
|
||||||
if (h < 10) fName += "0";
|
if (h < 10) fName += "0";
|
||||||
fName += toString(h)+".bmp";
|
fName += toString(h)+".bmp";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (g_tileScreens[h])
|
||||||
|
{
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
//LogMsg("tilescreen %s already loaded, skipping", fName.c_str());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (g_tileScreens[h] && g_tileScreens[h]->m_pSurf->GetSurfaceType() != SoftSurface::SURFACE_PALETTE_8BIT)
|
||||||
|
{
|
||||||
|
//we're going to require a hicolor backbuffer.
|
||||||
|
if (lpDDSBackGround->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT)
|
||||||
|
{
|
||||||
|
LogMsg("BIG ERROR: Detected high color tilescreen bmps. Converting backbuffers to 32 bit on the fly.");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return true; //already loaded
|
||||||
|
}
|
||||||
|
|
||||||
assert(!g_tileScreens[h]);
|
assert(!g_tileScreens[h]);
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
LogMsg("Loading tilescreen %s", fName.c_str());
|
LogMsg("Loading tilescreen %s", fName.c_str());
|
||||||
|
@ -1843,6 +1868,13 @@ void ReadFromLoadSequenceString(char ev[15][100] )
|
||||||
assert(strlen(ev[2]) < C_SPRITE_MAX_FILENAME_SIZE);
|
assert(strlen(ev[2]) < C_SPRITE_MAX_FILENAME_SIZE);
|
||||||
strcpy(g_dglos.g_seq[seqID].m_fileName, ev[2]);
|
strcpy(g_dglos.g_seq[seqID].m_fileName, ev[2]);
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
if (seqID == 423)
|
||||||
|
{
|
||||||
|
LogMsg("He");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (compare(ev[4], "BLACK"))
|
if (compare(ev[4], "BLACK"))
|
||||||
{
|
{
|
||||||
g_dglos.g_seq[seqID].m_transType = TRANSPARENT_BLACK;
|
g_dglos.g_seq[seqID].m_transType = TRANSPARENT_BLACK;
|
||||||
|
@ -1854,12 +1886,7 @@ void ReadFromLoadSequenceString(char ev[15][100] )
|
||||||
}else if (compare(ev[4], "NOTANIM") /*|| compare(ev[4], "NOTANIN")*/ ) //to work around a typo in MsDink's DMOD, but not to work around the notanin error in seq 424 in original dini.ini's.. yeah, complicated. Why!?!?
|
}else if (compare(ev[4], "NOTANIM") /*|| compare(ev[4], "NOTANIN")*/ ) //to work around a typo in MsDink's DMOD, but not to work around the notanin error in seq 424 in original dini.ini's.. yeah, complicated. Why!?!?
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef _DEBUG
|
|
||||||
if (seqID == 424)
|
|
||||||
{
|
|
||||||
LogMsg("He");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
g_dglos.g_seq[seqID].m_transType = GetTransparencyOverrideForSequence(TRANSPARENT_WHITE, seqID);
|
g_dglos.g_seq[seqID].m_transType = GetTransparencyOverrideForSequence(TRANSPARENT_WHITE, seqID);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
|
@ -2487,6 +2514,24 @@ void draw_status_all(void)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool SwitchToRGBAIfNeeded(LPDIRECTDRAWSURFACE *pDXSurf, SoftSurface *pSoftSurf)
|
||||||
|
{
|
||||||
|
if ( (*pDXSurf) || (*pDXSurf)->m_pSurf) return false;
|
||||||
|
|
||||||
|
if ( (*pDXSurf)->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT
|
||||||
|
&&
|
||||||
|
(pSoftSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA
|
||||||
|
|| pSoftSurf->GetSurfaceType() == SoftSurface::SURFACE_RGB)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
delete *pDXSurf;
|
||||||
|
*pDXSurf = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
void BlitGUIOverlay()
|
void BlitGUIOverlay()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -2538,6 +2583,22 @@ void BlitGUIOverlay()
|
||||||
|
|
||||||
if (!check_seq_status(180)) return;
|
if (!check_seq_status(180)) return;
|
||||||
|
|
||||||
|
/*
|
||||||
|
if (lpDDSBack && lpDDSBack->m_pSurf && lpDDSBack->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_PALETTE_8BIT
|
||||||
|
&& g_pSpriteSurface[g_dglos.g_seq[180].frame[3]]->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA
|
||||||
|
|| g_pSpriteSurface[g_dglos.g_seq[180].frame[3]]->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
|
||||||
|
{
|
||||||
|
LogMsg("Freak out!");
|
||||||
|
//delete lpDDSBuffer;
|
||||||
|
//lpDDSBuffer = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
SwitchToRGBAIfNeeded(&lpDDSBack, g_pSpriteSurface[g_dglos.g_seq[180].frame[1]]->m_pSurf);
|
||||||
|
SwitchToRGBAIfNeeded(&lpDDSBack, g_pSpriteSurface[g_dglos.g_seq[180].frame[2]]->m_pSurf);
|
||||||
|
SwitchToRGBAIfNeeded(&lpDDSBack, g_pSpriteSurface[g_dglos.g_seq[180].frame[3]]->m_pSurf);
|
||||||
|
*/
|
||||||
|
|
||||||
lpDDSBack->BltFast( 0, 400, g_pSpriteSurface[g_dglos.g_seq[180].frame[3]], &rcRect , DDBLTFAST_NOCOLORKEY );
|
lpDDSBack->BltFast( 0, 400, g_pSpriteSurface[g_dglos.g_seq[180].frame[3]], &rcRect , DDBLTFAST_NOCOLORKEY );
|
||||||
rcRect.left = 0;
|
rcRect.left = 0;
|
||||||
rcRect.top = 0;
|
rcRect.top = 0;
|
||||||
|
@ -5460,6 +5521,12 @@ void CopyBitmapToBackBuffer (char *pName)
|
||||||
LogMsg("Error: Can't find bitmap at %s.",fName.c_str());
|
LogMsg("Error: Can't find bitmap at %s.",fName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (lpDDSBuffer && lpDDSBuffer->m_pSurf && lpDDSBuffer->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA || lpDDSBuffer->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGB)
|
||||||
|
{
|
||||||
|
LogMsg("Warning, losing high color back buffer");
|
||||||
|
//assert(0);
|
||||||
|
}
|
||||||
SAFE_DELETE(lpDDSBuffer);
|
SAFE_DELETE(lpDDSBuffer);
|
||||||
assert(!lpDDSBuffer);
|
assert(!lpDDSBuffer);
|
||||||
lpDDSBuffer = LoadBitmapIntoSurface(fName.c_str(), TRANSPARENT_NONE);
|
lpDDSBuffer = LoadBitmapIntoSurface(fName.c_str(), TRANSPARENT_NONE);
|
||||||
|
@ -5498,7 +5565,14 @@ void copy_bmp( char *pName)
|
||||||
LogMsg("Error: Can't find bitmap at %s.",fName.c_str());
|
LogMsg("Error: Can't find bitmap at %s.",fName.c_str());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SAFE_DELETE(lpDDSBuffer);
|
|
||||||
|
if (lpDDSBuffer && lpDDSBuffer->m_pSurf && lpDDSBuffer->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA || lpDDSBuffer->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGB)
|
||||||
|
{
|
||||||
|
LogMsg("Warning, losing high color back buffer");
|
||||||
|
assert(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
SAFE_DELETE(lpDDSBuffer);
|
||||||
assert(!lpDDSBuffer);
|
assert(!lpDDSBuffer);
|
||||||
lpDDSBuffer = LoadBitmapIntoSurface(fName.c_str(), TRANSPARENT_NONE);
|
lpDDSBuffer = LoadBitmapIntoSurface(fName.c_str(), TRANSPARENT_NONE);
|
||||||
|
|
||||||
|
@ -5509,6 +5583,7 @@ SAFE_DELETE(lpDDSBuffer);
|
||||||
ddrval = lpDDSBack->BltFast( 0, 0, lpDDSBuffer,
|
ddrval = lpDDSBack->BltFast( 0, 0, lpDDSBuffer,
|
||||||
&rcRect, DDBLTFAST_NOCOLORKEY);
|
&rcRect, DDBLTFAST_NOCOLORKEY);
|
||||||
|
|
||||||
|
assert(!"Clear this?");
|
||||||
ddrval = lpDDSBackGround->BltFast( 0, 0, lpDDSBuffer,
|
ddrval = lpDDSBackGround->BltFast( 0, 0, lpDDSBuffer,
|
||||||
&rcRect, DDBLTFAST_NOCOLORKEY);
|
&rcRect, DDBLTFAST_NOCOLORKEY);
|
||||||
|
|
||||||
|
@ -5888,6 +5963,9 @@ void BuildScreenBackground( bool bFullRebuild )
|
||||||
|
|
||||||
if (bFullRebuild)
|
if (bFullRebuild)
|
||||||
{
|
{
|
||||||
|
#ifdef _DEBUG
|
||||||
|
LogMsg("Doing full rebuild of screen background...");
|
||||||
|
#endif
|
||||||
while (kill_last_sprite());
|
while (kill_last_sprite());
|
||||||
kill_repeat_sounds();
|
kill_repeat_sounds();
|
||||||
kill_all_scripts();
|
kill_all_scripts();
|
||||||
|
@ -14309,7 +14387,16 @@ fin:
|
||||||
|
|
||||||
CL_Vec2f NativeToDinkCoords(CL_Vec2f vPos)
|
CL_Vec2f NativeToDinkCoords(CL_Vec2f vPos)
|
||||||
{
|
{
|
||||||
return CL_Vec2f( g_dglo.m_orthoRenderRect.left+ vPos.x * g_dglo.m_orthoRenderRect.GetWidth()/GetScreenSizeXf(), vPos.y *g_dglo.m_orthoRenderRect.GetHeight()/GetScreenSizeYf());
|
|
||||||
|
CL_Vec2f r = CL_Vec2f(
|
||||||
|
g_dglo.m_orthoRenderRect.left + vPos.x * (g_dglo.m_orthoRenderRect.GetWidth() / GetScreenSizeXf()),
|
||||||
|
vPos.y * (g_dglo.m_orthoRenderRect.GetHeight() / GetScreenSizeYf())
|
||||||
|
);
|
||||||
|
|
||||||
|
r.x /= g_dglo.m_aspectRatioModX;
|
||||||
|
r.y /= g_dglo.m_aspectRatioModY;
|
||||||
|
r -= g_dglo.m_centeringOffset;
|
||||||
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -15343,6 +15430,8 @@ if (IsDesktop())
|
||||||
|
|
||||||
ProcessGraphicGarbageCollection();
|
ProcessGraphicGarbageCollection();
|
||||||
//620
|
//620
|
||||||
|
|
||||||
|
|
||||||
SetOrthoRenderSize(g_dglo.m_orthoRenderRect.right, g_dglo.m_orthoRenderRect.GetHeight(), -g_dglo.m_orthoRenderRect.left, -g_dglo.m_orthoRenderRect.top);
|
SetOrthoRenderSize(g_dglo.m_orthoRenderRect.right, g_dglo.m_orthoRenderRect.GetHeight(), -g_dglo.m_orthoRenderRect.left, -g_dglo.m_orthoRenderRect.top);
|
||||||
if (5 > 9)
|
if (5 > 9)
|
||||||
{
|
{
|
||||||
|
@ -15351,6 +15440,7 @@ if (IsDesktop())
|
||||||
bCaptureScreen = true;
|
bCaptureScreen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
check_joystick();
|
check_joystick();
|
||||||
|
|
||||||
#ifdef C_DINK_KEYBOARD_INPUT
|
#ifdef C_DINK_KEYBOARD_INPUT
|
||||||
|
@ -15482,8 +15572,11 @@ LastWindowsTimer = GetTickCount();
|
||||||
if (*pupdate_status == 1) update_status_all();
|
if (*pupdate_status == 1) update_status_all();
|
||||||
|
|
||||||
update_sound();
|
update_sound();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//TODO Animated tiles
|
//TODO Animated tiles
|
||||||
if (IsDesktop())
|
//if (IsDesktop())
|
||||||
{
|
{
|
||||||
//TODO: Maybe mobile can handle this now?
|
//TODO: Maybe mobile can handle this now?
|
||||||
process_animated_tiles();
|
process_animated_tiles();
|
||||||
|
@ -15510,6 +15603,7 @@ LastWindowsTimer = GetTickCount();
|
||||||
|
|
||||||
ProcessTransition();
|
ProcessTransition();
|
||||||
|
|
||||||
|
|
||||||
if (g_dglos.process_upcycle)
|
if (g_dglos.process_upcycle)
|
||||||
{
|
{
|
||||||
up_cycle();
|
up_cycle();
|
||||||
|
@ -15569,7 +15663,13 @@ LastWindowsTimer = GetTickCount();
|
||||||
|
|
||||||
//Blit from Two, which holds the base scene.
|
//Blit from Two, which holds the base scene.
|
||||||
|
|
||||||
lpDDSBack->BltFast( 0, 0, lpDDSBackGround, &rcRect, DDBLTFAST_NOCOLORKEY);
|
// lpDDSBack->BltFast( 0, 0, lpDDSBackGround, &rcRect, DDBLTFAST_NOCOLORKEY);
|
||||||
|
|
||||||
|
rtRect32 rcRectGameArea(g_dglo.m_gameArea.left, g_dglo.m_gameArea.top, g_dglo.m_gameArea.right, g_dglo.m_gameArea.bottom);
|
||||||
|
lpDDSBack->BltFast(g_dglo.m_gameArea.left, g_dglo.m_gameArea.top, lpDDSBackGround,
|
||||||
|
&rcRectGameArea, DDBLTFAST_NOCOLORKEY);
|
||||||
|
|
||||||
|
|
||||||
g_dglo.m_bgSpriteMan.Render(lpDDSBack); //blit sprites that have been shoved into the bg, too slow to actually add them, so we fake it until the screen is rebuilt
|
g_dglo.m_bgSpriteMan.Render(lpDDSBack); //blit sprites that have been shoved into the bg, too slow to actually add them, so we fake it until the screen is rebuilt
|
||||||
|
|
||||||
if (!g_bTransitionActive)
|
if (!g_bTransitionActive)
|
||||||
|
@ -16002,6 +16102,7 @@ bool LoadGameChunk(int gameIDToLoad, float &progressOut)
|
||||||
//init back buffer at 8 bit, if highcolor is needed later it will auto convert
|
//init back buffer at 8 bit, if highcolor is needed later it will auto convert
|
||||||
lpDDSBackGround = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, false);
|
lpDDSBackGround = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, false);
|
||||||
fill_screen(0); //fill background with blank to start things off
|
fill_screen(0); //fill background with blank to start things off
|
||||||
|
|
||||||
lpDDSBuffer = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL);
|
lpDDSBuffer = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL);
|
||||||
|
|
||||||
|
|
||||||
|
@ -16953,7 +17054,7 @@ void ApplyAspectRatioGLMatrix()
|
||||||
|
|
||||||
CL_Mat4f mat;
|
CL_Mat4f mat;
|
||||||
glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0]);
|
glGetFloatv(GL_MODELVIEW_MATRIX, &mat[0]);
|
||||||
|
g_dglo.m_dink_matrix = mat;
|
||||||
//OPTIMIZE - All this can be cached... maybe done in RecomputeAspectRatio()
|
//OPTIMIZE - All this can be cached... maybe done in RecomputeAspectRatio()
|
||||||
|
|
||||||
mat.inverse();
|
mat.inverse();
|
||||||
|
@ -17025,8 +17126,13 @@ void DinkReInitSurfacesAfterVideoChange()
|
||||||
{
|
{
|
||||||
g_transitionSurf.HardKill();
|
g_transitionSurf.HardKill();
|
||||||
//CheckTransitionSurface();
|
//CheckTransitionSurface();
|
||||||
|
|
||||||
|
bool bHighColor = false;
|
||||||
|
if (lpDDSBackGround && lpDDSBackGround->m_pSurf && lpDDSBackGround->m_pSurf->GetSurfaceType() == SoftSurface::SURFACE_RGBA)
|
||||||
|
bHighColor = true;
|
||||||
|
|
||||||
SAFE_DELETE(lpDDSBackGround);
|
SAFE_DELETE(lpDDSBackGround);
|
||||||
lpDDSBackGround = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, false);
|
lpDDSBackGround = InitOffscreenSurface(C_DINK_SCREENSIZE_X, C_DINK_SCREENSIZE_Y, IDirectDrawSurface::MODE_SHADOW_GL, bHighColor);
|
||||||
|
|
||||||
g_onePixelSurf.HardKill();
|
g_onePixelSurf.HardKill();
|
||||||
}
|
}
|
||||||
|
|
|
@ -146,6 +146,7 @@ public:
|
||||||
float m_aspectRatioModX;
|
float m_aspectRatioModX;
|
||||||
float m_aspectRatioModY;
|
float m_aspectRatioModY;
|
||||||
CL_Vec3f m_centeringOffset;
|
CL_Vec3f m_centeringOffset;
|
||||||
|
CL_Mat4f m_dink_matrix;
|
||||||
};
|
};
|
||||||
//#define KYLES_CRAZY_VERSION
|
//#define KYLES_CRAZY_VERSION
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,8 @@ enum eTransparencyType
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//blt flags
|
//blt flags
|
||||||
#define DDBLT_KEYSRC 0x00008000l
|
#define DDBLT_KEYSRC 0x00008000l
|
||||||
#define DDBLT_COLORFILL 0x00000400l
|
#define DDBLT_COLORFILL 0x00000400l
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue