Reply to Re: Dink can't calculate
If you don't have an account, just leave the password field blank.
Uh... yeah... I would've thought any one following Dink development for more than a month or so would see how bug-ridden the engine is
Believe me, we've noticed. That's why we're writing it from scratch. The original code contains 39 instances of the word 'shoot', 21 instances of the word 'seth', and, get ready:
610 instances of the word 'crap'!
The new DinkC will have a parser similar to that of gcc. Multiple spaces are allowed, more than one operation is allowed per line, variables like &dinkc, &dinkd, &dink all are different. Also, variable declaration is optional. I will assure you that it WILL support modulus.
. I also find it disturbing that Seth did / instead of the correct /=.
Here are some snippets of code (I deleted some of the comments to save space):
/SNIP/
int DResourceServer::LoadResource(RESOURCE_TYPE eType, char* szFile)
{
for (ResourceList_It it = m_aResources.begin(); it != m_aResources.end(); ++it) {
if ((*it)->eType == eType && !_stricmp((*it)->szFile, szFile)) // types and files match
return (*it)->id;
}
DBaseResource* pRes;
switch (eType)
{
case RES_TEXTURE: {
pRes = new DTextureResource;
((DTextureResource*)pRes)->texID = DClientModule::Get()->LoadTexture(szFile);
if (((DTextureResource*)pRes)->texID == 0) {
delete pRes;
return 0;
/SNIP/
---
/SNIP/
#include <iostream>
#include <string>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <cstdlib> // } For varargs
#include <cstdarg> // } For varargs
#include <list> // For std::list
#include "../libs/fmod.h"
#if !defined(WIN32) || defined(__MINGW32__) // Linux or MinGW
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#else // Welcome to Microsoft, can I take your order?
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#endif // Would you like fries with that?
/SNIP/
---
/SNIP/
int DKernel::log(char* type, char* fmt, ...)
{
std::string firstout = "Windemere:";
std::string format = fmt;
va_list marker;
va_start(marker, fmt);
firstout.append(type);
firstout.append(": ");
for(int i = 0; i < format.size(); i++)
{
if(format.at(i) == '%') // 0x25 is %
{
if(format.at(i + 1) == 's') // %s detected
{
firstout.append(va_arg(marker, char*));
}
/SNIP/
---
And the main loop:
---
/SNIP/
int DKernel::MainLoop()
{
DClientModule::Get()->PreFrame();
if (!Events())
return 0;
DResourceServer::Get()->Frame();
DClientModule::Get()->RenderSprite(0, 0, 640, 480, 0, ((DTextureResource*)DResourceServer::Get()->GetResource(iTex))->texID); // Hell yeah.
DClientModule::Get()->PostFrame();
/SNIP/
Believe me, we've noticed. That's why we're writing it from scratch. The original code contains 39 instances of the word 'shoot', 21 instances of the word 'seth', and, get ready:
610 instances of the word 'crap'!
The new DinkC will have a parser similar to that of gcc. Multiple spaces are allowed, more than one operation is allowed per line, variables like &dinkc, &dinkd, &dink all are different. Also, variable declaration is optional. I will assure you that it WILL support modulus.

Here are some snippets of code (I deleted some of the comments to save space):
/SNIP/
int DResourceServer::LoadResource(RESOURCE_TYPE eType, char* szFile)
{
for (ResourceList_It it = m_aResources.begin(); it != m_aResources.end(); ++it) {
if ((*it)->eType == eType && !_stricmp((*it)->szFile, szFile)) // types and files match
return (*it)->id;
}
DBaseResource* pRes;
switch (eType)
{
case RES_TEXTURE: {
pRes = new DTextureResource;
((DTextureResource*)pRes)->texID = DClientModule::Get()->LoadTexture(szFile);
if (((DTextureResource*)pRes)->texID == 0) {
delete pRes;
return 0;
/SNIP/
---
/SNIP/
#include <iostream>
#include <string>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <cstdlib> // } For varargs
#include <cstdarg> // } For varargs
#include <list> // For std::list
#include "../libs/fmod.h"
#if !defined(WIN32) || defined(__MINGW32__) // Linux or MinGW
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#else // Welcome to Microsoft, can I take your order?
#include <SDL.h>
#include <SDL_image.h>
#include <SDL_ttf.h>
#endif // Would you like fries with that?
/SNIP/
---
/SNIP/
int DKernel::log(char* type, char* fmt, ...)
{
std::string firstout = "Windemere:";
std::string format = fmt;
va_list marker;
va_start(marker, fmt);
firstout.append(type);
firstout.append(": ");
for(int i = 0; i < format.size(); i++)
{
if(format.at(i) == '%') // 0x25 is %
{
if(format.at(i + 1) == 's') // %s detected
{
firstout.append(va_arg(marker, char*));
}
/SNIP/
---
And the main loop:
---
/SNIP/
int DKernel::MainLoop()
{
DClientModule::Get()->PreFrame();
if (!Events())
return 0;
DResourceServer::Get()->Frame();
DClientModule::Get()->RenderSprite(0, 0, 640, 480, 0, ((DTextureResource*)DResourceServer::Get()->GetResource(iTex))->texID); // Hell yeah.
DClientModule::Get()->PostFrame();
/SNIP/