Skip to content

Commit

Permalink
Finished rebranding to remove trademarks.
Browse files Browse the repository at this point in the history
  • Loading branch information
npiegdon committed May 4, 2012
1 parent 3fefe25 commit e20435c
Show file tree
Hide file tree
Showing 19 changed files with 110 additions and 103 deletions.
20 changes: 16 additions & 4 deletions PianoGame.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
RuntimeLibrary="3"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
/>
<Tool
Expand Down Expand Up @@ -129,7 +129,7 @@
DisableLanguageExtensions="false"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="0"
/>
<Tool
Expand Down Expand Up @@ -212,11 +212,11 @@
>
</File>
<File
RelativePath=".\src\SynthesiaError.cpp"
RelativePath=".\src\PianoGameError.cpp"
>
</File>
<File
RelativePath=".\src\SynthesiaError.h"
RelativePath=".\src\PianoGameError.h"
>
</File>
<File
Expand Down Expand Up @@ -443,6 +443,18 @@
<Filter
Name="Resources"
>
<File
RelativePath=".\license.txt"
>
</File>
<File
RelativePath=".\nsis_installer_script.nsi"
>
</File>
<File
RelativePath=".\readme.txt"
>
</File>
<File
RelativePath=".\src\resource.h"
>
Expand Down
Binary file modified graphics/TitleGraphics.psd
Binary file not shown.
Binary file removed graphics/title_GameMusicThemes.tga
Binary file not shown.
Binary file modified graphics/title_Logo.tga
Binary file not shown.
3 changes: 1 addition & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Visit http://www.synthesiagame.com/ for the latest version of this project.
Piano Game is mostly written by Nicholas Piegdon.

The following people have also contributed:
- Daniel Lawrence for the name Synthesia
- Luis Anton with an early version of the MIDI input code
- Troy Ramos with a suggestion to use Klavarskribo staff notation
- Dave Ray for his STRING/WSTRING macro
Expand Down Expand Up @@ -35,7 +34,7 @@ NEW: On the Mac, you can now drag a MIDI file to the application on the Dock or
in Finder or right click a MIDI file and choosing "Open With..." to open.
NEW: In Windows, added a low-tech solution to choose between different monitors
connected to the SAME video card (doesn't work in multi-video-card
situations.) (Set the string key HKCU\Software\Synthesia\Monitor to "0"
situations.) (Set the string key HKCU\Software\PianoGame\Monitor to "0"
for primary monitory, "1" for secondary, etc.)
CHG: Mac OpenGL display now has v-sync enabled.
CHG: Mac game window is now much less obtrusive. Other windows are allowed to
Expand Down
2 changes: 1 addition & 1 deletion src/CompatibleSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Compatible

void ShowError(const std::wstring &err)
{
const static std::wstring friendly_app_name = WSTRING(L"Synthesia " << SynthesiaVersionString);
const static std::wstring friendly_app_name = WSTRING(L"Piano Game " << PianoGameVersionString);
const static std::wstring message_box_title = WSTRING(friendly_app_name << L" Error");

#ifdef WIN32
Expand Down
10 changes: 5 additions & 5 deletions src/KeyboardDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "KeyboardDisplay.h"
#include "TrackProperties.h"
#include "SynthesiaError.h"
#include "PianoGameError.h"
#include "string_util.h"

#include "Renderer.h"
Expand Down Expand Up @@ -116,7 +116,7 @@ int KeyboardDisplay::GetStartingOctave() const
case KeyboardSize61: return StartingOctaveOn61;
case KeyboardSize76: return StartingOctaveOn76;
case KeyboardSize88: return StartingOctaveOn88;
default: throw SynthesiaError(Error_BadPianoType);
default: throw PianoGameError(Error_BadPianoType);
}
}

Expand All @@ -136,7 +136,7 @@ char KeyboardDisplay::GetStartingNote() const
case KeyboardSize61: return StartingKeyOn61;
case KeyboardSize76: return StartingKeyOn76;
case KeyboardSize88: return StartingKeyOn88;
default: throw SynthesiaError(Error_BadPianoType);
default: throw PianoGameError(Error_BadPianoType);
}
}

Expand All @@ -156,7 +156,7 @@ int KeyboardDisplay::GetWhiteKeyCount() const
case KeyboardSize61: return WhiteKeysOn61;
case KeyboardSize76: return WhiteKeysOn76;
case KeyboardSize88: return WhiteKeysOn88;
default: throw SynthesiaError(Error_BadPianoType);
default: throw PianoGameError(Error_BadPianoType);
}
}

