Author: rharabien
Date: Wed Aug 24 12:33:45 2011
New Revision: 53415
URL:
http://svn.reactos.org/svn/reactos?rev=53415&view=rev
Log:
[3DTEXT]
- Don't assume reg key exists
- Make rotation independent of computer speed
Modified:
trunk/reactos/base/applications/screensavers/3dtext/3dtext.c
trunk/reactos/base/applications/screensavers/3dtext/settings.c
Modified: trunk/reactos/base/applications/screensavers/3dtext/3dtext.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensa…
==============================================================================
--- trunk/reactos/base/applications/screensavers/3dtext/3dtext.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/screensavers/3dtext/3dtext.c [iso-8859-1] Wed Aug 24
12:33:45 2011
@@ -200,6 +200,9 @@
// Handles Rendering
GLvoid DrawGLScene(GLvoid)
{
+ // Save ticks count of previous frame here
+ static DWORD dwTicks = 0;
+
// Clear The Screen And The Depth Buffer
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
@@ -235,7 +238,9 @@
glColor3f(0.0f, 0.0f, 1.0f);
// Increase The Rotation Variable
- rot += 0.1f;
+ if(dwTicks)
+ rot += (GetTickCount() - dwTicks) / 20.0f;
+ dwTicks = GetTickCount();
}
LRESULT CALLBACK
Modified: trunk/reactos/base/applications/screensavers/3dtext/settings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/screensa…
==============================================================================
--- trunk/reactos/base/applications/screensavers/3dtext/settings.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/screensavers/3dtext/settings.c [iso-8859-1] Wed Aug 24
12:33:45 2011
@@ -22,32 +22,29 @@
#include "3dtext.h"
-TCHAR m_Text[MAX_PATH];
+TCHAR m_Text[MAX_PATH] = _T("ReactOS Rocks!");
VOID LoadSettings(VOID)
{
HKEY hkey;
DWORD len = MAX_PATH * sizeof(TCHAR);
- RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
- _T(""), 0, KEY_READ, NULL, &hkey, NULL);
-
- if (RegQueryValueEx(hkey, _T("DisplayString"), NULL, NULL, (LPBYTE)m_Text,
&len) != ERROR_SUCCESS)
- {
- _tcscpy(m_Text, _TEXT("ReactOS Rocks!"));
- }
-
- RegCloseKey(hkey);
+ if (RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
+ _T(""), 0, KEY_READ, NULL, &hkey, NULL) == ERROR_SUCCESS)
+ {
+ RegQueryValueEx(hkey, _T("DisplayString"), NULL, NULL, (LPBYTE)m_Text,
&len);
+ RegCloseKey(hkey);
+ }
}
VOID SaveSettings(VOID)
{
HKEY hkey;
- RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
- _T(""), 0, KEY_WRITE, NULL, &hkey, NULL);
-
- RegSetValueEx(hkey, _T("DisplayString"), 0, REG_SZ, (LPBYTE)m_Text,
(_tcslen(m_Text) + 1) * sizeof(TCHAR));
-
- RegCloseKey(hkey);
+ if (RegCreateKeyEx(HKEY_CURRENT_USER,
_T("Software\\Microsoft\\ScreenSavers\\Text3D"), 0,
+ _T(""), 0, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS)
+ {
+ RegSetValueEx(hkey, _T("DisplayString"), 0, REG_SZ, (LPBYTE)m_Text,
(_tcslen(m_Text) + 1) * sizeof(TCHAR));
+ RegCloseKey(hkey);
+ }
}