- Tweaked some error messages and comments. Hopefully, this is the last update for v0.2a's code.

- Documentation updates.
This commit is contained in:
Bart Trzynadlowski 2011-09-24 01:49:48 +00:00
parent b6923aeb9b
commit 7f97346fc9
4 changed files with 33 additions and 28 deletions

View file

@ -27,10 +27,10 @@ TODO: don't forget to add date to revision history!
================ ================
Supermodel emulates the Sega Model 3 arcade platform. It uses OpenGL 2.1 and Supermodel emulates the Sega Model 3 arcade platform. It uses OpenGL 2.1 and
runs on Windows, Linux, and Mac OS X. In order to use it, you must legally SDL, and can run on Windows, Linux, and Mac OS X. In order to use it, you must
possess ROM images of Model 3 games. Learning to operate Supermodel will come legally possess ROM images of Model 3 games. Learning to operate Supermodel
with a steep learning curve for most people. Before seeking out help, please will come with a steep learning curve for most people. Before seeking out
read this user manual carefully. help, please read this user manual carefully.
Supermodel is distributed as free software under the terms of the GNU General Supermodel is distributed as free software under the terms of the GNU General
Public License, included in LICENSE.txt. Additional copyright information for Public License, included in LICENSE.txt. Additional copyright information for

View file

