Index: cpp/frams/genetics/genman.cpp
===================================================================
--- cpp/frams/genetics/genman.cpp	(revision 530)
+++ cpp/frams/genetics/genman.cpp	(revision 532)
@@ -210,8 +210,8 @@
 	if (check1 == GENOPER_NOOPER) //disaster: cannot check because there is no check operator
 	{
-		g.setGene(g2); free(g2); canvalidate = false; return GENOPER_NOOPER;
+		g.setGeneOnly(g2); free(g2); canvalidate = false; return GENOPER_NOOPER;
 	}
 	int check2 = gf->checkValidity(g2, "validated");
-	if (check2 == GENOPER_OK) g.setGene(g2);
+	if (check2 == GENOPER_OK) g.setGeneOnly(g2);
 	free(g2);
 	if (check2 == GENOPER_OK) return check1;
@@ -231,5 +231,5 @@
 }
 
-Geno GenMan::Validate(const Geno& geny)
+Geno GenMan::validate(const Geno& geny)
 {
 	char format = geny.getFormat();
@@ -247,5 +247,5 @@
 }
 
-Geno GenMan::Mutate(const Geno& g)
+Geno GenMan::mutate(const Geno& g)
 {
 	float chg; //how many changes
@@ -298,5 +298,5 @@
 }
 
-Geno GenMan::CrossOver(const Geno& g1, const Geno& g2)
+Geno GenMan::crossOver(const Geno& g1, const Geno& g2)
 {
 	char format = g1.getFormat();
@@ -364,5 +364,5 @@
 }
 
-float GenMan::Similarity(const Geno& g1, const Geno& g2)
+float GenMan::similarity(const Geno& g1, const Geno& g2)
 {
 	char format = g1.getFormat();
@@ -372,25 +372,46 @@
 }
 
-uint32_t GenMan::Style(const char *g, int pos)
+uint32_t GenMan::getStyle(const char *g, const Geno *G, int pos)
+{
+	char format = G->getFormat();
+	if (format == Geno::INVALID_FORMAT)
+		return GENSTYLE_RGBS(64, 64, 64, 0); // gray & "valid" (unknown format so we don't know what is valid and what is not)
+	if ((pos = G->mapStringToGen(pos)) == -1) return GENSTYLE_COMMENT;
+	GenoOperators *gf = getOper_f(format);
+	if (!gf) return GENSTYLE_CS(0, 0); //black & valid
+	else return gf->style(G->getGene().c_str(), pos);
+}
+
+uint32_t GenMan::getStyle(const char *g, int pos)
 {
 	Geno G(g);
-	if ((pos = G.mapStringToGen(pos)) == -1) return GENSTYLE_COMMENT;
-	GenoOperators *gf = getOper_f(G.getFormat());
-	if (!gf) return GENSTYLE_CS(0, 0); //black & valid
-	else return gf->style(G.getGene().c_str(), pos);
-}
-
-void GenMan::GetFullStyle(const char *g, uint32_t *styletab)
-{
-	Geno G(g);
-	GenoOperators *gf = getOper_f(G.getFormat());
-	SString geny = G.getGene();
+	return getStyle(g, &G, pos);
+}
+
+void GenMan::getFullStyle(const char *g, const Geno *G, uint32_t *styletab)
+{
+	char format = G->getFormat();
+	if (format == Geno::INVALID_FORMAT)
+	{
+		for (unsigned int pos = 0; pos < strlen(g); pos++)
+			styletab[pos] = GENSTYLE_RGBS(64, 64, 64, 0); // gray & "valid" (unknown format so we don't know what is valid and what is not)
+		return;
+	}
+	GenoOperators *gf = getOper_f(format);
+	SString geny=G->getGene();
 	for (unsigned int pos = 0; pos < strlen(g); pos++)
 	{
-		int posmapped = G.mapStringToGen(pos);
+		int posmapped = G->mapStringToGen(pos);
 		if (posmapped == -1) styletab[pos] = GENSTYLE_COMMENT;
 		else if (!gf) styletab[pos] = GENSTYLE_CS(0, 0); //black & valid
 		else styletab[pos] = gf->style(geny.c_str(), posmapped);
-	}
+		//logPrintf("GenMan", "getFullStyle", 0, "%d  char='%c' (%d)  format=0x%08x", pos, g[pos], g[pos], styletab[pos]);
+	}
+}
+
+void GenMan::getFullStyle(const char *g, uint32_t *styletab)
+{
+	Geno G(g);
+	getFullStyle(g, &G, styletab);
 }
 
