The Dink Network

Windowed Mode / 32-bit Mode

August 2nd 2003, 01:51 AM
spike.gif
EDIT: Put up new link.
EDIT: From now on, I will using the account iNvERTIgO.

Hey everyone, I have recently modified the Dink source so that you may now use windowed mode properly and added at 32-bit mode for both windowed and fullscreen modes.

You can download the exe along with the modified source here.

Here is the readme included in the zip:

Dink with Working Windowed Mode Readme
======================================
modified by iNvERTIgO, original functions by Seth A. Robinson

Introduction:
In this zip I have included the source for the functions I have modified to get windowed mode working. I have also included the compiled exe for those who want only to test it. Make sure you read the important notes at the end of this file.

MESSAGE IN CAPS FOR N00BS WHO WON'T LOOK AT BOTTOM: TO USE WINDOWED MODE, YOUR DISPLAY SETTINGS MUST BE SET SO THAT YOUR COLOR DEPTH IS 32-BIT

For those who just want to run it, I should inform you that I have modified the following arguments Dink.exe takes:
-window Activates windowed mode, automatically sets truecolor
-truecolor Activates truecolor mode, can be used in fullscreen
-dinkpal If in truecolor mode, all sprites will use the dink palette*

* = See last note on bottom

Comments:
About a week ago I found out that the Dink source had been released. I thought adding windowed mode would be a good first step into gaining a basic understanding of how the extremely messy code works. Soon I windowed mode working. Since then I've gotten a little sidetracked working on a DMOD, but now I've decided to release the modified code. It's not much, but I might add some more to it later (ex. 24-bit bitmap loading).

Basically, I have released this little modification in an attempt to give people something to work with while The Dink Project people are slaving away reorganizing code. I fully support what they are doing, and I know that this will be pretty much useless when they finish and the new code comes out with an über shine to it

Instructions:
In the included .c files you will find the modified functions. Replace the ones in dink.cpp and dinkvars.h with the new ones, compile, and viola, working windowed and truecolor modes. By the way, I know this section is pointless; those who actually plan on doing this are smart enough to figure it out on their own

As for globals.c, just add the two bools to the top of dinkvar.h

Important Notes:
- For now, only 32-bit mode has been added; I may add 16-bit support later, although I would encourage someone else to do it
- Fades do not show in 32-bit mode because they were previously accomplished by darkening the palette. This obviously does not work in true color.
- Some DMOD's (such as Cycles of Evil) use a trick in DinkC to change the palette in the middle of the game. In order for this to work in true color... well... it's just plain messy . There are multiple workarounds, one of them being changing all of the sprites and tiles in memory, but that's a slow process. For now, DMOD's that change palettes in game won't look completely right, but the sprites might look ok (see next note)

* In 32-bit mode, the program uses the palette associated with each sprite, allowing completely different palettes to be used. Using the -dinkpal argument will force all sprites to use the Dink palette

I hope people will be able to make use of this addition to Dink.
August 2nd 2003, 03:07 AM
anon.gif
Hugmungustes
Ghost
 
Hey the first new engine modification - well done! I will have to test this...
August 2nd 2003, 03:08 AM
wizardb.gif
I'll vouch for this, if my word means anything around here. He's been working hard to get this out and make sure it was well documented, have fun with it guys.
August 2nd 2003, 09:15 AM
wizardb.gif
merlin
Peasant Male
 
Thank you, I thought jameson (and possibly me, very unlikely ) was the only one doing real work around here. But, do you have another address to download from? That one has exceeded it's bandwidth limit.
August 2nd 2003, 01:15 PM
wizardb.gif
New URL works good
August 2nd 2003, 01:23 PM
peasantmb.gif
Edit: um...dinkvars.h and dink.cpp?
What are these?
August 2nd 2003, 01:56 PM
spike.gif
EDIT: From now on, I will using the account iNvERTIgO.

The files dinkvars.h and dink.cpp are parts of the Dink source code. You have to alter them by replacing functions with the ones included in the zip, then recompile the exe. Dinkmega, you don't sound like a programmer, so you should just use the included Dink.exe that I have already compiled
August 4th 2003, 12:33 AM
custom_odd.gif
Ok, so for someone that knows NOTHING about programming, what do you need to do besides taking the exe included? I did that, but you mentioned using commands for the 32bit and windowed modes, and I know nothing of this.
August 4th 2003, 02:03 AM
spike.gif
Right click on Dink.exe, the click create shortcut. Then, right click on the shortcut and go to properties. Locate the edit box labeled "Target:", then go to the end of it and add the commands you want. A list of commands and their descriptions is included in the readme as well as my first post.
Example target: "D:\dink\Dink.exe"
Target modified for windowed mode: "D:\dink\Dink.exe" -window
August 4th 2003, 03:41 AM
custom_odd.gif
Righto, thanks. Seems to work with the original.. my dmod made it crash, but maybe that was just a fluke the first time it ran.

Seems to be a bit choppy, but otherwise neat. Now, the 32 bit won't effect the looks of the original graphics at all, but you can now add graphics beyond the pallete, correct?
August 4th 2003, 04:24 AM
goblinh.gif
xanthos
Peasant Male
 
The way that this implentation works in 32bit currently is kinda like this...

It still only loads 8 bit images, however it can load them with any pallete. Each image can have its own pallete basically.

iNvERTIgO is planning on adding true 32 bit color image support soon though.

One question, Okaly, What kinda computer you running on. It would help iNvERTIgo see whether its a code problem or ust and old computer

Also if your dmod continues to crash send it to him, he can run the EXE in debug mode and track down the crash and probably fix the problem.
August 4th 2003, 05:00 AM
maidenp.gif
But how to start your dmods in windowed mode ?
August 4th 2003, 05:03 AM
wizardb.gif
Kyle
Peasant Male Belgium
 
Just put -game behind your -window.
August 6th 2003, 12:02 AM
custom_odd.gif
My computer is an 1800+ with 512 ram and a 64 meg vid card.. it's not that. I'll look into it, but it was probably something simply because of my mod...
August 6th 2003, 01:10 AM
wizardb.gif
Hmm most likely not. It's quite possible its something we've overlooked in testing. We only have run it on 2-3 PC's with a handful of DMods.
August 14th 2003, 04:49 AM
wizardb.gif
Kyle
Peasant Male Belgium
 
Are we gonna see those 16/32 bit graphics any time soon? I've been willing to convert the graphics for Legend's Tale to the more beautiful standard, but if the 16/32 bit bmps are almost ready then I'll better wait.