@ -84,7 +84,7 @@ static char *LoadShaderSource(const char *file)
bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint *fragmentShaderPtr, const char *vsFile, const char *fsFile, const char *vsString, const char *fsString) bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint *fragmentShaderPtr, const char *vsFile, const char *fsFile, const char *vsString, const char *fsString)
{ {
char msg[2048+128], infoLog[2048]; char infoLog[2048];
const char *vsSource, *fsSource; // source code const char *vsSource, *fsSource; // source code
GLuint shaderProgram, vertexShader, fragmentShader; GLuint shaderProgram, vertexShader, fragmentShader;
GLint result, len; GLint result, len;
@ -109,7 +109,7 @@ bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint
if ((glCreateProgram==NULL) || (glCreateShader==NULL) || (glShaderSource==NULL) || (glCompileShader==NULL)) if ((glCreateProgram==NULL) || (glCreateShader==NULL) || (glShaderSource==NULL) || (glCompileShader==NULL))
{ {
ret = FAIL; ret = FAIL;
ErrorLog("OpenGL 2.0 does not appear to be present. Unable to proceed."); ErrorLog("OpenGL 2.x does not appear to be present. Unable to proceed.");
goto Quit; goto Quit;
} }
@ -128,7 +128,7 @@ bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint
if (!result) // failed to compile if (!result) // failed to compile
{ {
glGetShaderInfoLog(vertexShader, 2048, &len, infoLog); glGetShaderInfoLog(vertexShader, 2048, &len, infoLog);
ErrorLog("Vertex shader failed to compile. Compiler says:\n%s", infoLog); ErrorLog("Vertex shader failed to compile. Your OpenGL driver said:\n%s", infoLog);
ret = FAIL; // error ret = FAIL; // error
} }
@ -139,8 +139,7 @@ bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint
if (!result) // failed to compile if (!result) // failed to compile
{ {
glGetShaderInfoLog(fragmentShader, 2048, &len, infoLog); glGetShaderInfoLog(fragmentShader, 2048, &len, infoLog);
ErrorLog("Fragment shader failed to compile. Compiler says:\n%s", infoLog); ErrorLog("Fragment shader failed to compile. Your OpenGL driver said:\n%s", infoLog);
fprintf(stderr, msg);
ret = FAIL; // error ret = FAIL; // error
} }
@ -152,7 +151,7 @@ bool LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint
if (result == GL_FALSE) if (result == GL_FALSE)
{ {
glGetProgramInfoLog(shaderProgram, 2048, &len, infoLog); glGetProgramInfoLog(shaderProgram, 2048, &len, infoLog);
ErrorLog("Failed to link shader objects. Linker says:\n%s\n", infoLog); ErrorLog("Failed to link shader objects. Your OpenGL driver said:\n%s\n", infoLog);
ret = FAIL; // error ret = FAIL; // error
} }

View file

@ -1313,7 +1313,7 @@ int main(int argc, char **argv)
int f; int f;
ret = sscanf(&argv[i][14],"=%d",&f); ret = sscanf(&argv[i][14],"=%d",&f);
if (ret != 1) if (ret != 1)
ErrorLog("-ppc-frequency requires a frequency."); ErrorLog("'-ppc-frequency' requires a frequency.");
else else
CmdLine.Set("Global", "PowerPCFrequency", f); CmdLine.Set("Global", "PowerPCFrequency", f);
} }
@ -1332,7 +1332,7 @@ int main(int argc, char **argv)
{ {
ret = sscanf(&argv[i][13],"=%d",&n); ret = sscanf(&argv[i][13],"=%d",&n);
if (ret != 1) if (ret != 1)
ErrorLog("-sound-volume requires a volume setting."); ErrorLog("'-sound-volume' requires a volume setting.");
else else
CmdLine.Set("Global", "SoundVolume", n); CmdLine.Set("Global", "SoundVolume", n);
} }
@ -1340,7 +1340,7 @@ int main(int argc, char **argv)
{ {
ret = sscanf(&argv[i][13],"=%d",&n); ret = sscanf(&argv[i][13],"=%d",&n);
if (ret != 1) if (ret != 1)
ErrorLog("-music-volume requires a volume setting."); ErrorLog("'-music-volume' requires a volume setting.");
else else
CmdLine.Set("Global", "MusicVolume", n); CmdLine.Set("Global", "MusicVolume", n);
} }
@ -1372,7 +1372,7 @@ int main(int argc, char **argv)
ret = sscanf(&argv[i][4],"=%d,%d",&x,&y); ret = sscanf(&argv[i][4],"=%d,%d",&x,&y);
if (ret != 2) if (ret != 2)
ErrorLog("-res requires both a width and a height."); ErrorLog("'-res' requires both a width and a height.");
else else
{ {
CmdLine.Set("Global", "XResolution", x); CmdLine.Set("Global", "XResolution", x);
@ -1394,17 +1394,25 @@ int main(int argc, char **argv)
n = 1; n = 1;
CmdLine.Set("Global", "ShowFrameRate", n); CmdLine.Set("Global", "ShowFrameRate", n);
} }
else if (!strncmp(argv[i],"-vert-shader=",13)) else if (!strncmp(argv[i],"-vert-shader",12))
{ {
if (argv[i][13] == '\0') if (argv[i][12] == '\0')
ErrorLog("-vert-shader requires a file path."); ErrorLog("'-vert-shader' requires a file path.");
else if (argv[i][12] != '=')
ErrorLog("Ignoring unrecognized option: %s", argv[i]);
else if (argv[i][13] == '\0')
ErrorLog("'-vert-shader' requires a file path.");
else else
CmdLine.Set("Global", "VertexShader", &argv[i][13]); CmdLine.Set("Global", "VertexShader", &argv[i][13]);
} }
else if (!strncmp(argv[i],"-frag-shader=",13)) else if (!strncmp(argv[i],"-frag-shader",12))
{ {
if (argv[i][13] == '\0') if (argv[i][12] == '\0')
ErrorLog("-frag-shader requires a file path."); ErrorLog("'-frag-shader' requires a file path.");
else if (argv[i][12] != '=')
ErrorLog("Ignoring unrecognized option: %s", argv[i]);
else if (argv[i][13] == '\0')
ErrorLog("'-frag-shader' requires a file path.");
else else
CmdLine.Set("Global", "FragmentShader", &argv[i][13]); CmdLine.Set("Global", "FragmentShader", &argv[i][13]);
} }
@ -1412,11 +1420,11 @@ int main(int argc, char **argv)
else if (!strncmp(argv[i],"-input-system", 13)) // this setting is not written to the config file! else if (!strncmp(argv[i],"-input-system", 13)) // this setting is not written to the config file!
{ {
if (argv[i][13] == '\0') if (argv[i][13] == '\0')
ErrorLog("-input-system requires an input system name."); ErrorLog("'-input-system' requires an input system name.");
else if (argv[i][13] != '=') else if (argv[i][13] != '=')
ErrorLog("Ignoring unrecognized option: %s.", argv[i]); ErrorLog("Ignoring unrecognized option: %s", argv[i]);
else if (argv[i][14] == '\0') else if (argv[i][14] == '\0')
ErrorLog("-input-system requires an input system name."); ErrorLog("'-input-system' requires an input system name.");
else else
inputSystem = &argv[i][14]; inputSystem = &argv[i][14];
} }
@ -1436,7 +1444,7 @@ int main(int argc, char **argv)
else if (ret == 2) else if (ret == 2)
cmdDis = true; cmdDis = true;
else else
ErrorLog("-dis requires address and, optionally, number of instructions."); ErrorLog("'-dis' requires address and, optionally, number of instructions.");
} }
else if (!strcmp(argv[i],"-print-gl-info")) else if (!strcmp(argv[i],"-print-gl-info"))
{ {
@ -1444,7 +1452,7 @@ int main(int argc, char **argv)
return 0; return 0;
} }
else if (argv[i][0] == '-') else if (argv[i][0] == '-')
ErrorLog("Ignoring unrecognized option: %s.", argv[i]); ErrorLog("Ignoring unrecognized option: %s", argv[i]);
else else
{ {
if (fileIdx) // already specified a file if (fileIdx) // already specified a file
@ -1484,7 +1492,7 @@ int main(int argc, char **argv)
#endif // SUPERMODEL_WIN32 #endif // SUPERMODEL_WIN32
else else
{ {
ErrorLog("Unknown input system: %s.\n", g_Config.GetInputSystem()); ErrorLog("Unknown input system: %s\n", g_Config.GetInputSystem());
exitCode = 1; exitCode = 1;
goto Exit; goto Exit;
} }

View file

@ -39,8 +39,6 @@
* *
* To-Do List * To-Do List
* ---------- * ----------
* - Remove asserts() in DSP code and make sure memory allocation errors are
* being handled properly.
* - Wrap up into an object. Remove any unused #ifdef pathways. * - Wrap up into an object. Remove any unused #ifdef pathways.
*/ */