@@ -406,5 +427,5 @@
 	bool shortened = false;
 	uint32_t *styletab = new uint32_t[len];
-	GetFullStyle(g, styletab);
+	getFullStyle(g, styletab);
 	string html = "\n<div style=\"background:white;padding:0.2em;font-family:arial,helvetica,sans-serif;font-size:90%\">";
 	uint32_t prevstyle, prevcolor, style = 0, color = 0;
@@ -456,5 +477,5 @@
 }
 
-Geno GenMan::GetSimplest(char format)
+Geno GenMan::getSimplest(char format)
 {
 	GenoOperators *gf = getOper_f(format);
@@ -471,8 +492,8 @@
 		ret->setEmpty();
 	else
-		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(GetSimplest(format)));
-}
-
-const char *GenMan::GetOpName(char format)
+		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(getSimplest(format)));
+}
+
+const char *GenMan::getOpName(char format)
 {
 	GenoOperators *gf = getOper_f(format);
@@ -560,5 +581,5 @@
 		ret->setEmpty();
 	else
-		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(Validate(*g)));
+		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(validate(*g)));
 }
 
@@ -569,5 +590,5 @@
 		ret->setEmpty();
 	else
-		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(Mutate(*g)));
+		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(mutate(*g)));
 }
 
@@ -579,4 +600,5 @@
 		ret->setEmpty();
 	else
-		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(CrossOver(*g1, *g2)));
-}
+		*ret = GenoObj::makeDynamicObjectAndDecRef(new Geno(crossOver(*g1, *g2)));
+}
+
Index: cpp/frams/genetics/genman.h
===================================================================
--- cpp/frams/genetics/genman.h	(revision 530)
+++ cpp/frams/genetics/genman.h	(revision 532)
@@ -1,4 +1,4 @@
 // This file is a part of Framsticks SDK.  http://www.framsticks.com/
-// Copyright (C) 1999-2015  Maciej Komosinski and Szymon Ulatowski.
+// Copyright (C) 1999-2016  Maciej Komosinski and Szymon Ulatowski.
 // See LICENSE.txt for details.
 
@@ -42,14 +42,16 @@
 	int testValidity(Geno &g, bool &canvalidate);
 	int testGenoValidity(Geno& g); //class GenoValidator (geno.h)
-	Geno Validate(const Geno&); ///<returns validated (if possible) genotype
-	Geno Mutate(const Geno&); //returns mutated genotype or empty if errors
-	Geno CrossOver(const Geno&, const Geno&); //returns xover genotype ("child") or empty if errors
-	float Similarity(const Geno&, const Geno&); //returns GENOPER_NOOPER or normalized similarity (1: identical, 0: different)
-	uint32_t Style(const char* g, int pos); //returns Style (and validity) of a genotype char.
-	void GetFullStyle(const char *g, uint32_t *styletab); //optimized. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g).
+	Geno validate(const Geno&); ///<returns validated (if possible) genotype
+	Geno mutate(const Geno&); //returns mutated genotype or empty if errors
+	Geno crossOver(const Geno&, const Geno&); //returns xover genotype ("child") or empty if errors
+	float similarity(const Geno&, const Geno&); //returns GENOPER_NOOPER or normalized similarity (1: identical, 0: different)
+	uint32_t getStyle(const char* g, int pos); //returns style (and validity) of a genotype char.
+	uint32_t getStyle(const char *g, const Geno *G, int pos); //returns style (and validity) of a genotype char. Assumes G is created from g.
+	void getFullStyle(const char *g, uint32_t *styletab); //optimized. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g).
+	void getFullStyle(const char *g, const Geno *G, uint32_t *styletab); //optimized. Assumes G is created from g. Fills styletab with styles for all genotype chars. sizeof(*styletab) must be at least strlen(g).
 	string HTMLize(const char *g); //returns colored genotype in HTML.
 	string HTMLizeShort(const char *g); //returns colored genotype (abbreviated if needed) in HTML.
-	Geno GetSimplest(char format); ///<returns pointer to the simplest genotype of \e format or empty Geno()
-	const char *GetOpName(char format); ///<returns pointer to the active operator set for \e format
+	Geno getSimplest(char format); ///<returns pointer to the simplest genotype of \e format or empty Geno()
+	const char *getOpName(char format); ///<returns pointer to the active operator set for \e format
 	const vector<GenoOperators*>& GetOperators() const { return oper_fx_list; } ///<returns the list of available genetic operators
 private:
