fix a few of the most spammy warnings (there are still hundreds of warnings though)

TODO: actually fix all the warnings
This commit is contained in:
jacob1 2014-10-23 00:40:55 -04:00
parent 16522056fb
commit 6463d04f6c
26 changed files with 62 additions and 62 deletions

View File

@ -2,7 +2,7 @@
#define FONT_H_CHECK #define FONT_H_CHECK
#define FONT_H 10 #define FONT_H 10
#ifdef INCLUDE_FONTDATA #ifdef INCLUDE_FONTDATA
char font_data[] = { unsigned char font_data[] = {
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -295,7 +295,7 @@ short font_ptrs[] = {
0x11A1, 0x11B1, 0x11C1, 0x11D1, 0x11E1, 0x11F1, 0x1201, 0x1211, 0x11A1, 0x11B1, 0x11C1, 0x11D1, 0x11E1, 0x11F1, 0x1201, 0x1211,
}; };
#else #else
extern char font_data[]; extern unsigned char font_data[];
extern short font_ptrs[]; extern short font_ptrs[];
#endif #endif
#endif #endif

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/ */
static unsigned char icon_doc_32_png[] = { const static unsigned char icon_doc_32_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
@ -100,7 +100,7 @@ static unsigned char icon_doc_32_png[] = {
0xbf, 0x2f, 0x89, 0x69, 0x46, 0x25, 0x68, 0x1c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0xbf, 0x2f, 0x89, 0x69, 0x46, 0x25, 0x68, 0x1c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82 0x44, 0xae, 0x42, 0x60, 0x82
}; };
static unsigned char icon_doc_16_png[] = { const static unsigned char icon_doc_16_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,

File diff suppressed because one or more lines are too long

View File

@ -87,10 +87,10 @@ std::string format::CleanString(std::string dirtyString, size_t maxVisualSize, s
{ {
newString = newString.substr(0, maxVisualSize/10); newString = newString.substr(0, maxVisualSize/10);
} }
for(int i = 0; i < newString.size(); i++){ for (unsigned int i = 0; i < newString.size(); i++)
if(!(newString[i]>=' ' && newString[i]<127)){ //Clamp to ASCII range {
if (!(newString[i]>=' ' && newString[i]<127)) //Clamp to ASCII range
newString[i] = '?'; //Replace with "huh" char newString[i] = '?'; //Replace with "huh" char
}
} }
return newString; return newString;
} }
@ -113,10 +113,10 @@ std::string format::CleanString(char * dirtyData, size_t maxVisualSize, size_t m
{ {
newString = newString.substr(0, maxVisualSize/10); newString = newString.substr(0, maxVisualSize/10);
} }
for(int i = 0; i < newString.size(); i++){ for (unsigned int i = 0; i < newString.size(); i++)
if(!(newString[i]>=' ' && newString[i]<127)){ //Clamp to ASCII range {
if (!(newString[i]>=' ' && newString[i]<127)) //Clamp to ASCII range
newString[i] = '?'; //Replace with "huh" char newString[i] = '?'; //Replace with "huh" char
}
} }
return newString; return newString;
} }

View File

