16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 10:29:19 +02:00

fixes for sound transcripts, conversion of win1250cp to plain ascii, tga loader

This commit is contained in:
tmj-fstate
2017-02-15 00:37:12 +01:00
parent b0ed27ba91
commit cf48989f39
11 changed files with 148 additions and 24 deletions

View File

@@ -412,6 +412,21 @@ std::string ToUpper(std::string const &text)
return uppercase;
}
// replaces polish letters with basic ascii
void
win1250_to_ascii( std::string &Input ) {
std::unordered_map<char, char> charmap{
{ 165, 'A' }, { 198, 'C' }, { 202, 'E' }, { 163, 'L' }, { 209, 'N' }, { 211, 'O' }, { 140, 'S' }, { 143, 'Z' }, { 175, 'Z' },
{ 185, 'a' }, { 230, 'c' }, { 234, 'e' }, { 179, 'l' }, { 241, 'n' }, { 243, 'o' }, { 156, 's' }, { 159, 'z' }, { 191, 'z' }
};
std::unordered_map<char, char>::const_iterator lookup;
for( auto &input : Input ) {
if( ( lookup = charmap.find( input ) ) != charmap.end() )
input = lookup->second;
}
}
void ComputeArc(double X0, double Y0, double Xn, double Yn, double R, double L, double dL,
double &phi, double &Xout, double &Yout)
/*wylicza polozenie Xout Yout i orientacje phi punktu na elemencie dL luku*/