Added todo, const correctness.

This commit is contained in:
Felix Wallin 2010-09-03 16:05:09 +02:00
parent aba3109f6f
commit 5b5a80c0af
4 changed files with 21 additions and 18 deletions

View File

@ -799,7 +799,7 @@ inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a)
return x + w;
}
int drawtext(pixel *vid, int x, int y, char *s, int r, int g, int b, int a)
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a)
{
#ifdef OpenGL
#else

View File

@ -75,7 +75,7 @@ _inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a
extern inline int drawchar(pixel *vid, int x, int y, int c, int r, int g, int b, int a);
#endif
int drawtext(pixel *vid, int x, int y, char *s, int r, int g, int b, int a);
int drawtext(pixel *vid, int x, int y, const char *s, int r, int g, int b, int a);
void drawrect(pixel *vid, int x, int y, int w, int h, int r, int g, int b, int a);

10
main.c
View File

@ -50,7 +50,7 @@
#include "air.h"
#include "icon.h"
char *it_msg =
static const char *it_msg =
"\brThe Powder Toy\n"
"\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\n"
"\n"
@ -90,9 +90,9 @@ typedef struct
} upstruc;
#ifdef BETA
char *old_ver_msg_beta = "A new beta is available - click here!";
static const char *old_ver_msg_beta = "A new beta is available - click here!";
#endif
char *old_ver_msg = "A new version is available - click here!";
static const char *old_ver_msg = "A new version is available - click here!";
float mheat = 0.0f;
int do_open = 0;
@ -130,7 +130,7 @@ int core_count()
return numCPU;
}
int mousex, mousey = 0; //They contain mouse position
int mousex = 0, mousey = 0; //They contain mouse position
void sdl_seticon(void)
{
@ -964,7 +964,7 @@ int main(int argc, char *argv[])
#ifdef MT
numCores = core_count();
#endif
//TODO: Move out version stuff
#ifdef BETA
if(is_beta)
{

View File

@ -114,12 +114,15 @@
#define ST_SOLID 1
#define ST_LIQUID 2
#define ST_GAS 3
static unsigned char TYPE_PART = 0x01; //1
static unsigned char TYPE_LIQUID = 0x02; //2
static unsigned char TYPE_SOLID = 0x04; //4
static unsigned char TYPE_GAS = 0x08; //8
static unsigned char PROP_CONDUCTS = 0x10; //16
/*
We should start to implement these.
*/
static const unsigned short TYPE_PART = 0x01; //1
static const unsigned short TYPE_LIQUID = 0x02; //2
static const unsigned short TYPE_SOLID = 0x04; //4
static const unsigned short TYPE_GAS = 0x08; //8
static const unsigned short PROP_CONDUCTS = 0x10; //16
static const unsigned short PROP_DEADLY = 0x12; //18 Is deadly for stickman.
#define FLAG_STAGNANT 1
struct particle
@ -156,7 +159,7 @@ struct part_type
float heat;
unsigned char hconduct;
const char *descs;
unsigned char properties;
const unsigned short properties;
};
typedef struct part_type part_type;
@ -173,8 +176,8 @@ struct part_state
float btemp;
};
typedef struct part_state part_state;
static part_type ptypes[PT_NUM] =
//Should probably be const.
static const part_type ptypes[PT_NUM] =
{
//Name Colour Advec Airdrag Airloss Loss Collid Grav Diffus Hotair Fal Burn Exp Mel Hrd M Section H Ins(real world, by triclops200) Description
{"", PIXPACK(0x000000), 0.0f, 0.00f * CFDS, 1.00f, 0.00f, 0.0f, 0.0f, 0.00f, 0.000f * CFDS, 0, 0, 0, 0, 1, 1, SC_SPECIAL, R_TEMP+0.0f, 251, "Erases particles."},