MCPcopy Create free account
hub / github.com/JACoders/OpenJK / ParseRGB

Method ParseRGB

codeJK2/icarus/Tokenizer.cpp:2742–2772  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2740}
2741
2742COLORREF CTokenizer::ParseRGB()
2743{
2744 CToken* theToken = GetToken();
2745 if (theToken->GetType() != TK_INT)
2746 {
2747 Error(TKERR_EXPECTED_INTEGER);
2748 theToken->Delete();
2749 return RGB(0, 0, 0);
2750 }
2751 int red = theToken->GetIntValue();
2752 theToken->Delete();
2753 theToken = GetToken();
2754 if (theToken->GetType() != TK_INT)
2755 {
2756 Error(TKERR_EXPECTED_INTEGER);
2757 theToken->Delete();
2758 return RGB(0, 0, 0);
2759 }
2760 int green = theToken->GetIntValue();
2761 theToken->Delete();
2762 theToken = GetToken();
2763 if (theToken->GetType() != TK_INT)
2764 {
2765 Error(TKERR_EXPECTED_INTEGER);
2766 theToken->Delete();
2767 return RGB(0, 0, 0);
2768 }
2769 int blue = theToken->GetIntValue();
2770 theToken->Delete();
2771 return RGB(red, green, blue);
2772}
2773
2774//
2775// CSymbolLookup

Callers

nothing calls this directly

Calls 4

GetTokenFunction · 0.50
GetTypeMethod · 0.45
DeleteMethod · 0.45
GetIntValueMethod · 0.45

Tested by

no test coverage detected