[QUOTE=garry;16072072]I dunno why you'd even mock up a screenshot like that. We all know what chat boxes look like. I'm talking about coding it, not drawing it. Drawing is easy.[/QUOTE]
Bordem really, garry.. :p I know you could do this in less than a few minutes but.. you know.. just throwing it out there.
:p
[img]http://i28.tinypic.com/jsc0vr.png[/img]
Image and font loading!
[QUOTE=nullsquared;16074141]Probably memory corruption in some of your DLL <-> engine communication with std::string.[/QUOTE]
Yeah, it was a problem with std::string. I was directly using the pointer returned by c_str, and apparently it got flushed as the string object went out of scope. Copying the contents fixed it.
[QUOTE=Vampired;16074260][img]http://i28.tinypic.com/jsc0vr.png[/img]
Image and font loading![/QUOTE]
looking cool.
This is an early version of a simple game I am making. Right now it creates random maps and you can spawn AI that will walk around and if they have enough muscle they can cut down trees. Also if there are stupid enough they will walk on water and drown. Also this is running on my tablet (aka computer that can't run shit).
[URL=http://img9.imageshack.us/i/gamealpha1.png/][IMG]http://img9.imageshack.us/img9/6398/gamealpha1.png[/IMG][/URL]
[URL=http://filesmelt.com/Imagehosting/#007cea61cdd2f201eace61170bbd8b45.png][IMG]http://filesmelt.com/Imagehosting/pics/007cea61cdd2f201eace61170bbd8b45.png[/IMG][/URL]
PROGRESS! Okay its not much but my whole engine broke and now i fixed it it can draw tiles :D
@guru Wow, nice, looks sorta like a minecraft overview
I changed the font from Arial to Tahoma and now the W's are fixed.
[img]http://i31.tinypic.com/2jeuziu.png[/img]
This font looks better anyway.
Nothing, although windowing systems seem to be all the rage now.
Overv, is the derma theme hardcoded, or do you have a skin system?
@OverV, make the corners round and it looks awesome.
[QUOTE=Overv;16077322]I changed the font from Arial to Tahoma and now the W's are fixed.
[img]http://i31.tinypic.com/2jeuziu.png[/img]
This font looks better anyway.[/QUOTE]
Needs slight transparency :buddy:
Also, [url]http://www.gnome.org/fonts/[/url]
Awesome fonts.
[QUOTE=Nevec;16077396]Overv, is the derma theme hardcoded, or do you have a skin system?[/QUOTE]
Well, you can't set the colors outside the class yet, but it's as simple as changing a variable.
[cpp]void guiwindow::draw( )
{
render::drawRect( pos.x, pos.y, size.x, size.y, D3DCOLOR_XRGB( 100, 100, 100 ) );
render::drawLine( pos.x, pos.y + 23, pos.x + size.x, pos.y + 23, D3DCOLOR_XRGB( 65, 65, 65 ) );
render::drawLine( pos.x + size.x - 18, pos.y + 8, pos.x + size.x - 10, pos.y + 16, D3DCOLOR_XRGB( 201, 201, 201 ) );
render::drawLine( pos.x + size.x - 10, pos.y + 8, pos.x + size.x - 18, pos.y + 16, D3DCOLOR_XRGB( 201, 201, 201 ) );
render::drawText( pos.x + 7, pos.y + 5, "windowTitle", text, D3DCOLOR_XRGB( 201, 201, 201 ) );
}[/cpp]
[QUOTE=Jallen;16077713]Needs slight transparency :buddy:[/QUOTE]
Well, it seems to ignore transparency at the moment, I'll look into that.
Seeing as everyones doing UI's i started on mine.
[img]https://files.getdropbox.com/u/99765/chatbox_8.png[/img]
Dragable and resizeable, yay
[QUOTE=qurl;16078304]Seeing as everyones doing UI's i started on mine.
Dragable and resizeable, yay[/QUOTE]
Looking good.
Got transparency working.
[media]http://i25.tinypic.com/2lk5ssw.png[/media]
I just tried my first program with out the aid of the book i'm reading its gone well apart from one slight hiccup
[img]http://img37.imageshack.us/img37/5647/62003303.jpg[/img]
when I run the program(which converts Jovian years(Jupiter) into Earth years) I enter the digit then press enter and it coverts earth years in to Jovian
as you can see here: [img]http://img9.imageshack.us/img9/1712/94422008.jpg[/img]
do you mean cin >> j?
[QUOTE=iPope;16078829]do you mean cin >> j?[/QUOTE]
If he did that then e would be undefined.
What the hell is wrong with it? I don't know Jovian years sorry.
Wait what, you have it all mixed up. You are saying that a number you just asked for as Jovian is earth and that earth is Jovian. I don't understand why that is hard to understand. It's not even programming knowledge based.
[QUOTE=Jallen;16078870]If he did that then e would be undefined.
What the hell is wrong with it? I don't know Jovian years sorry.
Wait what, you have it all mixed up. You are saying that a number you just asked for as Jovian is earth and that earth is Jovian. I don't understand why that is hard to understand. It's not even programming knowledge based.[/QUOTE]
Sorry if im confusing you, but look at the second line its says " 10 earth years" when it should be " 10 jovian years"
[QUOTE=mycheesecake;16078965]Sorry if im confusing you, but look at the second line its says " 10 earth years" when it should be " 10 jovian years"[/QUOTE]
Have you got your variables mixed up, I'm presuming e is earth.
so your pushing jovian years into e, or earth. So should you be doing
cin >> j
and then doing
e= j / 12.00?
Newton fucking forum registration.
[img]http://imgkk.com/i/VCynqL8.png[/img]
[img]http://imgkk.com/i/6E2sJVQU.png[/img]
[img]http://imgkk.com/i/cRzSR6Ks.png[/img]
[img]http://imgkk.com/i/6IP3dvex.png[/img]
SERIOUSLY, FUCK YOU. I want to use that physics engine and therefore forum access is useful, BUT WHAT THE FUCK.
[QUOTE=iPope;16079054]Have you got your variables mixed up, I'm presuming e is earth.
so your pushing jovian years into e, or earth. So should you be doing
cin >> j
and then doing
e= j / 12.00?[/QUOTE]
So, one Jovian year is equal to 12 earth years and my program has got them the wrong way round. Sorry if im confusing you guys
e is for earth
Having experienced what its like first hand to process 240,000 line dictionary files, i'm working on a class to efficiently parse and search through them. I've started with a proof-of-concept program that finds the starting line and byte count of each letter (all the A words, all the B words, etc). The results add up and match those of wc when i run it on the same file. Here's the source:
[code]
#!/usr/bin/perl
use strict;
use warnings;
my (%word_count_of, %char_count_of, );
open my $DICT, '<', "/usr/share/dict/words" or die "can't open dictionary file:$!";
LETTER:
for my $LETTER ('a' .. 'z') {
WORD:
while (defined(my $word = <$DICT>)) {
$word_count_of{$LETTER}++;
$char_count_of{$LETTER} += length $word;
last WORD unless first_lof($word) eq $LETTER;
}
}
close $DICT or die "can't close dictionary:$!";
print "words:\n";
print "$_: $word_count_of{$_}\n" for sort keys %word_count_of;
print "\n";
print "chars:\n";
print "$_: $char_count_of{$_}\n" for sort keys %char_count_of;
my ($wcount, $bcount);
for (values %word_count_of) { $wcount += $_ }
print "total word count: $wcount\n";
for (values %char_count_of) { $bcount += $_ }
print "total char count: $bcount\n";
sub first_lof {
return substr(lc(shift), 0, 1);
}
[/code]
that whole print mess at the bottom is just for debugging.
Here's the output on /usr/share/dict/words:
[code]
words:
a: 17062
b: 11027
c: 19861
d: 10843
e: 8716
f: 6854
g: 6836
h: 8984
i: 8787
j: 1571
k: 2220
l: 6233
m: 12531
n: 6748
o: 7835
p: 24412
q: 1152
r: 9596
s: 25031
t: 12909
u: 16386
v: 3411
w: 3927
x: 385
y: 671
z: 948
chars:
a: 180248
b: 105256
c: 213142
d: 114161
e: 94416
f: 66414
g: 66256
h: 98386
i: 103235
j: 13641
k: 18874
l: 60618
m: 132675
n: 75959
o: 84539
p: 278469
q: 12391
r: 96960
s: 262585
t: 132692
u: 187961
v: 34445
w: 35250
x: 4041
y: 5122
z: 9077
total word count: 234936
total char count: 2486813
[/code]
[QUOTE=Jallen;16079128]Newton fucking forum registration.
[img]http://imgkk.com/i/VCynqL8.png[/img]
[img]http://imgkk.com/i/6E2sJVQU.png[/img]
[img]http://imgkk.com/i/cRzSR6Ks.png[/img]
[img]http://imgkk.com/i/6IP3dvex.png[/img]
SERIOUSLY, FUCK YOU. I want to use that physics engine and therefore forum access is useful, BUT WHAT THE FUCK.[/QUOTE]
Those are super simple, are you blind?
[QUOTE=high6;16079180]Those are super simple, are you blind?[/QUOTE]
harr
Send them a e-mail and complain about it.
It would be even worse when your colorblind!
How the hell did a 6 year old get moderator access on the newton forums? o-O
EDIT: Looking at his username, he might be foreign.. but still, you'd expect a moderator to have basic english typing skills.
[img]http://i28.tinypic.com/x2rmns.jpg[/img]
wat
Can anyone tell me why the bold part of my code doesn't work?
[code]#include <curses.h>
#include <string>
class MenuSystem
{
public:
WINDOW *menuWindow;
int initMenu()
{
menuWindow = initscr();
drawBorder( 0, 0, 80, 25 );
return 0;
}
void titleText( std::string titleString )
{
move( 1, ( ( COLS / 2 ) - ( titleString.length() / 2 ) ) );
printw( titleString.c_str() );
}
void drawBorder( int x, int y, int width, int height )
{
int tempX, tempY;
//top left corner
wmove( menuWindow, x, y );
addch( ACS_ULCORNER );
//top right corner
[b]tempX = x + width - 3;
wmove( menuWindow, tempX, 7 );
mvaddch( tempX, 7, 'z' );[/b]
}
};
int main()
{
MenuSystem mainMenu;
mainMenu.initMenu();
//mainMenu.titleText( "Curses Game" );
int c = 0;
while( c == 0 ){
c = getch();
}
endwin();
return 0;
}[/code]
Sorry, you need to Log In to post a reply to this thread.