Expand Down Expand Up @@ -407,7 +407,7 @@ void KeyboardDisplay::DrawNotePass(Renderer &renderer, const Tga *tex_white, con
case KeyboardSize61: keyboard_type_offset = 7 - WhiteNotesPerOctave; break; // TODO!
case KeyboardSize76: keyboard_type_offset = 5 - WhiteNotesPerOctave; break; // TODO!
case KeyboardSize88: keyboard_type_offset = 2 - WhiteNotesPerOctave; break;
default: throw SynthesiaError(Error_BadPianoType);
default: throw PianoGameError(Error_BadPianoType);
}

// This array describes how to "stack" notes in a single place. The IsBlackNote array
Expand Down
8 changes: 4 additions & 4 deletions src/SynthesiaError.cpp → src/PianoGameError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
// Copyright (c)2007 Nicholas Piegdon
// See license.txt for license information

#include "SynthesiaError.h"
#include "PianoGameError.h"
#include "string_util.h"

using namespace std;

std::wstring SynthesiaError::GetErrorDescription() const
std::wstring PianoGameError::GetErrorDescription() const
{
switch (m_error)
{
case Error_StringSpecified: return m_optional_string;

case Error_BadPianoType: return L"Bad piano type specified.";
case Error_BadGameState: return L"Internal Error: Synthesia entered bad game state!";
case Error_BadGameState: return L"Internal Error: Piano Game entered bad game state!";

default: return WSTRING(L"Unknown SynthesiaError Code (" << m_error << L").");
default: return WSTRING(L"Unknown PianoGameError Code (" << m_error << L").");
}
}

18 changes: 9 additions & 9 deletions src/SynthesiaError.h → src/PianoGameError.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@
// Copyright (c)2007 Nicholas Piegdon
// See license.txt for license information

#ifndef __SYNTHESIA_ERROR_H
#define __SYNTHESIA_ERROR_H
#ifndef __PIANOGAME_ERROR_H
#define __PIANOGAME_ERROR_H

#include <iostream>
#include <string>

enum SynthesiaErrorCode
enum PianoGameErrorCode
{
Error_StringSpecified,

Error_BadPianoType,
Error_BadGameState
};

class SynthesiaError : public std::exception
class PianoGameError : public std::exception
{
public:

// TODO: This would be a sweet place to add stack-trace information...

SynthesiaError(SynthesiaErrorCode error) : m_error(error), m_optional_string(L"") { }
SynthesiaError(const std::wstring error) : m_error(Error_StringSpecified), m_optional_string(error) { }
PianoGameError(PianoGameErrorCode error) : m_error(error), m_optional_string(L"") { }
PianoGameError(const std::wstring error) : m_error(Error_StringSpecified), m_optional_string(error) { }
std::wstring GetErrorDescription() const;

~SynthesiaError() throw() { }
~PianoGameError() throw() { }

const SynthesiaErrorCode m_error;
const PianoGameErrorCode m_error;

private:
const std::wstring m_optional_string;
SynthesiaError operator=(const SynthesiaError&);
PianoGameError operator=(const PianoGameError&);
};

#endif
5 changes: 2 additions & 3 deletions src/State_Title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ void TitleState::Update()

m_tooltip = L"";

if (m_back_button.hovering) m_tooltip = L"Click to exit Synthesia.";
if (m_back_button.hovering) m_tooltip = L"Click to exit Piano Game.";
if (m_continue_button.hovering) m_tooltip = L"Click to continue on to the track selection screen.";

if (m_file_tile->WholeTile().hovering) m_tooltip = L"Click to choose a different MIDI file.";
Expand Down Expand Up @@ -371,7 +371,6 @@ void TitleState::Draw(Renderer &renderer) const

renderer.SetColor(White);
renderer.DrawTga(GetTexture(TitleLogo), left, TitleY);
renderer.DrawTga(GetTexture(GameMusicThemes), left+3, TitleY + (compress_height ? 120 : 150) );

TextWriter version(Layout::ScreenMarginX, GetStateHeight() - Layout::ScreenMarginY - Layout::SmallFontSize * 2,
renderer, false, Layout::SmallFontSize);
Expand All @@ -381,7 +380,7 @@ void TitleState::Draw(Renderer &renderer) const
extra = L" debug";
#endif

version << Text(WSTRING(L"version " << SynthesiaVersionString << extra), Gray);
version << Text(WSTRING(L"version " << PianoGameVersionString << extra), Gray);

Layout::DrawHorizontalRule(renderer, GetStateWidth(), GetStateHeight() - Layout::ScreenMarginY);

Expand Down
18 changes: 9 additions & 9 deletions src/TextWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include "TextWriter.h"
#include "Renderer.h"
#include "SynthesiaError.h"
#include "PianoGameError.h"
#include "os_graphics.h"

