Click here to Skip to main content
16,010,392 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: DirectX problems Pin
gr8coaster3296-Feb-06 12:28
gr8coaster3296-Feb-06 12:28 
AnswerRe: DirectX problems Pin
gr8coaster3296-Feb-06 13:53
gr8coaster3296-Feb-06 13:53 
QuestionHelp needed to check this code below... !!! Pin
amano8u5-Feb-06 13:51
amano8u5-Feb-06 13:51 
AnswerRe: Help needed to check this code below... !!! Pin
PJ Arends5-Feb-06 14:36
professionalPJ Arends5-Feb-06 14:36 
GeneralRe: Help needed to check this code below... !!! Pin
amano8u5-Feb-06 14:41
amano8u5-Feb-06 14:41 
QuestionLast call for help... HEEEELP!!!! Pin
Lord Kixdemp5-Feb-06 11:03
Lord Kixdemp5-Feb-06 11:03 
AnswerRe: Last call for help... HEEEELP!!!! Pin
PJ Arends5-Feb-06 12:02
professionalPJ Arends5-Feb-06 12:02 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Lord Kixdemp5-Feb-06 16:04
Lord Kixdemp5-Feb-06 16:04 
AHA!! YES I FINALLY GOT THERE!!! Big Grin | :-D Big Grin | :-D Big Grin | :-D
(A while ago, I went to a friend's house with my laptop, and I was making this program, and I had gotten to a point in which I was almost about to fix it! But the battery ran out, and I fell asleep as soon as I got home, and the next day I forgot how to get there again... Cry | :(( ) But now I got to that point again! Big Grin | :-D

Look at the file again:

|...........||.......................................................................................................................................................|.............|

outputz.txt outputs exactly like the original (except with 1 extra space at the end), but now it looks like it's a rendering problem... Can you check out my rendering function also? Smile | :)

It has another temp stream, "temp.txt", which outputs this:

|..............................................|.....................|..................................................................|..........|................................

Totally different, as you can see... This function uses the values from this->mapLayers, which I made when in the first function I posted, instead of characters... Here's the new func:

(I was gonna upload it, but my crappy-butt host timed out when accepting my password)

void Mazzee::DrawMap()<br />
{<br />
   FILE * temp = fopen("temp.txt", "wb");<br />
   // Fill with tiles<br />
   <br />
   for (int v = 0; v < 1; v++)<br />
   {<br />
       for (int x = 0; x < WIDTH; x += CHARW)<br />
       {<br />
           for (int y = 0; y < HEIGHT; y += CHARH)<br />
           {<br />
               SDL_Rect src, dest;<br />
<br />
               if (v == 0)<br />
               {<br />
                   if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) fputs(".", temp);<br />
                   else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L1_GRASS) fputs("|", temp);<br />
<br />
                   if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
                   else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L1_GRASS) src.x = CHARW;<br />
               }<br />
               else if (v == 1)<br />
               {<br />
                   if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
                   else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L2_ROCK) src.x = CHARW;<br />
               }<br />
               else if (v == 2)<br />
               {<br />
                   if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == LX_EMPTY) src.x = 0;<br />
                   else if (this->mapLayers[v][(y/32) * (WIDTH/32) + (x/32)] == L3_TELEPORTER) src.x = CHARW;<br />
               }<br />
               else<br />
               {<br />
                   MessageBox(NULL, "Hi!", "None was found...", MB_OK);<br />
               }<br />
<br />
               src.y = 0;<br />
               src.h = CHARH;<br />
               src.w = CHARW;<br />
<br />
               dest.x = x;<br />
               dest.y = y;<br />
               dest.h = CHARH;<br />
               dest.w = CHARW;<br />
<br />
               SDL_BlitSurface(this->mapLayerTiles[v], &src, this->screen, &dest);<br />
           }<br />
       }<br />
   }<br />
<br />
   fclose(temp);<br />
}<br />


Any ideas? Thanks! Wink | ;-)

Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
AnswerRe: Last call for help... HEEEELP!!!! Pin
Christian Graus5-Feb-06 15:23
protectorChristian Graus5-Feb-06 15:23 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Jeremy Falcon5-Feb-06 17:54
professionalJeremy Falcon5-Feb-06 17:54 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Stephen Hewitt5-Feb-06 18:49
Stephen Hewitt5-Feb-06 18:49 
GeneralRe: Last call for help... HEEEELP!!!! Pin
PJ Arends5-Feb-06 18:51
professionalPJ Arends5-Feb-06 18:51 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Christian Graus6-Feb-06 9:00
protectorChristian Graus6-Feb-06 9:00 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Christian Graus6-Feb-06 9:01
protectorChristian Graus6-Feb-06 9:01 
AnswerRe: Last call for help... HEEEELP!!!! Pin
_anil_5-Feb-06 15:58
_anil_5-Feb-06 15:58 
GeneralRe: Last call for help... HEEEELP!!!! Pin
Lord Kixdemp8-Feb-06 10:59
Lord Kixdemp8-Feb-06 10:59 
Question2872: 'IServiceProvider' : ambiguous symbol Pin
JerryMcguire5-Feb-06 8:46
JerryMcguire5-Feb-06 8:46 
AnswerRe: 2872: 'IServiceProvider' : ambiguous symbol Pin
ThatsAlok5-Feb-06 17:37
ThatsAlok5-Feb-06 17:37 
Questionmotherboard serial number in VC++ Pin
RomTibi5-Feb-06 7:07
RomTibi5-Feb-06 7:07 
AnswerRe: motherboard serial number in VC++ Pin
John M. Drescher5-Feb-06 8:12
John M. Drescher5-Feb-06 8:12 
GeneralRe: motherboard serial number in VC++ Pin
RomTibi5-Feb-06 9:52
RomTibi5-Feb-06 9:52 
GeneralRe: motherboard serial number in VC++ Pin
John M. Drescher5-Feb-06 10:37
John M. Drescher5-Feb-06 10:37 
GeneralRe: motherboard serial number in VC++ Pin
suchuhui5-Feb-06 19:40
suchuhui5-Feb-06 19:40 
GeneralRe: motherboard serial number in VC++ Pin
John M. Drescher6-Feb-06 4:39
John M. Drescher6-Feb-06 4:39 
GeneralRe: motherboard serial number in VC++ Pin
suchuhui8-Feb-06 14:41
suchuhui8-Feb-06 14:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.