-
When performance really matters it's often in C (yep, it's the industry standard, although C++ is coming close). Although now pure code speed isn't so important because lots gets cached on the card anyway.
Unreal I know is written in C++, but that has bits of ASM.
-
...Although the UnrealEd DLLs and UnrealEd itself were written in VB (why I do not know)
-
I think UnrealEd uses the Unreal engine to display the graphics, so they probably decided it was easier to code it in VB :confused:
Although what I don't get is...surely they didn't use that buggy piecea***** to do ALL the Unreal levels? :eek:
-
Would you rather waste time writing a level editor in C++, or get to making levels? I know my choice. There is alsmot NO reason to be writing it in C++, unless you are planning on integrating you map editor into your game (which isnt such a bad diea, now that im thinking of it...).
Z.
-
Zaei I have proposed Map Editor (1st) and Mods (2nd) for TOW...
-
If you're the lazy type, I guess you can use someone else's map editor and then compile the map files to your own bsp files. UnrealEd crashed a lot so i didn't bother use it.
Jotaf, you could do it in c++ as follows:
Template <class T>
inline compare(T** a,T** b){**a=*((*a)++)<*((*b)++);} //or whatever check you want
Template <class T>
comparearrays(T* a,T* b,T* last_a){
for(;lasta>a;)compare(&a,&b);}
i don't know how to export it as a dll though but you could ask parksie ;)
-
I don't think you can export templates from a DLL, this is where I was having trouble with my fatal compiler error :mad:
Think about it, templates in a DLL don't make sense ;)
-
Oh :) that was the problem ;) Well makes sense, you'd need the template contents to compile it for a certain instantiation, maybe you could instantiate some functions for the vb datatypes and have overloaded functions call them inline..
-
Heh thanks anyway Kedaman but I'm a total zero when it comes to C++ (mainly because I never learned anything about it :p )
If you're still interested in the VB source code... it's really easy, but for some reason my DLL crashes VB :eek:
-
-
Exactly what I'm trying to do!
Here's the VB code. I used an article on making C++ DLLs to convert it to C++:
Code:
Public Sub SpecialBltArray(SrcArray() As Byte, DestArray() As Byte, ByVal dX As Long, ByVal dY As Long, SrcX As Long, SrcY As Long, SrcWid As Long, SrcHgt As Long, LookupTableIndex As Long)
Dim cX As Long, cY As Long
Dim AbsX As Long, AbsY As Long
'Loop trough all pixels...
For cX = 0 To SrcWid
For cY = 0 To SrcHgt
'See the resulting value of crossing the effect's R/G/B value with the
'destination's RGB values, in the lookup table.
AbsX = dX + cX
AbsY = dY + cY
DestArray(AbsX, AbsY) = LookupTable(LookupTableIndex, DestArray(AbsX, AbsY), SrcArray(SrcX + cX, SrcY + cY))
Next cY
Next cX
End Sub
-
What does it do? I mean what is it for?
-
It's for special effects. The combination of two colors, trough a special effect (like adding both and making sure the result is not above 255) is kept in 2-dimensional arrays (lookup tables) that are calculated when the game starts. It applies for R, G and B values.
If I want to combine Color1 and Color2 trough effect 3, I use: DestColor = LookupTable(3, Color1, Color2)
Here's an API-only version of it:
http://161.58.186.97/showthread.php?s=&threadid=71234
It works fine in VB (the new DX version, using arrays instead of Get/SetPixel), but I'd like to make it faster...
-
well go for the link, i accedentally posted there ;)
-
No problem, I replied there too :)