#ifdef WIN32
Expand Down Expand Up @@ -80,13 +80,13 @@ x(in_x), y(in_y), size(in_size), original_x(0), last_line_height(0), centered(in
const CFStringRef font_name = CFSTR("Trebuchet MS");

ATSFontFamilyRef font = ATSFontFamilyFindFromName(font_name, kATSOptionFlagsDefault);
if (!font) throw SynthesiaError(WSTRING(L"Couldn't get ATSFontFamilyRef for font '" << WideFromMacString(font_name) << L"'."));
if (!font) throw PianoGameError(WSTRING(L"Couldn't get ATSFontFamilyRef for font '" << WideFromMacString(font_name) << L"'."));

AGLContext context = aglGetCurrentContext();
if (!context) throw SynthesiaError(L"Couldn't retrieve OpenGL context while creating font.");
if (!context) throw PianoGameError(L"Couldn't retrieve OpenGL context while creating font.");

GLboolean ret = aglUseFont(context, font, normal, size, 0, 128, list_start);
if (ret == GL_FALSE) throw SynthesiaError(WSTRING(L"aglUseFont() call failed with error code: " << aglGetError()));
if (ret == GL_FALSE) throw PianoGameError(WSTRING(L"aglUseFont() call failed with error code: " << aglGetError()));

font_size_lookup[size] = list_start;

Expand All @@ -95,15 +95,15 @@ x(in_x), y(in_y), size(in_size), original_x(0), last_line_height(0), centered(in
ATSUStyle style;

OSStatus status = ATSUCreateStyle(&style);
if (status != noErr) throw SynthesiaError(WSTRING(L"Couldn't create ATSU style. Error code: " << static_cast<int>(status)));
if (status != noErr) throw PianoGameError(WSTRING(L"Couldn't create ATSU style. Error code: " << static_cast<int>(status)));

Fixed fixed_size = Long2Fix(size);

ATSUAttributeTag tags[] = { kATSUSizeTag };
ByteCount sizes[] = { sizeof(Fixed) };
ATSUAttributeValuePtr values[] = { &fixed_size };
status = ATSUSetAttributes(style, sizeof(sizes) / sizeof(ByteCount), tags, sizes, values);
if (status != noErr) throw SynthesiaError(WSTRING(L"Couldn't set ATSU style attributes. Error code: " << static_cast<int>(status)));
if (status != noErr) throw PianoGameError(WSTRING(L"Couldn't set ATSU style attributes. Error code: " << static_cast<int>(status)));

atsu_style_lookup[size] = style;
}
Expand Down Expand Up @@ -182,14 +182,14 @@ void Text::calculate_position_and_advance_cursor(TextWriter &tw, int *out_x, int
// Convert passed-in text to Unicode
CFStringRef cftext = MacStringFromWide(m_text, true).get();
CFDataRef unitext = CFStringCreateExternalRepresentation(kCFAllocatorDefault, cftext, kCFStringEncodingUnicode, 0);
if (!unitext) throw SynthesiaError(WSTRING(L"Couldn't convert string to unicode: '" << m_text << L"'"));
if (!unitext) throw PianoGameError(WSTRING(L"Couldn't convert string to unicode: '" << m_text << L"'"));
CFRelease(cftext);

// Create an ATSU layout
ATSUTextLayout layout;
const UniCharCount run_length = kATSUToTextEnd;
OSStatus status = ATSUCreateTextLayoutWithTextPtr((ConstUniCharArrayPtr)CFDataGetBytePtr(unitext), kATSUFromTextBeginning, kATSUToTextEnd, CFDataGetLength(unitext) / 2, 1, &run_length, &atsu_style_lookup[tw.size], &layout);
if (status != noErr) throw SynthesiaError(WSTRING(L"Couldn't create ATSU text layout for string: '" << m_text << L"', Error code: " << static_cast<int>(status)));
if (status != noErr) throw PianoGameError(WSTRING(L"Couldn't create ATSU text layout for string: '" << m_text << L"', Error code: " << static_cast<int>(status)));

// Measure the size of the resulting text
Rect drawing_rect = { 0, 0, 0, 0 };
Expand All @@ -200,7 +200,7 @@ void Text::calculate_position_and_advance_cursor(TextWriter &tw, int *out_x, int
ATSUTextMeasurement descent = 0;

status = ATSUGetUnjustifiedBounds(layout, 0, kATSUToTextEnd, &before, &after, &ascent, &descent);
if (status != noErr) throw SynthesiaError(WSTRING(L"Couldn't get unjustified bounds for text layout for string: '" << m_text << L"', Error code: " << static_cast<int>(status)));
if (status != noErr) throw PianoGameError(WSTRING(L"Couldn't get unjustified bounds for text layout for string: '" << m_text << L"', Error code: " << static_cast<int>(status)));

// NOTE: the +1 here is completely arbitrary and seemed to place the text better.
// It may just be a difference between the Windows and Mac text placement systems.
Expand Down
2 changes: 0 additions & 2 deletions src/Textures.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ enum Texture
{
TitleLogo,
InterfaceButtons,
GameMusicThemes,

ButtonRetrySong,
ButtonChooseTracks,
Expand Down Expand Up @@ -45,7 +44,6 @@ const static wchar_t* TextureResourceNames[_TextureEnumCount] =
{
L"title_Logo",
L"InterfaceButtons",
L"title_GameMusicThemes",

L"score_RetrySong",
L"title_ChooseTracks",
Expand Down
22 changes: 11 additions & 11 deletions src/Tga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "os.h"
#include "os_graphics.h"
#include "string_util.h"
#include "SynthesiaError.h"
#include "PianoGameError.h"

Tga* Tga::Load(const std::wstring &resource_name)
{
Expand All @@ -14,13 +14,13 @@ Tga* Tga::Load(const std::wstring &resource_name)
const HMODULE module = 0;

HRSRC resource_id = FindResource(module, resource_name.c_str(), L"GRAPHICS");
if (!resource_id) throw SynthesiaError(L"Couldn't find TGA resource.");
if (!resource_id) throw PianoGameError(L"Couldn't find TGA resource.");

HGLOBAL resource = LoadResource(module, resource_id);
if (!resource) throw SynthesiaError(L"Couldn't load TGA resource.");
if (!resource) throw PianoGameError(L"Couldn't load TGA resource.");

const unsigned char *bytes = reinterpret_cast<unsigned char*>(LockResource(resource));
if (!bytes) throw SynthesiaError(L"Couldn't lock TGA resource.");
if (!bytes) throw PianoGameError(L"Couldn't lock TGA resource.");

Tga *ret = LoadFromData(bytes);
FreeResource(resource);
Expand All @@ -31,12 +31,12 @@ Tga* Tga::Load(const std::wstring &resource_name)
std::wstring full_name = WSTRING(resource_name << L".tga");

CFURLRef url = CFBundleCopyResourceURL(CFBundleGetMainBundle(), MacStringFromWide(full_name).get(), 0, 0);
if (!url) throw SynthesiaError(L"Couldn't find TGA resource.");
if (!url) throw PianoGameError(L"Couldn't find TGA resource.");

OSStatus status;
CFDataRef data;
Boolean success = CFURLCreateDataAndPropertiesFromResource(0, url, &data, 0, 0, &status);
if (!success || status != 0) throw SynthesiaError(L"Couldn't load TGA resource.");
if (!success || status != 0) throw PianoGameError(L"Couldn't load TGA resource.");

const UInt8 *bytes = CFDataGetBytePtr(data);

Expand Down Expand Up @@ -92,7 +92,7 @@ Tga *Tga::LoadFromData(const unsigned char *bytes)

if (type == TgaUnknown)
{
throw SynthesiaError(L"Unsupported TGA type.");
throw PianoGameError(L"Unsupported TGA type.");
}

// We're done with the type header
Expand All @@ -108,12 +108,12 @@ Tga *Tga::LoadFromData(const unsigned char *bytes)

if (width <= 0 || height <= 0)
{
throw SynthesiaError(L"Invalid TGA dimensions.");
throw PianoGameError(L"Invalid TGA dimensions.");
}

if (bpp != 24 && bpp != 32)
{
throw SynthesiaError(L"Unsupported TGA BPP.");
throw PianoGameError(L"Unsupported TGA BPP.");
}

const unsigned int data_size = width * height * bpp/8;
Expand Down Expand Up @@ -175,7 +175,7 @@ Tga *Tga::LoadCompressed(const unsigned char *src, unsigned char *dest, unsigned
byte += BytesPerPixel;
pixel++;

if (pixel > PixelCount) throw SynthesiaError(L"Too many pixels in TGA.");
if (pixel > PixelCount) throw PianoGameError(L"Too many pixels in TGA.");
}
}
else
Expand All @@ -195,7 +195,7 @@ Tga *Tga::LoadCompressed(const unsigned char *src, unsigned char *dest, unsigned
byte += BytesPerPixel;
pixel++;

if (pixel > PixelCount) throw SynthesiaError(L"Too many pixels in TGA.");
if (pixel > PixelCount) throw PianoGameError(L"Too many pixels in TGA.");
}
}
}
Expand Down
Loading

0 comments on commit e20435c

Please sign in to comment.