@ -7,7 +7,7 @@ class VideoBuffer;
namespace format namespace format
{ {
static char hex[] = "0123456789ABCDEF"; const static char hex[] = "0123456789ABCDEF";
template <typename T> std::string NumberToString(T number) template <typename T> std::string NumberToString(T number)
{ {

View File

@ -20,6 +20,7 @@
#include <mach-o/dyld.h> #include <mach-o/dyld.h>
#endif #endif
const static char hex[] = "0123456789ABCDEF";
std::string URLEscape(std::string source) std::string URLEscape(std::string source)
{ {
char * src = (char *)source.c_str(); char * src = (char *)source.c_str();
@ -161,14 +162,16 @@ void strlist_free(struct strlist **list)
} }
} }
void clean_text(char *text, int vwidth) void clean_text(char *text, unsigned int vwidth)
{ {
int i = 0; if (strlen(text)*10 > vwidth)
if(strlen(text)*10 > vwidth){ {
text[vwidth/10] = 0; text[vwidth/10] = 0;
} }
for(i = 0; i < strlen(text); i++){ for (unsigned i = 0; i < strlen(text); i++)
if(! (text[i]>=' ' && text[i]<127)){ {
if (! (text[i]>=' ' && text[i]<127))
{
text[i] = ' '; text[i] = ' ';
} }
} }
@ -626,7 +629,7 @@ void membwand(void * destv, void * srcv, size_t destsize, size_t srcsize)
int splitsign(const char* str, char * type) int splitsign(const char* str, char * type)
{ {
int match=0,r; int r;
if (str[0]=='{' && (str[1]=='c' || str[1]=='t' || str[1]=='b')) if (str[0]=='{' && (str[1]=='c' || str[1]=='t' || str[1]=='b'))
{ {
const char* p=str+2; const char* p=str+2;

View File

@ -22,8 +22,6 @@ __asm__ __volatile ("cpuid":\
"=a" (af), "=b" (bf), "=c" (cf), "=d" (df) : "a" (func)); "=a" (af), "=b" (bf), "=c" (cf), "=d" (df) : "a" (func));
#endif #endif
static char hex[] = "0123456789ABCDEF";
char *exe_name(void); char *exe_name(void);
//Linear interpolation //Linear interpolation

View File

@ -333,7 +333,7 @@ int SDLOpen()
SendMessage(WindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall); SendMessage(WindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall);
SendMessage(WindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hIconBig); SendMessage(WindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hIconBig);
#elif defined(LIN) #elif defined(LIN)
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon, 16, 16, 32, 64, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); SDL_Surface *icon = SDL_CreateRGBSurfaceFrom((void*)app_icon, 16, 16, 32, 64, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_WM_SetIcon(icon, NULL); SDL_WM_SetIcon(icon, NULL);
#endif #endif
@ -949,7 +949,7 @@ int main(int argc, char * argv[])
{ {
std::string saveIdPart = ""; std::string saveIdPart = "";
int saveId; int saveId;
int hashPos = ptsaveArg.find('#'); unsigned int hashPos = ptsaveArg.find('#');
if(hashPos != std::string::npos) if(hashPos != std::string::npos)
{ {
saveIdPart = ptsaveArg.substr(7, hashPos-7); saveIdPart = ptsaveArg.substr(7, hashPos-7);

View File

@ -67,10 +67,10 @@ void writeUserPreferences(const char * prefData);
Client::Client(): Client::Client():
authUser(0, ""), messageOfTheDay(""),
updateAvailable(false),
versionCheckRequest(NULL), versionCheckRequest(NULL),
messageOfTheDay("") updateAvailable(false),
authUser(0, "")
{ {
int i = 0; int i = 0;
for(i = 0; i < THUMB_CACHE_SIZE; i++) for(i = 0; i < THUMB_CACHE_SIZE; i++)

View File

@ -40,9 +40,9 @@ public:
int Build; int Build;
int Time; int Time;
BuildType Type; BuildType Type;
UpdateInfo() : Major(0), Minor(0), Build(0), Time(0), File(""), Type(Stable) {} UpdateInfo() : File(""), Major(0), Minor(0), Build(0), Time(0), Type(Stable) {}
UpdateInfo(int major, int minor, int build, std::string file, BuildType type) : Major(major), Minor(minor), Build(build), Time(0), File(file), Type(type) {} UpdateInfo(int major, int minor, int build, std::string file, BuildType type) : File(file), Major(major), Minor(minor), Build(build), Time(0), Type(type) {}
UpdateInfo(int time, std::string file, BuildType type) : Major(0), Minor(0), Build(0), Time(time), File(file), Type(type) {} UpdateInfo(int time, std::string file, BuildType type) : File(file), Major(0), Minor(0), Build(0), Time(time), Type(type) {}
}; };
class RequestListener; class RequestListener;

View File

@ -973,7 +973,7 @@ void GameSave::readOPS(char * data, int dataLength)
int caddress = restrict_flt(restrict_flt((float)(particles[newIndex].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); int caddress = restrict_flt(restrict_flt((float)(particles[newIndex].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
particles[newIndex].type = PT_EMBR; particles[newIndex].type = PT_EMBR;
particles[newIndex].tmp = 1; particles[newIndex].tmp = 1;
particles[newIndex].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); particles[newIndex].ctype = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
} }
break; break;
case PT_PSTN: case PT_PSTN:
@ -1639,7 +1639,7 @@ void GameSave::readPSv(char * data, int dataLength)
int caddress = restrict_flt(restrict_flt((float)(particles[i-1].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); int caddress = restrict_flt(restrict_flt((float)(particles[i-1].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
particles[i-1].type = PT_EMBR; particles[i-1].type = PT_EMBR;
particles[i-1].tmp = 1; particles[i-1].tmp = 1;
particles[i-1].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); particles[i-1].ctype = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
} }
} }
if (ver < 88) //fix air blowing stickmen if (ver < 88) //fix air blowing stickmen

View File

@ -20,7 +20,7 @@
#ifndef HTTP_H #ifndef HTTP_H
#define HTTP_H #define HTTP_H
static char hexChars[] = "0123456789abcdef"; static const char hexChars[] = "0123456789abcdef";
void http_init(char *proxy); void http_init(char *proxy);
void http_done(void); void http_done(void);

View File

@ -89,7 +89,7 @@ void VideoBuffer::Resize(int width, int height, bool resample, bool fixedRatio)
int VideoBuffer::SetCharacter(int x, int y, int c, int r, int g, int b, int a) int VideoBuffer::SetCharacter(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
for (j=0; j<FONT_H; j++) for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++) for (i=0; i<w; i++)
@ -109,7 +109,7 @@ int VideoBuffer::SetCharacter(int x, int y, int c, int r, int g, int b, int a)
int VideoBuffer::BlendCharacter(int x, int y, int c, int r, int g, int b, int a) int VideoBuffer::BlendCharacter(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
for (j=0; j<FONT_H; j++) for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++) for (i=0; i<w; i++)
@ -129,7 +129,7 @@ int VideoBuffer::BlendCharacter(int x, int y, int c, int r, int g, int b, int a)
int VideoBuffer::AddCharacter(int x, int y, int c, int r, int g, int b, int a) int VideoBuffer::AddCharacter(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
for (j=0; j<FONT_H; j++) for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++) for (i=0; i<w; i++)

View File

@ -136,7 +136,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, std::string s, int r, int g, int
int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a) int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
VideoBuffer texture(w, 12); VideoBuffer texture(w, 12);
texture.SetCharacter(0, 0, c, r, g, b, a); texture.SetCharacter(0, 0, c, r, g, b, a);
@ -166,7 +166,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a
int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a) int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
VideoBuffer texture(w, 12); VideoBuffer texture(w, 12);
texture.AddCharacter(0, 0, c, r, g, b, a); texture.AddCharacter(0, 0, c, r, g, b, a);

View File

@ -111,7 +111,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, std::string s, int r, int g, int
int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a) int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
for (j=0; j<FONT_H; j++) for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++) for (i=0; i<w; i++)
@ -131,7 +131,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a
int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a) int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a)
{ {
int i, j, w, bn = 0, ba = 0; int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c]; unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++); w = *(rp++);
for (j=0; j<FONT_H; j++) for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++) for (i=0; i<w; i++)

View File

@ -1280,9 +1280,9 @@ void Renderer::render_parts()
{ {
caddress = restrict_flt((int)( restrict_flt((float)(sim->parts[i].temp+(-MIN_TEMP)), 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3); caddress = restrict_flt((int)( restrict_flt((float)(sim->parts[i].temp+(-MIN_TEMP)), 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3);
firea = 255; firea = 255;
firer = colr = (unsigned char)color_data[caddress]; firer = colr = color_data[caddress];
fireg = colg = (unsigned char)color_data[caddress+1]; fireg = colg = color_data[caddress+1];
fireb = colb = (unsigned char)color_data[caddress+2]; fireb = colb = color_data[caddress+2];
cola = 255; cola = 255;
if(pixel_mode & (FIREMODE | PMODE_GLOW)) if(pixel_mode & (FIREMODE | PMODE_GLOW))
pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR; pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR;
@ -2268,7 +2268,7 @@ void Renderer::draw_air()
{ {
float ttemp = hv[y][x]+(-MIN_TEMP); float ttemp = hv[y][x]+(-MIN_TEMP);
int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3); int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3);
c = PIXRGB((int)((unsigned char)color_data[caddress]*0.7f), (int)((unsigned char)color_data[caddress+1]*0.7f), (int)((unsigned char)color_data[caddress+2]*0.7f)); c = PIXRGB((int)(color_data[caddress]*0.7f), (int)(color_data[caddress+1]*0.7f), (int)(color_data[caddress+2]*0.7f));
//c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red //c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red
// clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green // clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green
// clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue // clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue

View File

@ -36,10 +36,10 @@ protected:
} }
public: public:
Brush(ui::Point size_): Brush(ui::Point size_):
bitmap(NULL),
outline(NULL), outline(NULL),
radius(0, 0), bitmap(NULL),
size(0, 0) size(0, 0),
radius(0, 0)
{ {
SetRadius(size_); SetRadius(size_);
}; };

View File

@ -19,7 +19,7 @@ public:
virtual ~Menu() virtual ~Menu()
{ {
for(int i = 0; i < tools.size(); i++) for(unsigned int i = 0; i < tools.size(); i++)
{ {
delete tools[i]; delete tools[i];
} }

View File

@ -26,10 +26,10 @@ protected:
std::string icon; std::string icon;
std::string description; std::string description;
QuickOption(std::string icon, std::string description, GameModel * m, Type type) : QuickOption(std::string icon, std::string description, GameModel * m, Type type) :
icon(icon),
description(description),
m(m), m(m),
type(type) type(type),
icon(icon),
description(description)
{ {
} }

View File

@ -122,7 +122,7 @@ void LocalSaveActivity::saveWrite(std::string finalFilename)
void LocalSaveActivity::OnDraw() void LocalSaveActivity::OnDraw()
{ {
Graphics * g = ui::Engine::Ref().g; Graphics * g = ui::Engine::Ref().g;
g->draw_rgba_image((unsigned char*)save_to_disk_image, 0, 0, 0.7f); g->draw_rgba_image(save_to_disk_image, 0, 0, 0.7f);
g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3); g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255); g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);

View File

@ -322,7 +322,7 @@ void ServerSaveActivity::OnTick(float dt)
void ServerSaveActivity::OnDraw() void ServerSaveActivity::OnDraw()
{ {
Graphics * g = ui::Engine::Ref().g; Graphics * g = ui::Engine::Ref().g;
g->draw_rgba_image((unsigned char*)save_to_server_image, -10, 0, 0.7f); g->draw_rgba_image(save_to_server_image, -10, 0, 0.7f);
g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3); g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255); g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);

View File

@ -24,7 +24,7 @@ public:
int NumParts; int NumParts;
bool isMouseInSim; bool isMouseInSim;
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0), isMouseInSim(true) {} SimulationSample() : particle(), ParticleID(0), PositionX(0), PositionY(0), AirPressure(0), AirTemperature(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), NumParts(0), isMouseInSim(true) {}
}; };
#endif #endif

View File

@ -56,9 +56,9 @@ int Element_CFLM::graphics(GRAPHICS_FUNC_ARGS)
{ {
int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3); int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)hflm_data[caddress]; *colr = hflm_data[caddress];
*colg = (unsigned char)hflm_data[caddress+1]; *colg = hflm_data[caddress+1];
*colb = (unsigned char)hflm_data[caddress+2]; *colb = hflm_data[caddress+2];
*firea = 255; *firea = 255;
*firer = *colr; *firer = *colr;

View File

@ -94,7 +94,7 @@ int Element_FIRW::update(UPDATE_FUNC_ARGS)
float angle, magnitude; float angle, magnitude;
int caddress = (rand()%200)*3; int caddress = (rand()%200)*3;
int n; int n;
unsigned col = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2])); unsigned col = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
for (n=0; n<40; n++) for (n=0; n<40; n++)
{ {
np = sim->create_part(-3, x, y, PT_EMBR); np = sim->create_part(-3, x, y, PT_EMBR);